-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Taxonomy singular slug fix #2044
Taxonomy singular slug fix #2044
Conversation
Pull from upstream
…content types store a "content type definition". This allows the use of the singular_slug directive when generating a URL.
Hi @andysh-uk , good catch, I know this has been bugging a colleague of mine, @nestordedios , for some time now 😅 For tests If you bump into issues with it, reach me or @bobdenotter on Slack. |
About the big change, the other issue is that right now the addition to |
Thanks @I-Valchev, I did wonder about the services.yaml change following the previous issue with the Doctrine change in 4.1 😄 Let me see how this works when that listener is not configured - I feel it would be acceptable to go into a smaller release if the code works the way it does prior to this change if services.yaml is not updated. That way, you could highlight it in the release notes that to opt-in to this new behaviour for existing projects, you have to make the change manually. I'm assuming newly-created projects would get the updated services.yaml, and so would start with the desired behaviour from the get-go? |
@bobdenotter @I-Valchev I'm struggling to understand the PHPstan failure on this PR. I can't see that it's anything to do with what I've changed but of course I could be wrong. Are you able to offer any pointers please? On my local branch on my Mac, phpstan runs fine without errors:
|
Hi @andysh-uk , The failure is probably unrelated to your changes, see #2043 Sometimes it happens that a minor update in ECS or PHPStan suddenly detects a (valid) issue that it didn't spot previously. :-) I'm going to rebase this PR, and then it'll probably pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging in to 4.1
as well as master
! Thanks, @andysh-uk
(Oh, about that breakage, there's also this one: #2048) |
Thanks for sorting Phpstan @bobdenotter. I've just created another small PR #2051 , which prevents an exception being thrown if |
Fixes #2036.
Taxonomies now use the singular_slug when configured to do so, otherwise they fall back to the slug.
I've replicated the relationship between
Content
->ContentFillListener
-> content type config ->ContentType
with taxonomies, so we have:Taxonomy
->TaxonomyFillListener
-> taxonomies config ->TaxonomyType
.The Twig
getLink
filter now uses the TaxonomyTypesingular_slug
/slug
value (Bolt seems to automatically substituteslug
ifsingular_slug
is not configured, so the method call looks like it only uses singular_slug - but this is the same as Content.)There are a couple of issues I have:
|link
on a taxonomy. This should perhaps be either strongly called out in the release notes, or go into a bigger update - e.g. 4.2.