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

undefined method to_url for nil:NilClass when creating taxonomy #11899

Closed
mbajur opened this issue Jun 12, 2023 · 4 comments · Fixed by #11906
Closed

undefined method to_url for nil:NilClass when creating taxonomy #11899

mbajur opened this issue Jun 12, 2023 · 4 comments · Fixed by #11906
Assignees

Comments

@mbajur
Copy link
Contributor

mbajur commented Jun 12, 2023

My spree instance is throwing undefined method 'to_url' for nil:NilClass

Context

It's happening when I'm trying to create a taxonomy either using admin panel or directly via console. Name of the taxonomy is being provided as expected.

Actual Behavior

image

Steps to Reproduce

  1. Create a store
  2. Set it's default locale to PL
  3. Set supported locales to EN and DE
  4. Try to create a new taxonomy

Your Environment

@rafalcymerys rafalcymerys self-assigned this Jun 12, 2023
@stap780
Copy link

stap780 commented Jun 28, 2023

Hello
also have the same issue with two different install. One starter and one that do myself.
Anybody have a solution?

@rafalcymerys
Copy link
Member

I did some investigation on this one - it seems that when store.default_locale is different from I18n.default_locale, Mobility's fallbacks return a nil for the name (instead of the name that was set when creating the taxonomy).

I'll dig a bit deeper into it, as this seems to be an edge case for translation fallbacks in general. I think creating a Taxonomy is the only place where it really surfaces, but it would be great for the fallbacks to work consistently across the board.

@rafalcymerys
Copy link
Member

@mbajur I've just pushed a fix with Spree 4.6.1. Please take a look and let me know if that works fine for you now.

@mbajur
Copy link
Contributor Author

mbajur commented Jul 26, 2023

I can confirm it indeed fixed it. Thank you! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants