I've been debugging the "Save as @bundle_name default" functionality, as we weren't sure which default it saved (entity root, or the actual view mode's default.) However while testing we found out it didn't actually save. The panelizer_defaults table had empty values all over the place.

The issue seems to be that this method invokes "ctools_export_crud_load" which only loads from the database and does not check for exported code (so perhaps this bug is only when Panelizer is featurized/exported.) By changing to "ctools_export_load_object" I was able to successfully change the view mode's default Panelizer configuration because it checked exported code.

Also, I had to change the naming discovery within the function. It duplicated the view mode twice, showing entity:bundle:view_mode:view_mode instead of entity:bundle:default:view_mode as items are actually exported.

Patch incoming.

Comments

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new1.14 KB

Patch attached. Will continue testing on our own product as well as within Panopoly and other distributions which utilize Panelizer but hide this feature (any Panopoly based distro.)

mglaman’s picture

mglaman’s picture

Version: 7.x-3.x-dev » 7.x-3.1

Putting to proper version :)

mcrittenden’s picture

Status: Needs review » Reviewed & tested by the community

Patch is quite simple and looks good, and fixes the bug on my end. Moving to RTBC.

mglaman’s picture

Title: \PanelizerEntityDefault get_default_panelizer_object() method always returns null. » \PanelizerEntityDefault get_default_panelizer_object() method returns null when config exported.

Updating title, as this is an issue when the Panelizer config is exported into code.

damienmckenna’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed. Thanks mglaman for the patch and mcrittenden for the review.

  • DamienMcKenna committed 8445df1 on 7.x-3.x authored by mglaman
    Issue #2328615 by mglaman: get_default_panelizer_object() gives wrong...

Status: Fixed » Closed (fixed)

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