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

Navigation / CMS Link Settings 4.3+ does not work #97

Open
jhovad opened this issue Mar 16, 2022 · 1 comment
Open

Navigation / CMS Link Settings 4.3+ does not work #97

jhovad opened this issue Mar 16, 2022 · 1 comment

Comments

@jhovad
Copy link

jhovad commented Mar 16, 2022

Spree 4.3 (and probably higher)
"Link settings" in Navigation and "Link to" in CMS Page Sections does not work properly:
Autocomplete select of Taxons/Products is not responding correctly.

The problem is probably the empty "attributes" attribute in JSON response (no titles of objects there). Unfortunately, I didn't succeed yet with any patch solution.

@jhovad
Copy link
Author

jhovad commented Apr 5, 2022

ok, here is my patch:

module FooApp::BaseDecorator
  
  def self.prepended(base)
    base.singleton_class.prepend ClassMethods
  end

  module ClassMethods
    def json_api_columns
      columns = column_names
      columns += translated_attribute_names.map{|a| a.to_s} if defined?(self.translated_attribute_names)
      columns.reject { |c| c.match(/_id$|id|preferences|(.*)password|(.*)token|(.*)api_key/) }
    end
  end

end

::Spree::Base.prepend(FooApp::BaseDecorator)

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

1 participant