Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'default_author' cannot be null' Error when saving channel settings #153

Closed
wernergusset opened this Issue Mar 10, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@wernergusset
Copy link

wernergusset commented Mar 10, 2019

Description of the problem

Save a channel setting without selecting a default author gives an error 'default_author' cannot be null'
It's an old EE site upgraded to 5.2.

Only a subadmin member is registred.

Error Messages


SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'default_author' cannot be null:
UPDATE `exp_channel_form_settings` SET `default_author` = NULL WHERE `channel_form_settings_id` = '2'
ee/legacy/database/drivers/mysqli/mysqli_connection.php:117

Stack Trace: Please include when reporting this error
#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query('UPDATE `exp_cha...')
#1 ee/legacy/database/DB_driver.php(270): CI_DB_mysqli_driver->_execute('UPDATE `exp_cha...')
#2 ee/legacy/database/DB_driver.php(180): CI_DB_driver->simple_query('UPDATE `exp_cha...')
#3 ee/legacy/database/DB_active_rec.php(1477): CI_DB_driver->query('UPDATE `exp_cha...')
#4 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(129): CI_DB_active_record->update('channel_form_se...')
#5 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(99): EllisLab\ExpressionEngine\Service\Model\Query\Update->actOnGateway(Object(EllisLab\ExpressionEngine\Service\Model\SyntheticGateway), Object(EllisLab\ExpressionEngine\Model\Channel\ChannelFormSettings))
#6 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(48): EllisLab\ExpressionEngine\Service\Model\Query\Update->doWork(Object(EllisLab\ExpressionEngine\Model\Channel\ChannelFormSettings))
#7 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(282): EllisLab\ExpressionEngine\Service\Model\Query\Update->run()
#8 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(248): EllisLab\ExpressionEngine\Service\Model\DataStore->runQuery('Update', Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
#9 ee/EllisLab/ExpressionEngine/Service/Model/Query/Builder.php(71): EllisLab\ExpressionEngine\Service\Model\DataStore->updateQuery(Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
#10 ee/EllisLab/ExpressionEngine/Service/Model/Model.php(361): EllisLab\ExpressionEngine\Service\Model\Query\Builder->update()
#11 ee/EllisLab/ExpressionEngine/Service/Model/Association/Association.php(224): EllisLab\ExpressionEngine\Service\Model\Model->save()
#12 ee/EllisLab/ExpressionEngine/Service/Model/Model.php(369): EllisLab\ExpressionEngine\Service\Model\Association\Association->save()
#13 ee/EllisLab/ExpressionEngine/Controller/Channels/Channels.php(1433): EllisLab\ExpressionEngine\Service\Model\Model->save()
#14 ee/EllisLab/ExpressionEngine/Controller/Channels/Channels.php(246): EllisLab\ExpressionEngine\Controller\Channels\Channels->saveChannel(Object(EllisLab\ExpressionEngine\Model\Channel\Channel))
#15 ee/EllisLab/ExpressionEngine/Controller/Channels/Channels.php(179): EllisLab\ExpressionEngine\Controller\Channels\Channels->form('12')
#16 [internal function]: EllisLab\ExpressionEngine\Controller\Channels\Channels->edit('12')
#17 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Array, Array)
#18 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#19 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#20 admin.php(147): require_once('...')
#20 admin.php(147): require_once('...')

Environment Details:

  • Version: 5,2
  • PHP Version 7.2.15
  • MySQL Version 10.2.22-MariaDB
@jonleecraw

This comment has been minimized.

Copy link

jonleecraw commented Mar 10, 2019

Supporting this bug report:

https://expressionengine.stackexchange.com/questions/41139/default-author-cannot-be-null-error-when-saving-channel-settings/41140#41140

Across php7 and php5, I've experienced this bug for EE4.x and EE5.x.

@derekjones

This comment has been minimized.

Copy link
Contributor

derekjones commented Mar 10, 2019

Are you sure you're on the latest version? Looks like this was fixed in 5.2.0, ref #124. If you've confirmed that, can you walk us through how to save a channel without a default author selected? I'm unable to do so on the latest version. Thanks!

@wernergusset

This comment has been minimized.

Copy link
Author

wernergusset commented Mar 11, 2019

channel_settings_save 01.zip

There is a screen video in the zip.

It's EE 5.2.

@wernergusset

This comment has been minimized.

Copy link
Author

wernergusset commented Mar 11, 2019

I just worked on another EE 5.2 Install where I changed channel settings and saved without an error.

@derekjones

This comment has been minimized.

Copy link
Contributor

derekjones commented Mar 11, 2019

Thank you for that @wernergusset. It looks like you have no authors or member groups with "Include in...Author Lists" on the site where it is still not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.