Guessing it was supposed to be:
if ((empty($form[$child]['#type']) || !em...
Instead of:
if ((!empty($form[$child]['#type']) || !em...

The way the conditional was it would always eval true if the #type was set before even looking whether it was a fieldset or button.

Comments

populist’s picture

Project: Panopoly Magic » Panopoly

Moving to main queue for review

populist’s picture

Status: Patch (to be ported) » Fixed

Thanks so much for reporting/fixing! This has been reviewed and pushed to -dev.

tim.plunkett’s picture

Priority: Minor » Major
Status: Fixed » Reviewed & tested by the community

This now throws notices and causes the form_id et al to never be copied over, so the code later on (http://drupalcode.org/project/panopoly_magic.git/blob/refs/heads/7.x-1.x...) completely overwrites the form ID.

Also, I don't understand the OP.

As it was before:

IF
 #type is set
 OR
 #tree is set
AND
 #type == fieldset
AND
 $child != buttons
AND
 $child != submit

The conditional the OP describes assumes that (!empty($form[$child]['#type']) || !empty($form[$child]['#tree'])) is not wrapped as a sub condition.

With this committed, you get notices thrown for all #markup elements.

So, please revert this commit.

tim.plunkett’s picture

FileSize
825 bytes

Also, the reason I made this major: I can no longer add Field API fields to a panelized node. The first configure screen just hangs, since it overwrites the form_id with NULL because of this change.

Uploading a patch for drush make purposes, but git revert ca28725 would work just as well.

populist’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the update tim.plunkett. This update is also reviewed/committed. Sorry for the confusion.

populist’s picture

Thanks for the update tim.plunkett. This update is also reviewed/committed. Sorry for the confusion.

Status: Fixed » Closed (fixed)

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