Closed fancyweb closed 4 years ago
Thanks for reporting this issue. What do you propose? Would you mind send a PR?
Thank you!
We should use the object id/primary key instead
Do we define a interface for this purpose? Primary key is surely present in majority of database based model managers, but we have no warranty on the rest. And I don't know if we are forcing the related subjects to implement getId()
method.
What about the AbstractAdmin::getIdParameter
can we use it instead?
AbstractAdmin::getIdParameter()
returns strings like "id", "childId", etc:
https://github.com/sonata-project/SonataAdminBundle/blob/bc279a80e701c200251d802c7910ff782c2770e5/src/Admin/AbstractAdmin.php#L1142-L1151
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Environment
Sonata packages
Symfony packages
PHP version
Subject
AbstractAdmin::isGranted()
usesspl_object_hash()
to create its cache keys but two different objects can have the same hash.Steps to reproduce
Expected results
On the second call, the cache is not hit.
Actual results
On the second call, the cache is hit.