verbb / super-table

Super-charge your Craft workflow using Super Table.
MIT License
316 stars 47 forks source link

Super Table Undefined property error when entry is saved #397

Closed louderthan10 closed 3 years ago

louderthan10 commented 3 years ago

Description I can't save an entry with a SuperTable field. When I try to publish the entry, I get the error:

yii\base\ErrorException: Undefined property: verbb\supertable\elements\db\SuperTableBlockQuery::$heading in /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/ArrayableTrait.php:126

I found it first when added an ST field via a Neo block or Matrix, but also seems to happen any time an ST field is part of an entry. This started happening after updating Super Table from 2.6.3 and Craft from 3.5.14.

(stack trace pasted below)

Steps to reproduce

  1. Edit or create a new entry
  2. Add a Neo or Matrix block containing a Super Table field (or any entry w/ a ST field)
  3. Recieve a "Draft could not be saved" alert
  4. Publish the entry
  5. Error occurs

Additional info

Additional context

Stack trace:

yii\base\ErrorException: Undefined property: verbb\supertable\elements\db\SuperTableBlockQuery::$heading in /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/ArrayableTrait.php:126
Stack trace:
#0 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/web/ErrorHandler.php(76): yii\base\ErrorHandler->handleError(8, 'Undefined prope...', '/Users/trav/Web...', 126)
#1 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/ArrayableTrait.php(126): craft\web\ErrorHandler->handleError(8, 'Undefined prope...', '/Users/trav/Web...', 126, Array)
#2 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1638): craft\elements\db\ElementQuery->toArray(Array, Array, false)
#3 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1591): craft\elements\db\ElementQuery->getCriteria()
#4 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1502): craft\elements\db\ElementQuery->getCachedResult()
#5 /Users/trav/Websites/louderthanten/vendor/verbb/super-table/src/elements/db/SuperTableBlockQuery.php(110): craft\elements\db\ElementQuery->one()
#6 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/ArrayableTrait.php(126): verbb\supertable\elements\db\SuperTableBlockQuery->__get('heading')
#7 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1638): craft\elements\db\ElementQuery->toArray(Array, Array, false)
#8 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1611): craft\elements\db\ElementQuery->getCriteria()
#9 /Users/trav/Websites/louderthanten/vendor/verbb/super-table/src/fields/SuperTableField.php(539): craft\elements\db\ElementQuery->setCachedResult(Array)
#10 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/base/Element.php(3345): verbb\supertable\fields\SuperTableField->normalizeValue('', Object(benf\neo\elements\Block))
#11 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/base/Element.php(2658): craft\base\Element->normalizeFieldValue('grid')
#12 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/base/Element.php(1432): craft\base\Element->getFieldValue('grid')
#13 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/validators/Validator.php(258): craft\base\Element->__get('field:grid')
#14 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\Validator->validateAttributes(Object(benf\neo\elements\Block), Array)
#15 /Users/trav/Websites/louderthanten/vendor/spicyweb/craft-neo/src/Field.php(502): yii\base\Model->validate()
#16 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/base/Element.php(1753): benf\neo\Field->validateBlocks(Object(craft\elements\Entry), NULL)
#17 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/validators/InlineValidator.php(84): craft\base\Element->validateCustomFieldAttribute('field:pageConte...', Array, Object(yii\validators\InlineValidator), Object(benf\neo\elements\db\BlockQuery))
#18 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/validators/Validator.php(261): yii\validators\InlineValidator->validateAttribute(Object(craft\elements\Entry), 'field:pageConte...')
#19 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\Validator->validateAttributes(Object(craft\elements\Entry), Array)
#20 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/services/Elements.php(2305): yii\base\Model->validate()
#21 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/services/Elements.php(755): craft\services\Elements->_saveElementInternal(Object(craft\elements\Entry), true, true, NULL)
#22 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/controllers/EntryRevisionsController.php(443): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#23 [internal function]: craft\controllers\EntryRevisionsController->actionPublishDraft()
#24 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#25 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#26 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('publish-draft', Array)
#27 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('publish-draft', Array)
#28 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('entry-revisions...', Array)
#29 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/web/Application.php(577): craft\web\Application->runAction('entry-revisions...', Array)
#30 /Users/trav/Websites/louderthanten/vendor/craftcms/cms/src/web/Application.php(253): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#31 /Users/trav/Websites/louderthanten/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#32 /Users/trav/Websites/louderthanten/public/index.php(21): yii\base\Application->run()
#33 /Users/trav/.composer/vendor/laravel/valet/server.php(206): require('/Users/trav/Web...')
#34 {main}
engram-design commented 3 years ago

Should be fixed in 2.6.5. Looks to be a Craft 3.5.17 issue.