Cms: UnknownPropertyException

Created on 5 Oct 2018  Â·  7Comments  Â·  Source: craftcms/cms

Description

When I click on a page to edit, I get:

Unknown Property – yii\base\UnknownPropertyException
Getting unknown property: craft\behaviors\ContentBehavior::categoriesMatrix
        throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);

Steps to reproduce

  1. Not sure, I tried to update craft and got an error with composer.json permissions, fixed the permissions and ran update again. It's still broken
    2.

Additional info

  • Craft version: "craftcms/cms": "3.0.26.1",
  • Supertable "verbb/super-table": "2.0.10",

Most helpful comment

Can you try deleting your storage/compiled_classes/ folder and see if that fixes it?

All 7 comments

Can you try deleting your storage/compiled_classes/ folder and see if that fixes it?

We have had the same issue happen — any chance that because we have Opcache running in production mode (i.e., holding ContentBehavior in memory), then it might not be seeing updates to the Behavior classes? Maybe those compiled classes need to have opcache_invalidate run on them (if it's not already) to pick up those changes?

In our case we added a field to a section, hit save, and it then failed out trying to re-save the entries in that section (across multiple sites) - here was the readout:

2018-10-24 10:49:29 [-][-][n7suq4db6nb2q85admb0chad54][error][yii\base\UnknownPropertyException] yii\base\UnknownPropertyException: Setting unknown property: craft\behaviors\ContentBehavior::productHeaderTextColor in /home/forge/redacted.com/releases/0783c166143dd5c08ba678e906a05368c7c66576/vendor/yiisoft/yii2/base/BaseObject.php:163
Stack trace:
#0 /home/forge/redacted.com/shared/storage/runtime/compiled_classes/ContentBehavior.php(1546): yii\base\BaseObject->__set('productHeaderTe...', NULL)

We already do call opcache_invalidate() when regenerating ContentBehavior.php and ElementQueryBehavior.php.

Just yesterday someone pointed out a race condition that could result in those classes missing some field handle properties (#3400). That could be the culprit here too, in which case it’s fixed for the next release.

That would make sense - thanks!
On Oct 25, 2018, 7:36 AM -0400, Brandon Kelly notifications@github.com, wrote:

We already do call opcache_invalidate() when regenerating ContentBehavior.php and ElementQueryBehavior.php.
Just yesterday someone pointed out a race condition that could result in those classes missing some field handle properties (#3400). That could be the culprit here too, in which case it’s fixed for the next release.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Going to close this for the time being, but let me know if it crops up again after updating to 3.0.29 when that comes out next week.

Can you try deleting your storage/compiled_classes/ folder and see if that fixes it?

thanks that soluction works for me

Worked for me too, for a similar issue.
I was getting the error Setting unknown property: craft\models\Update::packageName

Was this page helpful?
0 / 5 - 0 ratings