Download & Extend

Overridden Page Templates shows not only the overridden templates

Project:Panopoly
Version:7.x-1.x-dev
Component:Admin
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

The admin/panopoly/libraries/pages Overridden Page Templates contains all of the panelized contents, not only the overridden. We have default panes set up on content types, so creating new entity always generates new record in panelizer_entity table.

As I figured, the difference between the overridden and default the did value on panelizer_entity table:

Selection_052.jpeg

If I am right, we need a ->condition('pe.did', 0, '>') in panopoly_admin_overridden_page_templates_content_type_render()

<?php
function panopoly_admin_overridden_page_templates_content_type_render($subtype, $conf, $panel_args, $context) {
 
// --- some stuff ----
 
$pages = $query
   
->fields('pe', array('entity_type', 'view_mode', 'entity_id'))
    ->
orderBy('pe.entity_id', 'DESC')
    ->
condition('pe.entity_type', $entity_types)
    ->
condition('pe.view_mode', 'page_manager')
    ->
condition('pe.did', 0, '>') // <--this
   
->execute()
    ->
fetchAllAssoc('entity_id');
  foreach(
$pages as $overridden_page) {
?>
AttachmentSize
Selection_052.jpeg83.11 KB

Comments

#1

Status:active» needs review

I can confirm this is the case. If you have multiple allowed default panel layouts the node will show as overridden regardless of the actual state. The did check does look to fix it.

Here's the patch.

AttachmentSize
1842374-only-overrides.patch 615 bytes

#2

Status:needs review» fixed

Awesome

#3

Status:fixed» needs work

It seems, a ->distinct() is also missing,

I get this list: http://www.diigo.com/item/image/2peqe/367s?size=o

Sorry, if I don't file patch, the environment, within I'm working, it is hard to make patches.

#4

Status:needs work» fixed

Makes sense. Added it up!

#5

Status:fixed» closed (fixed)

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

nobody click here