Skip to content
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

[Forwardport] Fix false cache_lifetime usage in xml layouts #17350

Merged
merged 3 commits into from
Aug 11, 2018
Merged

[Forwardport] Fix false cache_lifetime usage in xml layouts #17350

merged 3 commits into from
Aug 11, 2018

Conversation

jignesh-baldha
Copy link
Member

@jignesh-baldha jignesh-baldha commented Aug 3, 2018

Original Pull Request

#16086

Fix cache_lifetime usage with false value

Description

Fix
<argument name="cache_lifetime" xsi:type="boolean">false</argument>
Usage eg in
Magento/Swatches/view/frontend/layout/checkout_cart_configure_type_configurable.xml

Manual testing scenarios

Reproduced in 2.2 and 2.1 version

  1. Add configurable product to cart
  2. Move to cart
  3. Edit Configurable product

Expected result
Configurable product options should be preselected

Actual result:
Configurable product options are not preselected

It happens because there is a check in
View/Element/AbstractBlock.php
protected function _loadCache() { if ($this->getCacheLifetime() === null || !$this->_cacheState->isEnabled(self::CACHE_GROUP)) { return false; }

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-engcom-team
Copy link
Contributor

Hi @jignesh-baldha. 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 {$VERSION} instance - deploy vanilla Magento instance

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

@orlangur orlangur self-assigned this Aug 3, 2018
@magento-engcom-team magento-engcom-team added this to the Release: 2.3.0 milestone Aug 3, 2018
@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-2647 has been created to process this Pull Request

@sidolov
Copy link
Contributor

sidolov commented Aug 6, 2018

Hi @jignesh-baldha , please, fix unit test according to changes.
Thank you!

@jignesh-baldha
Copy link
Member Author

@sidolov Fixed unit test according to changes.

@sidolov
Copy link
Contributor

sidolov commented Aug 7, 2018

@jignesh-baldha , I think that removing dataset for test it's not a good idea.
Please, revert back dataset and fix it according to changes.
I guess you need to fix only expectedResult key.

@jignesh-baldha
Copy link
Member Author

@sidolov Please check now, I've changes dataset.

'expectsCacheSave' => $this->never(),
'expectedResult' => 'dataFromCache',
'expectedResult' => '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally looks good. It would better use null for expected result because we started return null in lib/internal/Magento/Framework/View/Element/AbstractBlock.php line: 1077

Copy link
Member Author

Choose a reason for hiding this comment

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

@sidolov I tried with null for the expected result in the first two datasets but it does not work when running the unit test.

@magento-engcom-team magento-engcom-team merged commit 105b787 into magento:2.3-develop Aug 11, 2018
@magento-engcom-team
Copy link
Contributor

Hi @jignesh-baldha. Thank you for your contribution.
We will aim to release these changes as part of 2.3.0.
Please check the release notes for final confirmation.

@jignesh-baldha jignesh-baldha deleted the 2.3-develop-PR-port-16086 branch August 27, 2018 10:52
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.

4 participants