UndefinedOffset/SortableGridField

Tests required for tables with $table_name declared

zanderwar opened this issue · 2 comments

I'm currently migrating this module over to SS4 and have discovered:

MySQL has a max table name of 64 characters and when appending the FQCN to the table as required by SS4, these tables will not be built.

Therefore it is required to add private static $table_name to remove the FQCN from the table name and as the UPDATE calls don't check for the existence of a table_name configuration option, the tests failed, heres my fix:

$table = (Config::inst()->get($table, 'table_name', CONFIG::UNINHERITED)) ? Config::inst()->get($table, 'table_name', CONFIG::UNINHERITED) : $table;

After adding this everywhere it's required, this fixes the issue with DataObjects that have declared $table_name

The reason I'm bringing this up is it because it also looks like this bug would exist in the SS3 version [scrap that] $table_name isn't introduced until version 4

Sorry miss tagged this I think this does sound like a bug to me after reading closer

This is not even available until SS4, closing issue as resolved in #106