solspace / craft-calendar

Calendar for Craft: The most reliable and powerful event management plugin for Craft.
http://docs.solspace.com/craft/calendar/v5
Other
15 stars 14 forks source link

Column 'titleTranslationMethod' cannot be null #196

Closed jonaswouters closed 1 year ago

jonaswouters commented 1 year ago

Describe the bug or issue you're experiencing

When updating an existing calendar, you get an error on the titleTranslationMethod field:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'titleTranslationMethod' cannot be null
The SQL being executed was: UPDATE `calendar_calendars` SET `uid`='e1fcc1d9-ff92-4c34-afd8-42ea0c5574d2', `name`='Club', `handle`='club', `description`='', `color`='#437344', `titleTranslationMethod`=NULL, `titleTranslationKeyFormat`=NULL, `descriptionFieldHandle`='0', `locationFieldHandle`='0', `icsHash`=NULL, `icsTimezone`='floating', `titleFormat`='', `titleLabel`='Titel', `hasTitleField`=1, `allowRepeatingEvents`=1, `fieldLayoutId`=22, `dateUpdated`='2023-01-26 09:04:36' WHERE `id`=2

Steps to reproduce

  1. Update an existing calendar in version 4.0.3

Expected behavior

Craft & Plugin Info (please complete the following information):

Additional context

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'titleTranslationMethod' cannot be null in /var/www/html/vendor/yiisoft/yii2/db/Command.php:1302
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1102): yii\db\Command->internalExecute('UPDATE `calenda...')
#2 /var/www/html/vendor/solspace/craft-calendar/packages/plugin/src/Bundles/ProjectConfig/CalendarProjectConfig.php(68): yii\db\Command->execute()
#3 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(1125): Solspace\Calendar\Bundles\ProjectConfig\CalendarProjectConfig->handleChange(Object(craft\events\ConfigEvent))
#4 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#5 /var/www/html/vendor/yiisoft/yii2/base/Component.php(633): call_user_func(Array, Object(craft\events\ConfigEvent))
#6 /var/www/html/vendor/craftcms/cms/src/models/ProjectConfigData.php(82): yii\base\Component->trigger('updateItem', Object(craft\events\ConfigEvent))
#7 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(515): craft\models\ProjectConfigData->commitChanges(Array, Array, 'solspace.calend...', true, NULL, true)
#8 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(475): craft\services\ProjectConfig->_setInternal('solspace.calend...', Array, NULL, true, false)
#9 /var/www/html/vendor/solspace/craft-calendar/packages/plugin/src/Services/CalendarsService.php(304): craft\services\ProjectConfig->set('solspace.calend...', Array)
#10 /var/www/html/vendor/solspace/craft-calendar/packages/plugin/src/Controllers/CalendarsController.php(264): Solspace\Calendar\Services\CalendarsService->saveCalendar(Object(Solspace\Calendar\Models\CalendarModel))
#11 [internal function]: Solspace\Calendar\Controllers\CalendarsController->actionSaveCalendar()
#12 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#13 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#14 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('save-calendar', Array)
#15 /var/www/html/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('calendar/calend...', Array)
#16 /var/www/html/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('calendar/calend...', Array)
#17 /var/www/html/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#18 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#19 /var/www/html/web/index.php(12): yii\base\Application->run()
#20 {main}

Next yii\db\IntegrityException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'titleTranslationMethod' cannot be null
The SQL being executed was: UPDATE `calendar_calendars` SET `uid`='e1fcc1d9-ff92-4c34-afd8-42ea0c5574d2', `name`='Club', `handle`='club', `description`='', `color`='#437344', `titleTranslationMethod`=NULL, `titleTranslationKeyFormat`=NULL, `descriptionFieldHandle`='0', `locationFieldHandle`='0', `icsHash`=NULL, `icsTimezone`='floating', `titleFormat`='', `titleLabel`='Titel', `hasTitleField`=1, `allowRepeatingEvents`=1, `fieldLayoutId`=22, `dateUpdated`='2023-01-26 09:15:14' WHERE `id`=2 in /var/www/html/vendor/yiisoft/yii2/db/Schema.php:676
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1307): yii\db\Schema->convertException(Object(PDOException), 'UPDATE `calenda...')
#1 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1102): yii\db\Command->internalExecute('UPDATE `calenda...')
#2 /var/www/html/vendor/solspace/craft-calendar/packages/plugin/src/Bundles/ProjectConfig/CalendarProjectConfig.php(68): yii\db\Command->execute()
#3 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(1125): Solspace\Calendar\Bundles\ProjectConfig\CalendarProjectConfig->handleChange(Object(craft\events\ConfigEvent))
#4 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#5 /var/www/html/vendor/yiisoft/yii2/base/Component.php(633): call_user_func(Array, Object(craft\events\ConfigEvent))
#6 /var/www/html/vendor/craftcms/cms/src/models/ProjectConfigData.php(82): yii\base\Component->trigger('updateItem', Object(craft\events\ConfigEvent))
#7 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(515): craft\models\ProjectConfigData->commitChanges(Array, Array, 'solspace.calend...', true, NULL, true)
#8 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(475): craft\services\ProjectConfig->_setInternal('solspace.calend...', Array, NULL, true, false)
#9 /var/www/html/vendor/solspace/craft-calendar/packages/plugin/src/Services/CalendarsService.php(304): craft\services\ProjectConfig->set('solspace.calend...', Array)
#10 /var/www/html/vendor/solspace/craft-calendar/packages/plugin/src/Controllers/CalendarsController.php(264): Solspace\Calendar\Services\CalendarsService->saveCalendar(Object(Solspace\Calendar\Models\CalendarModel))
#11 [internal function]: Solspace\Calendar\Controllers\CalendarsController->actionSaveCalendar()
#12 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#13 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#14 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('save-calendar', Array)
#15 /var/www/html/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('calendar/calend...', Array)
#16 /var/www/html/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('calendar/calend...', Array)
#17 /var/www/html/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#18 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#19 /var/www/html/web/index.php(12): yii\base\Application->run()
#20 {main}
Additional Information:
Array
(
    [0] => 23000
    [1] => 1048
    [2] => Column 'titleTranslationMethod' cannot be null
)
kjmartens commented 1 year ago

I'm very sorry for the trouble @jonaswouters. I will check into it and see what might be up here. In the meantime, can you try downgrading to Calendar 4.0.2 instead? The issue won't happen there. 🙂

jonaswouters commented 1 year ago

try downgrading to Calendar 4.0.2 instead? The issue won't happen there. 🙂

Already did for now. I just wanted to report the issue.

If you need any more info, I'm happy to help!

seandelaney commented 1 year ago

@jonaswouters

What MySQL version are you running?

kjmartens commented 1 year ago

Don't worry @jonaswouters... we were able to reproduce the issue now. 🙂

kjmartens commented 1 year ago

This should now be resolved in 4.0.4. Sorry again for the trouble. 🙂