unknown attribute 'images_attributes' for Refinery::Page if only added to extension
javinto opened this issue · 2 comments
I had a RefineryCMS 2.x installation with a Projects extension where I had added the PageImages extension to the projects only:
config.enable_for = [
{model: "Refinery::Projects::Project", tab: "Refinery::Projects::Tab"}
]
On upgrading to RefineryCMS 3.x I now get an exception error on updating a RefineryPage: unknown attribute 'images_attributes' for Refinery::Page
When I add {model: "Refinery::Page", tab: "Refinery::Pages::Tab"} to the above config the exception disappears but then I have a Images tab on every Page which I do not want.
The problem seems to be that in the pages_controller_decorator.rb the permitted_page_params are added unconditionally.
It is not a show stopper, but could it be solved?
Hi @javinto it looks like enable_for
does not do its job like it should. we probably should add conditional statement in the pages_controller_decorator.rb