mrbrdo / spree_mobility

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

product_wysiwyg_editor_enabled preference not defined #1

Closed Kulgar closed 2 years ago

Kulgar commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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: https://github.com/spree-contrib/spree_globalize/issues/99 (creating another issue for that)