We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

MySQL error when loading a Grid field in Low Variables

Developer Preview

Low's avatar
Low
407 posts
7 years ago
Low's avatar Low

When visiting a LV CP page containing a Grid field, I get this error message:

Exception Caught

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fluid_field_data_id' in 'where clause':
SELECT * FROM (`exp_low_variables_grid_field_104`) WHERE `entry_id` IN (104) AND `fluid_field_data_id` = 0 ORDER BY `row_order` asc

ee/legacy/database/drivers/mysqli/mysqli_connection.php:116

Stack Trace: Please include when reporting this error

#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(111): CI_DB_mysqli_connection->query('SELECT *\nFROM (...')
#1 ee/legacy/database/DB_driver.php(269): CI_DB_mysqli_driver->_execute('SELECT *\nFROM (...')
#2 ee/legacy/database/DB_driver.php(179): CI_DB_driver->simple_query('SELECT *\nFROM (...')
#3 ee/legacy/database/DB_active_rec.php(1137): CI_DB_driver->query('SELECT *\nFROM (...')
#4 ee/legacy/models/grid_model.php(436): CI_DB_active_record->get('low_variables_g...')
#5 ee/EllisLab/Addons/grid/libraries/Grid_lib.php(60): Grid_model->get_entry_rows(Array, 104, 'low_variables', Array, false, 0)
#6 ee/EllisLab/Addons/grid/ft.grid.php(137): Grid_lib->display_field(Object(EllisLab\ExpressionEngine\Library\CP\GridInput), ' ')
#7 /Users/low/Software/low_variables/low_variables/types/type.low_variables.php(186): Grid_ft->display_field(' ')
#8 /Users/low/Software/low_variables/low_variables/types/low_grid/vt.low_grid.php(96): Low_variables_type->call_ft('display_field', ' ')
#9 /Users/low/Software/low_variables/low_variables/mcp.low_variables.php(258): Low_grid->display_field(' ')
#10 [internal function]: Low_variables_mcp->group('6')
#11 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(1609): call_user_func_array(Array, Array)
#12 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(893): EllisLab\ExpressionEngine\Controller\Addons\Addons->getModuleSettings('low_variables', 'group', Array)
#13 [internal function]: EllisLab\ExpressionEngine\Controller\Addons\Addons->settings('low_variables', 'group', '6')
#14 ee/EllisLab/ExpressionEngine/Core/Core.php(229): call_user_func_array(Array, Array)
#15 ee/EllisLab/ExpressionEngine/Core/Core.php(109): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#16 ee/EllisLab/ExpressionEngine/Boot/boot.php(146): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#17 admin.php(147): require_once('...')
#17 admin.php(147): require_once('...')

LV calls the Grid field type, which (by the looks of it) tries to include a fluid field id, which doesn’t exist in the low_variables_grid_field_x tables.

Looks like the updater doesn’t update 3rd party content types’ Grid fields. Is that a bug, or is that up to the 3rd party dev?

       
Derek Jones's avatar
Derek Jones
7,561 posts
7 years ago
Derek Jones's avatar Derek Jones

That’s a good question, Low, I’ll make that a priority Monday to get the correct answer for you. In the meantime, does manually adding that column to your Grid tables resolve the issue fully? It should be a normal unsigned INT column.

       
Low's avatar
Low
407 posts
7 years ago
Low's avatar Low

Yeah, manually adding the fluid_field_data_id column to all LV Grid tables fixes this issue.

       
Derek Jones's avatar
Derek Jones
7,561 posts
7 years ago
Derek Jones's avatar Derek Jones

Thanks! We’ll get back to you with an answer on Monday.

       
Seth Barber's avatar
Seth Barber
172 posts
7 years ago
Seth Barber's avatar Seth Barber

Hi Low,

We only add the fluid_field_data_id column to the Relationships table and all our Grid field tables since they store their field data separately, and we need a way to mark the data is inside a Fluid Field. Looking at copy of Low Variables (v3.0.4) it looks like you are instantiating your own copy of the Grid fieldtype and storing data in your own table. I’ve been trying to come up with a way to detect this kind of usage during our update so we could add this column to your tables, but I’m not coming up with anything right now. If you have a way our app could find your grid tables I’d be happy to add this column during the 4.0 update, otherwise, you will have to add it in your add-on’s update routine.

       
Low's avatar
Low
407 posts
7 years ago
Low's avatar Low

Well, the Grid field itself generates the exp_[content-type]_grid_field_x tables. So I guess you could query the exp_content_types table, then check for all existing exp_[content-types]_grid_field_x tables to see if the fluid_field_data_id is present, and add it if necessary. Since Low Variables itself doesn’t generate Grid’s tables, I would assume Grid would take care of its own compatibility here.

       
Seth Barber's avatar
Seth Barber
172 posts
7 years ago
Seth Barber's avatar Seth Barber

I’ve modified the update routine to find all grid field tables and add the fluid_field_data_id column to them. It should be in the next release.

       
Low's avatar
Low
407 posts
7 years ago
Low's avatar Low

Perfect, thanks.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.