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

product_wysiwyg_editor_enabled preference not defined #1

Closed
Kulgar opened this issue May 11, 2022 · 5 comments
Closed

product_wysiwyg_editor_enabled preference not defined #1

Kulgar opened this issue May 11, 2022 · 5 comments

Comments

@Kulgar
Copy link
Contributor

Kulgar commented May 11, 2022

Hello,

I know this gem was tested with Spree 4.3.1.
But just to let you know, with Spree 4.4, I get this error:

product_wysiwyg_editor_enabled preference not defined

I'll try to patch it :-)

@Kulgar
Copy link
Contributor Author

Kulgar commented May 11, 2022

Ok, I'm guessing, we should add the preference under your configuration.rb file.

Currently, I added it within my Spree initializer by following official documentation:
https://dev-docs.spreecommerce.org/internals/preferences#general-settings

Spree::AppConfiguration.class_eval do
  preference :product_wysiwyg_editor_enabled, :boolean, default: true
  preference :taxon_wysiwyg_editor_enabled, :boolean, default: true
end

And this fixes the pb

@mrbrdo
Copy link
Owner

mrbrdo commented May 12, 2022

Thanks @Kulgar, I will have a look and try to make it work if this setting is not available.
Is this the only issue you had with 4.4? I would be interested to support 4.4, although I am waiting for some stuff to be fixed there before I personally upgrade to it in my project.

@Kulgar
Copy link
Contributor Author

Kulgar commented May 12, 2022

@mrbrdo : well, yes... in fact your gem even fixed some issues I had with spree_globalize and latest spree version. For instance: when searching for products in the CMS (for button links), I didn't have the product names displayed with spree_globalize. I only had an empty blank dropdown even if the product actually exists.

This is no longer the case with your gem and I do get the product names properly.

And yes, I activated the wysiwyg editor for translations field and so far, I didn't get any other issues.

Thanks for your work ^^

Regarding the above issue, I think you would only have to add these two preferences within configuration.rb, wouldn't you?
And if you do, don't forget to add an explanation in the readme on how to customize these preferences within a spree app :-)

@mrbrdo
Copy link
Owner

mrbrdo commented May 12, 2022

No need, these settings are part of Spree config, but it was moved to Spree::Backend::Config in 4.4 (previously Spree::Config).
I pushed a fix and released v1.2 with it. Please let me know if it works - you should be able to remove the config initializer that you added and it should still work correctly.
Thanks for your help.

The issue you had with spree_globalize is probably because fallbacks don't work very well with it. Making fallbacks work was probably half of the work for this gem :)

@Kulgar
Copy link
Contributor Author

Kulgar commented May 12, 2022

Oh yeah, right, 4.4 is the version where they cut Spree into several pieces.
Ok, so I updated your gem and removed my initializer code, and it works, indeed.

Ow, and it seems that I'm facing the same issue as the one you posted on spree_globalize: spree-contrib/spree_globalize#99 (creating another issue for that)

@Kulgar Kulgar closed this as completed May 12, 2022
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

2 participants