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

Getting different CMS blocks on different pages is not working #2499

Closed
revlis-x opened this issue Feb 25, 2019 · 5 comments
Closed

Getting different CMS blocks on different pages is not working #2499

revlis-x opened this issue Feb 25, 2019 · 5 comments
Assignees
Labels
1: Easy bug Bug reports vs-hackathon Tasks for the Hackathon
Milestone

Comments

@revlis-x
Copy link

revlis-x commented Feb 25, 2019

Current behavior

The logic for fetching CMS blocks in core/modules/cms/store/block/actions.ts goes straight to cache if at least ONE block is already in it even if the requested block is not in cache resulting in an error. Same thing with CMS Pages.

if (skipCache || (!state.items || state.items.length === 0))

Expected behavior

Only load block from cache, if the requested block is present in cache.

Steps to reproduce the issue

  1. Have 2 different CMS blocks included in 2 different pages.
  2. Go to first Page: CMS Block is loaded and stored in VUEX
  3. Go to second page (no hard reload): Second CMS Block is requested from Store although it is not in there.
@pkarw
Copy link
Collaborator

pkarw commented Feb 25, 2019

@anqaka could You please take a look at this issue?

@filrak filrak added the bug Bug reports label Mar 3, 2019
@anqaka
Copy link
Collaborator

anqaka commented Mar 11, 2019

I'll try to fix it this week, sorry for delay.

@anqaka
Copy link
Collaborator

anqaka commented Mar 21, 2019

@filrak @pkarw I look into the code and I cannot check the case where there is some CmsBlock displayed in Vuex state. Even if we add 2 cms blocks on one page, on the beginning on the single action, the state.items it's empty. Like cache doesn't work here. I don't know how to resolve this isue

@pkarw
Copy link
Collaborator

pkarw commented Mar 25, 2019

Yeah, I believe that if (skipCache || (!state.items || state.items.length === 0)) is kind of premature optimization and therefore should be simply removed

@patzick
Copy link
Collaborator

patzick commented Jun 26, 2019

Thanks @qiqqq !

@patzick patzick closed this as completed Jun 26, 2019
@patzick patzick added the QA - Ready for tests This is notification for testers, that improvement is ready to be tested and verified. label Jun 26, 2019
@alinadivante alinadivante removed the QA - Ready for tests This is notification for testers, that improvement is ready to be tested and verified. label Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1: Easy bug Bug reports vs-hackathon Tasks for the Hackathon
Projects
None yet
Development

No branches or pull requests

7 participants