-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Leverage AdminInterface::getIdParameter()
and AdminInterface::getUrlSafeIdentifier()
#7055
Leverage AdminInterface::getIdParameter()
and AdminInterface::getUrlSafeIdentifier()
#7055
Conversation
Removes the hardcode id parameter in favor of AdminInterface::getIdParameter() method. And recommend in docs the use of AdminInterface::generateObjectUrl() method.
Instead of AdminInterface::id() when generating URLs.
45f3b61
to
cc9fd30
Compare
{% elseif admin.hasAccess('show', object) and admin.hasRoute('show') %} | ||
<a href="{{ admin.generateUrl('show', {'id' : object|sonata_urlsafeid(admin) }) }}">{{ meta.title|u.truncate(40) }}</a> |
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.
If we cannot deprecate sonata_urlsafeid
(#6963 (comment)),
Can we at least deprecate the param admin of the sonata_urlsafeid
filter ?
(But the best would be to deprecate sonata_urlsafeid
to promote passing the admin in the view and using generateObjectUrl
... ; and if a bundle cannot do without it, it will implement his own extension)
{{ mosaic_content }} | ||
</a> | ||
{% elseif admin.hasAccess('show', object) and admin.hasRoute('show') %} | ||
<a class="mosaic-inner-link" | ||
href="{{ admin.generateUrl('show', {'id' : object|sonata_urlsafeid(admin) }) }}"> | ||
href="{{ admin.generateUrl('show', {(admin.idParameter) : object|sonata_urlsafeid(admin) }) }}"> |
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.
this can be changed to not use the filter right?
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.
yep #7061
Subject
As suggested by @phansys for
SonataPageBundle
, this PR removes the hardcodeid
parameter in favor ofAdminInterface::getIdParameter()
method.Also replaces the use of
AdminInterface::id()
when generating URLs byAdminInterface::getUrlSafeIdentifier()
.I am targeting this branch, because these changes are BC.
Changelog