Closed (fixed)
Project:
Page Manager
Version:
8.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
23 Nov 2015 at 19:34 UTC
Updated:
9 Dec 2015 at 17:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mmenavas commentedComment #3
vasi1186 commentedHi,
I had the same issue. The problem is that the
PageBlockDisplayVariantclass uses a uuid for the cache tags, but this uuid is always empty, so this results in having the same cache key for multiple variants.I attached a patch that solves the issue, but I am not sure if this is the correct way to solve it, it needs some review from people which are more involved into this module, for example, this way we generate a uuid in the variant_settings property of the variant object which is actually different than the uuid of the variants itself. I think it would make sense to somehow use the same uuid. To be more clear, using this patch will generate a configuration like this one below, for a Variant:
You can see that the uuid in the variant_settings is different than the one of the variant entity.
Applying the patch and re-saving the variants should make the pages work.
Comment #4
vasi1186 commentedComment #5
berdirYeah, I noticed that there are a lot of weird/empty property in the variant settings in the new config entity.
I don't think we need a UUID, this probably dates back to when the only thing to identify a variant with was the UUID. We should be able to switch to the variant ID now, assuming we can access that.
Comment #6
berdirLooked into it, and this is a more complicated than we thought.
All that default configuration comes from both the core block plugin which defines default config for weight and uuid and uses that for a id() method. But doesn't set it anyore. And the selection stuff comes from ctools.
So, we kind of agreed in IRC that..
* The condition stuff in ctools on the BlockVariantBase class should go away. I think that means we drop ConditionVariantInterface completely and say that whoever stores variants is supposed to figure that out himself? Just like we did that for blocks in core, basically.
* We should have a nicer way to provide a value for the id() method. My suggestion would be a setUniqueId() method on an extended VariantInterface in ctools and an id() method that uses that and throws an exception if not set. It's still possible to override and use a UUID.
(* I also think the core class has too much half-implemented logic but it's too late to do something about that)
However, the approach in #3 is a good step to move forward here and just fix the bug. Which I think is critical because the module is *completely* broken if you don't use the developer settings.local.php which disables render caching.
I'm just changing the logic to use id() instead of hardcoding the uuid, didn't know that exists when I added this a long time ago. Then we can implement the things above and eventually get rid of those weird things.
Comment #7
berdirWorking on a test...
Comment #8
berdirOk, this isn't super nice, but it works. I'm adding a second page with a different display and in HEAD, that is failing by returning the other render cached page given I visit that one first.
Comment #10
dsnopekThis looks good to me! :-) Thanks, berdir!
Comment #12
taherpro commentedThis works like a charm! Thanks Berdir!
Comment #13
tim.plunkettThis part looks great.
But if we're fixing UUID, why ditch it here?
Comment #14
tim.plunkettDuh, id() returns $this->configuration['uuid']
Comment #15
dsnopekIt handles the former
@todo:Comment #16
tim.plunkettComment #18
mmenavas commentedThank you all for the great work! I just tested the latest dev version (Nov 25th 2015), and I can confirm this issue is fixed.