Pennebaker / craftcms-thearchitect

CraftCMS plugin to generate content models from JSON data.
MIT License
171 stars 9 forks source link

PHP error when exporting rich text fields #27

Closed benjamminf closed 7 years ago

benjamminf commented 7 years ago

I'll preface this issue report with this: this is actually a result of a Craft bug.

So what's happing is a rich text field with no checked asset sources and/or transforms ends up throwing a PHP warning on export.

screen shot 2016-11-01 at 6 46 34 pm

Looking into this, it's due to the fact that Craft is now always storing these "availableAssetSources" and "availableTransforms" keys in the database JSON. This is probably not the right behaviour, but depending on how Craft handle the bug linked above, it may always be the case. I guess the trivial solution would be to add a check for either if the setting is not an empty string, or if the setting is an array.

spAnser commented 7 years ago

So running into a weird bug here where when I create a RichText field to try and replicate this problem. I uncheck asset sources & transforms. But when I save the field and go back in to edit it everything is checked again.

spAnser commented 7 years ago

Turns out it is saving the field with the values set to unchecked but they appear rechecked when viewing the field.

Went and looked at your bug report that is what you are seeing too.

spAnser commented 7 years ago

Should be fixed in v1.5.5