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

Cms block cache key does not contain the store id #22299

Closed
tzyganu opened this issue Apr 12, 2019 · 11 comments
Closed

Cms block cache key does not contain the store id #22299

tzyganu opened this issue Apr 12, 2019 · 11 comments
Assignees
Labels
Component: Framework/View Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: PR Created Indicates that Pull Request has been created to fix issue Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@tzyganu
Copy link
Contributor

tzyganu commented Apr 12, 2019

Preconditions (*)

  1. Magento version 2.2.6
  2. create one block that contains a {{trans}} directive. Or 2 blocks with the same identifier but each one available on a different store view
  3. Block cache must be enabled.

Steps to reproduce (*)

  1. Add the block in the layout and specify a cache lifetime
            <block class="Magento\Cms\Block\Block" name="some-name-here">
                <arguments>
                    <argument name="block_id" xsi:type="string">block-identifier-here</argument>
                    <argument name="cache_lifetime" xsi:type="number">84600</argument>
                </arguments>
            </block>

Expected result (*)

  1. Loading the pages that contain this block on 2 different store views will show the proper content of the block for each website

Actual result (*)

  1. Opening the page that contains the block on the second store view shows the cached version of the block from the first store view.

Additional info:

This happens because the cache key of the cms block is determined by Magento\Framework\View\Element\AbstractBlock::getCacheKey which calls getCacheKeyInfo from the same class which returns an array with the name of the block in the layout.

Possible solution:

Adding the store id to the cache key or to the array returned by getCacheKeyInfo.

@m2-assistant
Copy link

m2-assistant bot commented Apr 12, 2019

Hi @tzyganu. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

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

@tzyganu do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Apr 12, 2019
@ghost ghost self-assigned this Apr 12, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 12, 2019

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Component: Framework/View labels Apr 12, 2019
@ghost
Copy link

ghost commented Apr 12, 2019

HI @tzyganu thank you for you report, Would you like to create Pull Request with this ?

@ghost ghost added the Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release label Apr 12, 2019
@tzyganu
Copy link
Contributor Author

tzyganu commented Apr 12, 2019

@engcom-backlog-nazar If you really want me to do it, sure. Unless you want to take over. if you do, I won't oppose.

@ghost ghost added Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Apr 12, 2019
@ghost ghost removed their assignment Apr 12, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-backlog-nazar
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-99156, MAGETWO-99157 were created

Issue Available: @engcom-backlog-nazar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Apr 12, 2019
@ghost ghost self-assigned this Apr 12, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 12, 2019

Hi @engcom-backlog-nazar. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@ghost ghost assigned tzyganu and unassigned ghost Apr 12, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 12, 2019

Hi @tzyganu. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@dipti2jcommerce
Copy link

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

@magento-engcom-team
Copy link
Contributor

Hi @dipti2jcommerce. Thank you for your request. I'm working on Magento 2.3-develop instance for you

tzyganu added a commit to tzyganu/magento2 that referenced this issue Apr 12, 2019
@ghost ghost added the Progress: PR Created Indicates that Pull Request has been created to fix issue label Apr 12, 2019
@ghost ghost assigned tzyganu and unassigned tzyganu Apr 13, 2019
@magento-engcom-team
Copy link
Contributor

Hi @tzyganu. Thank you for your report.
The issue has been fixed in #22302 by @tzyganu in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.2 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Apr 28, 2019
magento-engcom-team added a commit that referenced this issue Apr 28, 2019
…#22302

 - Merge Pull Request #22302 from tzyganu/magento2:M2-22299
 - Merged commits:
   1. 5c84c1a
magento-engcom-team added a commit that referenced this issue Apr 28, 2019
…#22302

 - Merge Pull Request #22302 from tzyganu/magento2:M2-22299
 - Merged commits:
   1. 5c84c1a
   2. 97bdecc
amol2jcommerce pushed a commit to amol2jcommerce/magento2 that referenced this issue Apr 29, 2019
@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Apr 30, 2019
@magento-engcom-team
Copy link
Contributor

Hi @tzyganu. Thank you for your report.
The issue has been fixed in #22534 by @amol2jcommerce in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.9 release.

magento-engcom-team added a commit that referenced this issue Apr 30, 2019
…the store id #22534

 - Merge Pull Request #22534 from amol2jcommerce/magento2:2.2-develop-PR-port-22302
 - Merged commits:
   1. d707c6b
   2. c17b232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Framework/View Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: PR Created Indicates that Pull Request has been created to fix issue Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

3 participants