All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Integrity constraint violation: 1048 Column 'variable_data' cannot be null

ebreezy 13 Jun 2018 14:59 problem, complete

Hi Low.
This site works great on my server, but when i install it on the client's server, I am unable to edit low variable fields of the grid type.

Do you have any idea how this can be fixed? Whenever i click save on the variables i get this:

Exception Caught
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'variable_data' cannot be null:
UPDATE 'exp_global_variables' SET 'variable_data' = NULL WHERE 'variable_id' = 22

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('UPDATE 'exp_glo...')
#1 ee/legacy/database/DB_driver.php(269): CI_DB_mysqli_driver->_execute('UPDATE 'exp_glo...')
#2 ee/legacy/database/DB_driver.php(179): CI_DB_driver->simple_query('UPDATE 'exp_glo...')
#3 ee/legacy/database/DB_active_rec.php(1476): CI_DB_driver->query('UPDATE 'exp_glo...')
#4 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(128): CI_DB_active_record->update('global_variable...')
#5 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(98): EllisLab\ExpressionEngine\Service\Model\Query\Update->actOnGateway(Object(EllisLab\ExpressionEngine\Service\Model\SyntheticGateway), Object(EllisLab\ExpressionEngine\Model\Template\GlobalVariable))
#6 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(47): EllisLab\ExpressionEngine\Service\Model\Query\Update->doWork(Object(EllisLab\ExpressionEngine\Model\Template\GlobalVariable))
#7 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(281): EllisLab\ExpressionEngine\Service\Model\Query\Update->run()
#8 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(247): EllisLab\ExpressionEngine\Service\Model\DataStore->runQuery('Update', Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
#9 ee/EllisLab/ExpressionEngine/Service/Model/Query/Builder.php(70): EllisLab\ExpressionEngine\Service\Model\DataStore->updateQuery(Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
#10 ee/EllisLab/ExpressionEngine/Service/Model/Model.php(360): EllisLab\ExpressionEngine\Service\Model\Query\Builder->update()
#11 user/addons/low_variables/models/low_variables_variable_model.php(135): EllisLab\ExpressionEngine\Service\Model\Model->save()
#12 [internal function]: Low_variables_variable_model->{closure}(Object(EllisLab\ExpressionEngine\Model\Template\GlobalVariable))
#13 ee/EllisLab/ExpressionEngine/Library/Data/Collection.php(290): array_map(Object(Closure), Array)
#14 user/addons/low_variables/models/low_variables_variable_model.php(136): EllisLab\ExpressionEngine\Library\Data\Collection->each(Object(Closure))
#15 user/addons/low_variables/mcp.low_variables.php(403): Low_variables_variable_model->update(22, Array)
#16 [internal function]: Low_variables_mcp->save('6')
#17 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(1661): call_user_func_array(Array, Array)
#18 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(945): EllisLab\ExpressionEngine\Controller\Addons\Addons->getModuleSettings('low_variables', 'save', Array)
#19 [internal function]: EllisLab\ExpressionEngine\Controller\Addons\Addons->settings('low_variables', 'save', '6')
#20 ee/EllisLab/ExpressionEngine/Core/Core.php(240): call_user_func_array(Array, Array)
#21 ee/EllisLab/ExpressionEngine/Core/Core.php(109): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#22 ee/EllisLab/ExpressionEngine/Boot/boot.php(146): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#23 html/admin.php(147): require_once('...')
#23 html/admin.php(147): require_once('...')

Thanks for your help!

Replies

  1. Low 13 Jun 2018 15:05

    Can you try and implement this workaround?

  2. ebreezy 13 Jun 2018 18:25

    thanks. but, that did not work.

  3. ebreezy 13 Jun 2018 18:28

    Actually, the change was saved, but the error still loaded. so, progress.

  4. ebreezy 13 Jun 2018 18:43

    sorry, disregard the last comment. changes not saving.

  5. Low 14 Jun 2018 06:19

    Can you try and run this query and see if it helps?

    ALTER TABLE exp_global_variables MODIFY COLUMN variable_data TEXT;

  6. ebreezy 14 Jun 2018 14:28

    no luck.

  7. Low 14 Jun 2018 14:58

    I'll need to take a look myself. Please send SuperAdmin login credentials to hi at gotolow dot com if you can.

  8. ebreezy 14 Jun 2018 15:18

    sending now.

  9. Low 14 Jun 2018 16:18

    Okay, I ran the query above and tried again, and the error message went away. Maybe you ran the query on a different database?

  10. ebreezy 15 Jun 2018 17:47

    sorry, thanks!!!

  11. Josh Brodleit 24 Aug 2018 21:19

    Same issue on my end. Ran query in DB and resolved issue.