Skip to content

Conversation

@rostyslav-hymon
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.
    for ($i = 0; $i < 5; $i++) {
    echo $this->getChildHtml('my.container', 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)

@magento-engcom-team
Copy link
Contributor

@rostyslav-hymon thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

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