You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project that uses this extension and spree_static_content. After getting this extension running all of my static content pages threw an error as follows:
With a little digging I can see this error started showing up because of the override to put facets in the sidebar. spree_static_content's main controller inherits from Spree::StoreController and probably is not creating the corresponding @searcher variable that _facets.html.erb is expecting.
A conditional inside the facets partial solved this problem for me. That strikes me as more of a bandaid than an actual fix. Because other extensions may update/pollute/change the sidebar in spree it seems like the @searcher variable needs to be instantiated in a more persistant way? Unfortunately I do not know enough about this extension yet to say if that is worth doing or even the right solution.
I did publish my quick fix for this and can issue a pull request if you like: Wootenblatz@e49fccd
The text was updated successfully, but these errors were encountered:
I am working on a project that uses this extension and spree_static_content. After getting this extension running all of my static content pages threw an error as follows:
ActionView::Template::Error (undefined method
available_facets' for nil:NilClass): 1: <nav id="taxonomies" class="sidebar-item" data-hook><% 2: facets = @searcher.available_facets || [] 3: taxon_names = @taxon ? @taxon.self_and_descendants.map(&:name) : [] 4: for facet in facets 5: options = facet.options spree_core (1.3.2) app/views/spree/shared/_taxonomies.html.erb:2:in
_ea1d5b61095c876e70e1dc33471f3255'With a little digging I can see this error started showing up because of the override to put facets in the sidebar. spree_static_content's main controller inherits from Spree::StoreController and probably is not creating the corresponding @searcher variable that _facets.html.erb is expecting.
A conditional inside the facets partial solved this problem for me. That strikes me as more of a bandaid than an actual fix. Because other extensions may update/pollute/change the sidebar in spree it seems like the @searcher variable needs to be instantiated in a more persistant way? Unfortunately I do not know enough about this extension yet to say if that is worth doing or even the right solution.
I did publish my quick fix for this and can issue a pull request if you like:
Wootenblatz@e49fccd
The text was updated successfully, but these errors were encountered: