When adding a new panel type node (a panel node), the edition screen is broken with a first created page with an error and again the panel node type form.

There is a bug using empty() function, that function doesn't return false if the variables is not defined. So when creating an empty node it check if there is a layout set in the $node,
if not then it reads the next argument (#3) after node/add/panel. If the argument doesn't have choose-layout then is not coming from the layout selection form and then go to this layout form selection.

Comments

jcmarco’s picture

Title: Panel Node creation fails » Panel Node creation and panel content type edition fail
StatusFileSize
new976 bytes

When editing the content type panel, there is the same error because the condition that checks if it's creating a new node (empty($node->nid)) doesn't differentiate from creating a new node than editing the content-type, so added a new check about the existence or not of $params)
Deleted a lost debugging line and an empty line.

That patch includes last one as well

Anonymous’s picture

Version: 6.x-3.x-dev » 6.x-3.0-beta2

edited: ----- wrong post -----

quadbyte’s picture

StatusFileSize
new752 bytes

Patch tested and working here.
However the patch should be submitted against Panels 6.x-3.0-beta2. So here it is.

merlinofchaos’s picture

Status: Needs review » Fixed

Committed.

merlinofchaos’s picture

Status: Fixed » Reviewed & tested by the community

Reverted.

This patch completely broke creating new panel nodes.

And now that I look at it, I have no idea what the problem it's trying to solve is.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Needs work

Can you explain what this is trying to do?

quadbyte’s picture

This patch doesn't work anymore.

I guess the issue discussed here is how to avoid the systemic redirection to choose a layout when executing hook_form on panels_node when $node->nid is empty/undefined.

For example, there is a conflict with the Vertical Tabs module which executes hook_form() via drupal_retrieve_form() to pull form data from the content type when visiting admin/content/types/panel/edit, then panels_node module attempts to redirect to the 'choose layout' page and everything ends up showing a 404 - page not found.

In the meantime I found a cheap fix checking if arg(2) != 'types' to avoid this redirection, but I don't really like it.

zoltán balogh’s picture

subscribe

merlinofchaos’s picture

Status: Needs work » Fixed

I believe this was eventually fixed by #603150: Nodetype Settings for Panel Nodes not working

Status: Fixed » Closed (fixed)

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