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

"Getting unknown property" error in control panel since upgrade to 1.4.1 #59

Closed
mtnorthrop opened this issue Dec 11, 2020 · 4 comments · Fixed by #60
Closed

"Getting unknown property" error in control panel since upgrade to 1.4.1 #59

mtnorthrop opened this issue Dec 11, 2020 · 4 comments · Fixed by #60

Comments

@mtnorthrop
Copy link

When trying to view a Color Swatches field in the control panel, this error appears:
Getting unknown property: percipioglobal\colourswatches\models\Settings::colours

It appears that this error is being thrown from line 161 of /src/fields/ColourSwatches.php, and is due to the fact that the $colours property was removed from /src/models/Settings.php in version 1.4.1 of the plugin.

@mtnorthrop mtnorthrop changed the title Error in control panel since upgrade to 1.4.1 "Getting unknown property" error in control panel since upgrade to 1.4.1 Dec 11, 2020
@jt-systems
Copy link
Contributor

Thanks @mtnorthrop - expect an update momentarily.

@mtnorthrop
Copy link
Author

Thanks for that! If I could make a suggestion, though, it looks like that line might not have been a typo, but a fallback from $plugin->settings->colors to $plugin->settings->colours, if the first property was null. This is a bit clearer if we format the original code differently:

'configOptions' => Plugin::$plugin->settings->colors 
    ? Plugin::$plugin->settings->colors 
    : Plugin::$plugin->settings->colours,

If the colours property no longer exists, we could probably drop the ternary altogether and just do:

'configOptions' => Plugin::$plugin->settings->colors,

@michtio
Copy link
Contributor

michtio commented Dec 14, 2020

Thanks for the remarks @mtnorthrop we do have a major 2.0 release planned for this in 2021 with a lot more improvements and probably an entire codebase rewrite 🗡️

@jt-systems
Copy link
Contributor

Thanks for that! If I could make a suggestion, though...
If the colours property no longer exists, we could probably drop the ternary altogether and just do:

'configOptions' => Plugin::$plugin->settings->colors,

yeah there are several of these carryovers throughout that need to be addressed and cleaned - which will happen over the coming days. As @michtio says though, there's a full rebuild in the works with a bunch of new features including GraphQL and feedme support.

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

Successfully merging a pull request may close this issue.

3 participants