- Issue created by @rhovland
- Merge request !11Issue #3516551 by rhovland: Edit and delete my reviews functionality β (Open) created by rhovland
- πΊπΈUnited States rhovland Oregon
Feature all done. Ready for review
- πΊπΈUnited States rhovland Oregon
Some notes about how the user facing entity list is handled:
The default entity list builder is designed for administrative use. It does not filter the list based on the current user.
The columns presented in the list are relevant for admin users but mostly useless for customers.
As a result it makes more sense to create a separate list builder for customers since the feature set is completely different.The user list is a route that points to the ProductReviewController to render a page.
The overviewPage() function that gets called to render a page uses the createHandlerInstance() feature of EntityTypeManagerInterface to set a custom handler, in this case a list builder. It then returns a rendered list built by the Entity system.The one dangling question comes from the comment on createHandlerInstance()
* Usually \Drupal\Core\Entity\EntityTypeManagerInterface::getHandler() is
* preferred since that method has additional checking that the class exists
* and has static caches.In this case the class always exists because it's part of the module so I'd think a check for that would be unnecessary.
That leaves the question of is this page being output cached? Or do we need to manually cache it? - πΊπΈUnited States rhovland Oregon
Here's a preview of how the customer's My Reviews page looks (in a bootstrap theme):
The action links for a user that has already left a review on a product's review page: