You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I create a new Term and try to save data for a term in a specific locale that does not exist in the defaultLocale (which is just selected by being the first linked site $this->taxonomy()->sites()->first()), vendor/statamic/cms/src/Taxonomies/Term.php:112 will throw Call to a member function all() on null, since there is no data for the defaultLocale.
In my opinion, terms should also have the option the be site-specific, as well as being able to be in draft or published state. If I create article categories for example, I might not want to show the same archive pages in every site I manage through the CMS. Currently, when adding an entry through the CMS directly, it will automatically be available in all sites.
How to reproduce
Create a taxonomy and within that taxonomy create a term. For that term, only add data in a locale that is not the first linked site to that term.
I am not certain if this should be a feature-request or a bug-report, but since it made my code crash and I had too dig a bit to understand the issue I feel like it is a bug for now. The modification to have publishing logic for taxonomies just like we have it for collections might be moved to a feature request. Let me know.
Thanks!
Markus
The text was updated successfully, but these errors were encountered:
markusreis-yd
changed the title
\Statamic\Taxonomies\Term::dataForLocale() throws Exception when no defaultLocale Date is provided
\Statamic\Taxonomies\Term::dataForLocale() throws Exception when no defaultLocale data is provided
Jan 23, 2024
In my opinion, terms should also have the option the be site-specific
I agree, and we will hopefully address this in statamic/ideas#839 but for now, this is just how it works. Terms must exist in the default site and they can be localized into the others.
Bug description
When I create a new Term and try to save data for a term in a specific locale that does not exist in the
defaultLocale
(which is just selected by being the first linked site$this->taxonomy()->sites()->first()
),vendor/statamic/cms/src/Taxonomies/Term.php:112
will throwCall to a member function all() on null
, since there is no data for thedefaultLocale
.In my opinion, terms should also have the option the be site-specific, as well as being able to be in draft or published state. If I create article categories for example, I might not want to show the same archive pages in every site I manage through the CMS. Currently, when adding an entry through the CMS directly, it will automatically be available in all sites.
How to reproduce
Create a taxonomy and within that taxonomy create a term. For that term, only add data in a locale that is not the first linked site to that term.
Logs
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
I am not certain if this should be a feature-request or a bug-report, but since it made my code crash and I had too dig a bit to understand the issue I feel like it is a bug for now. The modification to have publishing logic for taxonomies just like we have it for collections might be moved to a feature request. Let me know.
Thanks!
Markus
The text was updated successfully, but these errors were encountered: