Skip to content

[Backport] Fix $useCache for container child blocks #16467

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

Conversation

gelanivishal
Copy link
Contributor

Original Pull Request

#14029

Description

This is a follow-up from PR #4919.

When one would use getChildHtml() like the following to output a container uncached:
<?= $block->getChildHtml('category.products.list.product_meta', false); ?>
The container's child blocks would still be cached.

Fixed Issues (if relevant)

  1. getChildHtml, $useCache and child containers #4919: getChildHtml, $useCache and child containers

Manual testing scenarios

  1. Add a container to block category.products.list.
  2. Add a custom template to the container and output something that should be different every time it gets rendered, like <?= rand() ?>.
  3. Output the container in Magento/Catalog/templates/products/list.phtml using getChildHtml() and set $useCache to false.
  4. The output is the same with each getChildHtml() of the container.

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)

@orlangur orlangur self-assigned this Jun 30, 2018
@orlangur orlangur changed the title Fix $useCache for container child blocks [Backport] Fix $useCache for container child blocks Jun 30, 2018
@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

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

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.

3 participants