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

[Craft 3] Entry not saving when used inside a Matrix block #9

Closed
john-henry opened this issue Apr 8, 2018 · 6 comments
Closed

[Craft 3] Entry not saving when used inside a Matrix block #9

john-henry opened this issue Apr 8, 2018 · 6 comments

Comments

@john-henry
Copy link

john-henry commented Apr 8, 2018

I'm using TableMaker as a block inside Matrix and get the following error when trying to save an entry. Something to do with saving that columns array in the matrix field.

The site was an upgrade from Craft 2 so existing column arrays exist and render perfectly fone on site but it's just the act of saving an entry now throws this error

Craft CMS 3.0.1

Anything else I can provide you with let me know

yii\base\UnknownPropertyException: Setting unknown property: craft\behaviors\ContentBehavior::columns in /Users/johnhenry/Sites/mysite-local/vendor/yiisoft/yii2/base/BaseObject.php:163

Stack trace:
#0 /Users/johnhenry/Sites/mysite-local/storage/runtime/compiled_classes/ContentBehavior.php(814): yii\base\BaseObject->__set('columns', Array)
#1 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/base/Element.php(1590): craft\behaviors\ContentBehavior->__set('columns', Array)
#2 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/base/Element.php(1569): craft\base\Element->setFieldValue('columns', Array)
#3 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/fields/Matrix.php(870): craft\base\Element->setFieldValues(Array)
#4 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/fields/Matrix.php(362): craft\fields\Matrix->_createBlocksFromSerializedData(Array, Object(craft\elements\Entry))
#5 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/base/Element.php(1903): craft\fields\Matrix->normalizeValue(Array, Object(craft\elements\Entry))
#6 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/base/Element.php(761): craft\base\Element->normalizeFieldValue('pageComplex')
#7 /Users/johnhenry/Sites/mysite-local/vendor/yiisoft/yii2/base/ArrayableTrait.php(126): craft\base\Element->__get('pageComplex')
#8 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/web/View.php(466): yii\base\Model->toArray(Array, Array, false)
#9 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/helpers/ElementHelper.php(149): craft\web\View->renderObjectTemplate('{% if object.le...', Object(craft\elements\Entry))
#10 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/helpers/ElementHelper.php(92): craft\helpers\ElementHelper::_renderUriFormat('{% if object.le...', Object(craft\elements\Entry))
#11 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/validators/ElementUriValidator.php(49): craft\helpers\ElementHelper::setUniqueUri(Object(craft\elements\Entry))
#12 /Users/johnhenry/Sites/mysite-local/vendor/yiisoft/yii2/validators/Validator.php(267): craft\validators\ElementUriValidator->validateAttribute(Object(craft\elements\Entry), 'uri')
#13 /Users/johnhenry/Sites/mysite-local/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\Validator->validateAttributes(Object(craft\elements\Entry), Array)
#14 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/services/Elements.php(377): yii\base\Model->validate()
#15 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/controllers/EntriesController.php(539): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#16 [internal function]: craft\controllers\EntriesController->actionSaveEntry()
#17 /Users/johnhenry/Sites/mysite-local/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#18 /Users/johnhenry/Sites/mysite-local/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#19 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/web/Controller.php(74): yii\base\Controller->runAction('save-entry', Array)
#20 /Users/johnhenry/Sites/mysite-local/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-entry', Array)
#21 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/web/Application.php(238): yii\base\Module->runAction('entries/save-en...', Array)
#22 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/web/Application.php(446): craft\web\Application->runAction('entries/save-en...', Array)
#23 /Users/johnhenry/Sites/mysite-local/vendor/craftcms/cms/src/web/Application.php(222): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#24 /Users/johnhenry/Sites/mysite-local/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#25 /Users/johnhenry/Sites/mysite-local/web/index.php(21): yii\base\Application->run()
#26 {main}

@Nav33d
Copy link
Contributor

Nav33d commented Apr 9, 2018

Hi John,

Yes, I can replicate this issue. I'm looking into it and will update you once I have fixed this.

Many thanks

@john-henry
Copy link
Author

Just so ya know, its happening on Craft 3.0.2. Realise nothing to do with error but from the point of being thorough.

@john-henry
Copy link
Author

Ok so here is a clue. If I manually add

public $columns;
public $rows;

to storage/runtime/compiled_classes/ContentBehaviour.php it works

Related issue

@Nav33d
Copy link
Contributor

Nav33d commented Apr 12, 2018

Hi @john-henry

I have just released version 2.0.0 which fixes the Matrix issue.

Could you please update the TableMaker plugin. Just to be on safe side take backup of the existing data in case something goes wrong.

Many thanks

@Nav33d Nav33d closed this as completed Apr 12, 2018
@ijy
Copy link

ijy commented Apr 12, 2018

Fantastic timing. I literally just came to check if there was a Craft 3 version out yet. :D Thanks

@john-henry
Copy link
Author

Update works great too so far. Thanks for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants