Skip to content

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

Merged
magento-engcom-team merged 1 commit intomagento:2.1-developfrom
gelanivishal:2.1-develop-PR-port-14029
Jul 2, 2018
Merged

[Backport] Fix $useCache for container child blocks#16467
magento-engcom-team merged 1 commit intomagento:2.1-developfrom
gelanivishal:2.1-develop-PR-port-14029

Conversation

@gelanivishal
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@magento-engcom-team
Copy link
Copy Markdown
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