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
NEXT-00000 - Move ProductReviewLoader logic to core #3671
base: trunk
Are you sure you want to change the base?
Conversation
|
02d02a6
to
42ed756
Compare
Hey @akf-bw thanks for your contribution! There was already a similiar PR here: #2389 However deprecation and break strategy can be a hassle when we want to move code from the storefront to the core, please follow up on the discussion in the previous PR and adjust the breaking changes here accordingly. |
08ad3f2
to
c5cfed6
Compare
c5cfed6
to
27d2d39
Compare
src/Storefront/Page/Product/Review/ProductReviewsLoadedEvent.php
Outdated
Show resolved
Hide resolved
f9442c8
to
dd31dcf
Compare
What I am not sure, if one wants to have public methods like: |
09618cf
to
3a88731
Compare
I now included all features of the long time missing |
fac45b7
to
25cb403
Compare
@akf-bw thank you, I did not find time to respond, but I think in particular when you can decorate such services, this makes working in (store)-plugins quite difficult, as there can be so many moving parts. |
25cb403
to
244b0bd
Compare
244b0bd
to
4545703
Compare
1. Why is this change necessary?
ProductReviewLoader
is in the Storefront package, but we also need the functionality in the core (for example for theProductDescriptionReviewsCmsElementResolver
).ProductReviewLoader
to the Core and remove the duplicate code with this stepcore.listing.reviewsPerPage
config option, which allows the administration user to change the size of the review sectionLogic-Fixes:
ProductDescriptionReviewsCmsElementResolver
logic and the StorefrontProductReviewLoader
ProductReviewsLoadedEvent
is currently only in the Storefront package, because of this on the initial review load by the cms there is noProductReviewsLoadedEvent
firedcreateReviewCriteria
is slightly different. In the CoreProductDescriptionReviewsCmsElementResolver
theTOTAL_COUNT_MODE_EXACT
is missing, because of this missing Criteria setting the initial review total count is wrongProductReviewLoader
Initial page load review total count problem
Before:After:
ProductReviewsLoadedEvent
&ReviewLoaderResult
in the Core already had deprecated code, but with this PR we can fully depreciate this classes2. What does this change do, exactly?
ProductDescriptionReviewsCmsElementResolver
to use theAbstractProductReviewLoader
and removed the duplicate functionsProductDescriptionReviewsCmsElementResolver
to now execute the CoreProductReviewsWidgetLoadedHook
hookAbstractProductReviewLoader
to allow overwriting product review load logicProductReviewLoader
based on the StorefrontProductReviewLoader
ProductReviewResult
to include thetotalNativeReviews
fieldProductReviewsWidgetLoadedHook
based on the StorefrontProductReviewsWidgetLoadedHook
ProductReviewsLoadedEvent
based on the StorefrontProductReviewsLoadedEvent
Migration1711461585AddDefaultSettingConfigValueForReviewListingPerPage
to include the new config optioncore.listing.reviewsPerPage
to configlisting
with default value10
ProductDescriptionReviewsTypeDataResolverTest
to match Core changesProductReviewLoaderTest
to match core changesCmsController
to useAbstractProductReviewLoader
ProductController
to useAbstractProductReviewLoader
ProductReviewLoader
to@deprecated
and copy logic from CoreProductReviewLoader
ProductReviewsLoadedEvent
to@deprecated
ProductReviewsWidgetLoadedHook
to@deprecated
ReviewLoaderResult
to@deprecated
review.html.twig
template to include the newcore.listing.reviewsPerPage
to configreview.html.twig
template to include missingnativeReviewsCount
andforeignReviewsCount
variablesreview.html.twig
by including additionalcomponent_review_list_action_filters
andcomponent_review_list_counter
blocksCmsControllerTest
to match Storefront changesProductControllerTest
to match Storefront changesProductReviewLoaderTest
to match Storefront changes3. Describe each step to reproduce the issue or behaviour.
4. Please link to the relevant issues (if any).
5. Checklist