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

UnknownPropertyException #3348

Closed
Christo55 opened this issue Oct 5, 2018 · 7 comments
Closed

UnknownPropertyException #3348

Christo55 opened this issue Oct 5, 2018 · 7 comments

Comments

@Christo55
Copy link

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

Additional info

  • Craft version: "craftcms/cms": "3.0.26.1",
  • Supertable "verbb/super-table": "2.0.10",
@brandonkelly
Copy link
Member

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

@mildlygeeky
Copy link
Contributor

mildlygeeky commented Oct 24, 2018

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)

@brandonkelly
Copy link
Member

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.

@mildlygeeky
Copy link
Contributor

mildlygeeky commented Oct 25, 2018 via email

@brandonkelly
Copy link
Member

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.

@christiansocc
Copy link

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

thanks that soluction works for me

@architchandra
Copy link

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

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

5 participants