Panelizer is triggered after the entity has gone through its normal view mode process. This can lead to an entity being rendered twice - once by core, and once by Panelizer. See if there's a way of executing earlier in the process and avoid the core entity display entirely.

Comments

stevector’s picture

After seeing this issue I went to admin/structure/types/manage/article/display on my current project and saw that most of my panelized View modes still were configured to render fields through core. For one view mode I dragged all fields to hidden and looked at a View with 12 nodes. I don't have thorough numbers; just one page load of data from xhprof before and after. The time spent in field_default_view() dropped from .65 seconds to .25. I'd prefer to have more robust data. But I think that indication is enough for me to "hide" through the Core UI every field on every panelized view mode. I'll probably do that with an update function followed by a features update.

stevector’s picture

Here's a quick and dirty patch that uses hook_requirements to detect if panelized view modes still have core configuration that displays fields. There are plenty of todos and the UI verbiage could be better. To see what it does

1. Make sure that at least one panelized view mode also has Core configuration to show fields. For instance, if article teasers are Panelized, go to admin/structure/types/manage/article/display/teaser and confirm that at least one field is not in the "hidden" grouping. One or more fields not "hidden" is that problem state that this patch detects.
2. Go to admin/reports/status and confirm that a warning message now shows from Panelizer.

And Damien, I apologize if I'm hijacking the intent of this issue. It certainly could be split out into a different issue. As I read node_view() there does not seem to be a clean way to block Core from doing what Core does. This hiding of fields seems like decent mitigation.

stevector’s picture

Status: Active » Needs review
stevector’s picture

Here's an updated version that also gives a warning on "Manage Display" tabs.

damienmckenna’s picture

StatusFileSize
new8.63 KB

Thanks. I've updated it a bit, and now it supports all entities; I tested it with a users and a content type.

damienmckenna’s picture

StatusFileSize
new8.61 KB

Minor wording change.

damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks stevector!

Status: Fixed » Closed (fixed)

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