Skip to content

(fix+feat): If a language doesn't have a value for taxonomy set the default language value#172

Open
dobri1408 wants to merge 32 commits into
masterfrom
improve-language-handaling
Open

(fix+feat): If a language doesn't have a value for taxonomy set the default language value#172
dobri1408 wants to merge 32 commits into
masterfrom
improve-language-handaling

Conversation

@dobri1408

@dobri1408 dobri1408 commented Feb 20, 2025

Copy link
Copy Markdown

We've identified a bug in the language translation of taxonomies. When a value is missing for a specific language, the system incorrectly assigns PATH_SEPARATOR + "" = id. This causes the taxonomy to default to a single value, matching the last term of the default language. Instead, if no value is provided for a given language, the correct behavior should be to use the default language value.

@dobri1408 dobri1408 changed the title (fix+feat): If a language doesn't have a value for taxonomy set the default language valit (fix+feat): If a language doesn't have a value for taxonomy set the default language value Feb 20, 2025
Comment thread src/collective/taxonomy/jsonimpl.py Outdated
@dobri1408 dobri1408 requested a review from ale-rt February 23, 2025 15:59
@dobri1408 dobri1408 requested a review from petschki May 28, 2025 06:07
@avoinea

avoinea commented Mar 4, 2026

Copy link
Copy Markdown
Member

@ale-rt Now I can see the tests started to fail when I merged master in this branch, thus the issue seems to be also in master branch 🤔

@ale-rt

ale-rt commented Mar 5, 2026

Copy link
Copy Markdown
Member

@ale-rt Now I can see the tests started to fail when I merged master in this branch, thus the issue seems to be also in master branch 🤔

I see this:

Traceback (most recent call last):
  File "/home/runner/work/collective.taxonomy/collective.taxonomy/src/collective/taxonomy/tests/test_controlpanel_restapi.py", line 7, in <module>
    from plone.restapi.testing import RelativeSession
  File "/home/runner/work/collective.taxonomy/collective.taxonomy/.tox/py313-plone62/lib/python3.13/site-packages/plone/restapi/testing.py", line 33, in <module>
    import collective.MockMailHost
ModuleNotFoundError: No module named 'collective.MockMailHost'

Which can be solved by adding plone.restapi[test] in the setup extra_require.

@avoinea

avoinea commented Mar 5, 2026

Copy link
Copy Markdown
Member

@ale-rt plone.restapi[test] was there. Somehow removing the namespace_packages, which seems deprecated did the trick. Also the init.py from src/collective 🤔

Seems green now.

@ale-rt

ale-rt commented Mar 5, 2026

Copy link
Copy Markdown
Member

@ale-rt plone.restapi[test] was there. Somehow removing the namespace_packages, which seems deprecated did the trick. Also the init.py from src/collective 🤔

Seems green now.

Uh!
Basically you ran into #188 and you need this first #189

CC @gforcada

@gforcada

gforcada commented Mar 9, 2026

Copy link
Copy Markdown
Member

Yes, there is a porting guide to move python distributions to native namespace: https://6.docs.plone.org/developer-guide/native-namespace.html

Although the use case there is mostly for core packages, which have been ported already, there is enough remarks on which steps to skip to be useful for internal or collective python distributions.

Please give it a go and report back 😄

If the repository already uses plone.meta everything should be smoother as well 🧼

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

Successfully merging this pull request may close these issues.

4 participants