Hi,

Here is the issue I'm facing: I have a document content type with multiple fields, which display is controlled by panels (and panelizer). In the teaser display, some fields are displayed with their field label set to "inline". In the default full display, all fields are displayed with their field label set to "Above".

When I have display cache activated, with the cache empty, if I load a page displaying all of my documents in teaser view mode, then, when looking at the document's default view mode, the fields shown in the teaser will have their field labels set to "Inline" instead of "Above". At the opposite, when the display cache is empty, if I look at a document in Default view mode first, and then look at it in Teaser view mode, the fields in the teaser view mode will be displayed with field labels set to "Above" instead of "Inline".

The reason for this is because, even though I have Display Cache set to cache the HTML, Display Cache also caches the fields, therefore in the first view request (whether the view mode is teaser or default), fields are cached, and then displayed from the cache in all of the other view modes, but in my case in the wrong way...

I will provide a patch to fix this, to avoid caching fields when the HTML is being cached.

Comments

guillaumev’s picture

Status: Active » Needs review
StatusFileSize
new703 bytes

Here is the patch. Fields will be cached only when "Cache fields" is selected.

kars-t’s picture

Hi

thank you for pointing this out. But I will need to ask Caseledde if this is on purpose or some bug. Makes no sense to me why there is only a check about "use" and not as you added what kind of "use"...

kars-t’s picture

@guillaumev Did the patch really solve your problem? To me it reads more like "Cache the fields additionally to the HTML". And if I look in the database it seems the same.

mfernea’s picture

Status: Needs review » Reviewed & tested by the community

I used the patch from #1 and it works. I also checked the db.

func0der’s picture

Yep. For us, too.

Please merge instantly. The current state fills the cache unnecessarily.

Except the fact, that the usage of === should be avoided here. Because often there is coming strings from the database where it should be integers.
I will attach a diff and an interdiff.

func0der’s picture

StatusFileSize
new654 bytes
new701 bytes
func0der’s picture

kars-t’s picture

Status: Reviewed & tested by the community » Fixed

This has been commited. Thank you :)

  • 11e1dd3 committed on 7.x-1.x
    Issue #2328355 by func0der, guillaumev: Do not cache fields when caching...
kars-t’s picture

I added a new release because of this.

func0der’s picture

Cool. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.