Skip to content

[Forwardport] Fix $useCache for container child blocks#4

Merged
rostyslav-hymon merged 1 commit into2.3-developfrom
2.3-develop-PR-port-14029
Mar 21, 2018
Merged

[Forwardport] Fix $useCache for container child blocks#4
rostyslav-hymon merged 1 commit into2.3-developfrom
2.3-develop-PR-port-14029

Conversation

@rostyslav-hymon
Copy link
Copy Markdown
Owner

Original Pull Request

magento#14029

Description

This is a follow-up from PR magento#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 magento/magento2#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)

@rostyslav-hymon rostyslav-hymon merged commit 7220d81 into 2.3-develop Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant