Closed Gerharbo closed 3 years ago
Thanks for reporting. I found a way to reproduce this: when editing a draft (either a normal draft or a “provisional draft”), if the upstream entry had been enabled for a new site, and contained new Matrix blocks which needed to be merged into the draft.
Just fixed for the next release. To get the fix early, change your craftcms/cms
requirement in composer.json to "dev-develop as 3.7.14"
and run composer update
.
Hi @brandonkelly,
Thanks for the quick fix! And we can confirm: it's fixed!
@brandonkelly, i'm still seeing this exact error on 3.7.14 when just viewing a draft of an entry.
yii\base\ErrorException: Undefined array key 1
#22 /var/www/vendor/craftcms/cms/src/services/Matrix.php(1013): yii\base\ErrorHandler::handleError
#21 /var/www/vendor/craftcms/cms/src/web/ErrorHandler.php(81): craft\web\ErrorHandler::handleError
#20 /var/www/vendor/sentry/sentry/src/ErrorHandler.php(303): Sentry\ErrorHandler::handleError
#19 /var/www/vendor/craftcms/cms/src/services/Matrix.php(1013): craft\services\Matrix::mergeCanonicalChanges
#18 /var/www/vendor/craftcms/cms/src/fields/Matrix.php(1035): craft\fields\Matrix::afterElementPropagate
#17 /var/www/vendor/craftcms/cms/src/base/Element.php(4114): craft\base\Element::afterPropagate
#16 /var/www/vendor/craftcms/cms/src/elements/Entry.php(1670): craft\elements\Entry::afterPropagate
#15 /var/www/vendor/craftcms/cms/src/services/Elements.php(842): craft\services\Elements::craft\services\{closure}
#14 [internal](0): call_user_func
#13 /var/www/vendor/yiisoft/yii2/db/Connection.php(814): yii\db\Connection::transaction
#12 /var/www/vendor/craftcms/cms/src/services/Elements.php(843): craft\services\Elements::mergeCanonicalChanges
#11 /var/www/vendor/craftcms/cms/src/controllers/EntriesController.php(678): craft\controllers\EntriesController::_prepEditEntryVariables
#10 /var/www/vendor/craftcms/cms/src/controllers/EntriesController.php(81): craft\controllers\EntriesController::actionEditEntry
#9 [internal](0): call_user_func_array
#8 /var/www/vendor/yiisoft/yii2/base/InlineAction.php(57): yii\base\InlineAction::runWithParams
#7 /var/www/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\Controller::runAction
#6 /var/www/vendor/craftcms/cms/src/web/Controller.php(189): craft\web\Controller::runAction
#5 /var/www/vendor/yiisoft/yii2/base/Module.php(534): yii\base\Module::runAction
#4 /var/www/vendor/craftcms/cms/src/web/Application.php(277): craft\web\Application::runAction
#3 /var/www/vendor/yiisoft/yii2/web/Application.php(104): yii\web\Application::handleRequest
#2 /var/www/vendor/craftcms/cms/src/web/Application.php(262): craft\web\Application::handleRequest
#1 /var/www/vendor/yiisoft/yii2/base/Application.php(392): yii\base\Application::run
#0 /index.php(25): null
Specs:
Application Info
PHP version 8.0.11
OS version Linux 4.15.0-147-generic
Database driver & version MySQL 8.0.23
Image driver & version GD 8.0.11
Craft edition & version Craft Pro 3.7.14
Yii version 2.0.43
Twig version v2.14.7
Guzzle version 6.5.5
Plugins
Asset Usage 2.2.1
Buckaroo for Craft Commerce 1.1.0.1
Color Extractor 2.0.6.1
Craft Commerce 3.4.3
fortrabbit Object Storage Volume 2.1.0
Linkit 1.1.12.1
Maps 3.9.2
Redactor 2.8.8
Sentry SDK 1.1.2
SEOmatic 3.4.15
Super Table 2.6.8
Two-Factor Authentication 2.9.0
Vite 1.0.16
@roelvanhintum it's not released yet. You can use the dev version:
Just fixed for the next release. To get the fix early, change your
craftcms/cms
requirement in composer.json to"dev-develop as 3.7.14"
and run composer update.
Craft 3.7.15 is out now with this fix.
Description
The user tries to open a specific page with a Matrix element. The user receives an Internal Server error message.
Stacktrace:
The
$localizedOwners
in the functionmergeCanonicalChanges()
(https://github.com/craftcms/cms/blob/develop/src/services/Matrix.php#L946) is empty and therefore the owner can't be set on line 1013 (https://github.com/craftcms/cms/blob/develop/src/services/Matrix.php#L1013).The query for
$localizedOwners
searches for the element in other sites, which is disabled for this entry type by default.Steps to reproduce
No clear steps to reproduce this error. But if we add a date to the
dateDeleted
field in theelements
table the functionmergeCanonicalChanges()
isn't called and the page works again.Additional info