Skip to content

Conversation

@Den4ik
Copy link
Contributor

@Den4ik Den4ik commented Feb 13, 2019

Description (*)

Module observers executed after CatalogBlockProductCollectionBeforeToHtmlObserver don't have affect on collection. This PR is changing Review observer logic. If fact we can join only 2 reviews_count and rating_summary fields instead of send additional sql query for retrieving this data.

Fixed Issues (if relevant)

Changed append summary to product collection to mysql join

  1. DO NOT do load() of product collection in Review observer as it causes issues for other observers community-features#57: DO NOT do load() of product collection in Review observer as it causes issues for other observers

Manual testing scenarios (*)

  1. Create new module
  2. Add event observer for catalog_block_product_list_collection
  3. Do some changes to collection in observer

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Feb 13, 2019

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Den4ik for a new attempt to fix this, please help me with understanding its logic and let's make it actually happen (at last!).

@orlangur orlangur self-assigned this Feb 13, 2019
@Den4ik
Copy link
Contributor Author

Den4ik commented Feb 14, 2019

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik, here is your new Magento instance.
Admin access: https://pr-21200.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@Den4ik Den4ik closed this Feb 16, 2019
@ghost
Copy link

ghost commented Feb 16, 2019

Hi @Den4ik, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@Den4ik Den4ik reopened this Feb 16, 2019
@Den4ik
Copy link
Contributor Author

Den4ik commented Feb 17, 2019

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik, here is your new Magento instance.
Admin access: https://pr-21200.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@Den4ik
Copy link
Contributor Author

Den4ik commented Feb 18, 2019

@sivaschenko @orlangur Any progress on this request?
Do you have any question?

@sivaschenko
Copy link
Member

Hi @Den4ik thanks for the pull request.

Can you mark Block methods as deprecated instead of removing them to preserve backward compatibility?

Also, our policies do not allow the introduction of new public/protected method for classes marked as API for patch releases (currently 2.3.X). Can you refactor the implementation to avoid adding such methods, or otherwise we'll have to delay delivery of this PR until version 2.4.

@Den4ik
Copy link
Contributor Author

Den4ik commented Feb 18, 2019

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik, here is your new Magento instance.
Admin access: https://pr-21200.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@Den4ik Den4ik force-pushed the feature-review-summary-for-produc-list branch from ca7b1d9 to 20df8ca Compare February 19, 2019 15:50
@Den4ik
Copy link
Contributor Author

Den4ik commented Feb 19, 2019

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik, here is your new Magento instance.
Admin access: https://pr-21200.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@Den4ik
Copy link
Contributor Author

Den4ik commented Feb 19, 2019

@sivaschenko Thanks for your answers. I have refactored my previous solution implementation

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Den4ik thanks for the update! Please take a look at my code review notes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add new constructor parameters in a backward compatible way: as a last optional parameter.
See more details in Backward compatible development guide "Adding Constructor parameters" section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that suppress warning necessary here? I don't see too many dependencies in this class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You were right. Comment was removed

@Den4ik
Copy link
Contributor Author

Den4ik commented Feb 20, 2019

Hi @sivaschenko Thanks you for fast review. I have update the code according to your recommendations

@orlangur
Copy link
Contributor

@p-bystritsky how d52a446 landed here?

@p-bystritsky p-bystritsky force-pushed the feature-review-summary-for-produc-list branch from df572e2 to 452a55c Compare May 27, 2019 14:39
@p-bystritsky p-bystritsky force-pushed the feature-review-summary-for-produc-list branch from 452a55c to 66084b2 Compare May 28, 2019 08:37
@p-bystritsky p-bystritsky force-pushed the feature-review-summary-for-produc-list branch from 66084b2 to f4fce7b Compare May 28, 2019 13:33
@magento-engcom-team magento-engcom-team merged commit f4fce7b into magento:2.3-develop May 31, 2019
@m2-assistant
Copy link

m2-assistant bot commented May 31, 2019

Hi @Den4ik, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.3 milestone May 31, 2019
@Den4ik Den4ik deleted the feature-review-summary-for-produc-list branch May 31, 2019 21:33
@orlangur
Copy link
Contributor

orlangur commented Jun 1, 2019

@dvynograd here is something to learn for you 😉

Den4ik pushed a commit to Den4ik/magento2 that referenced this pull request Jun 1, 2019
Den4ik pushed a commit to Den4ik/magento2 that referenced this pull request Jun 1, 2019
if ($this->_totalRecords === null) {
$sql = $this->getSelectCountSql();
$this->_totalRecords = $this->getConnection()->fetchOne($sql, $this->_bindParams);
$this->_totalRecords = $this->_totalRecords ?? $this->getConnection()->fetchOne($sql, $this->_bindParams);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that when if reach this point, $this->_totalRecords must be strictly null at the time null coalescence check. Or am i missing something?

@orlangur @Den4ik

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@korostii Null coalescence check won't broke anything in this case, but looks strange :)
@p-bystritsky Do you remember what static tests you were fixed by this code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants