-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Permalinks for taxons #2431
Permalinks for taxons #2431
Conversation
// Comprobar que el parent del relation tb es single? | ||
// if (!$meta->isSingleValuedAssociation($options['relationParentRelationField'])) { | ||
// throw new InvalidMappingException("Unable to find tree parent slug relation through field - [{$options['relationParentRelationField']}] in class - {$meta->name}"); | ||
// } |
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.
?
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.
Sorry..I didn't push the latest changes where I adressed this... :-)
I'm going to have a look at the failing tests. Will update ASAP. |
@pjedrzejewski The failing test is this one:
This test assumes we can have the same taxon name for two different taxons under the same taxonomy, that would mean two identic permalinks pointing to different taxons, and that is not correct, isn't it? |
@pjedrzejewski @gonzalovilaseca Valid scenario
Invalid scenario
*should not be allowed If we go this way, the failed scenario is invalid and should be replaced with similar examples as these above. In that case the permalink will do the validation job and we should only check for its uniqueness. |
That is how it's set up right now, that's why the test fails. I agree with you, let's see what pawel says. |
PR updated with tests passing. I added a test that needs to be implemented (I don't have the time right now). |
…malink Permalinks for taxons
Thank you Gonzalo! 👍 |
This fixes the permalink generation TODO in taxons.
I've basically added some customization to the TreeHander. I couldn't extend that class as it has private attributes, so I had to copy the whole class.
The handler is located in
src/Sylius/Bundle/TranslationBundle/GedmoHandler
, if there is a better place to put it just let me know.