UndefinedOffset / SortableGridField

Adds drag and drop functionality to Silverstripe's GridField
BSD 3-Clause "New" or "Revised" License
93 stars 62 forks source link

Tests required for tables with $table_name declared #105

Closed zanderwar closed 7 years ago

zanderwar commented 7 years ago

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

UndefinedOffset commented 7 years ago

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

zanderwar commented 7 years ago

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