Panel Node creation and panel content type edition fail
jcmarco - May 3, 2009 - 23:07
| Project: | Panels |
| Version: | 6.x-3.0-beta2 |
| Component: | Panel nodes |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
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.
| Attachment | Size |
|---|---|
| panels_node_module.patch | 552 bytes |

#1
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
#2
edited: ----- wrong post -----
#3
Patch tested and working here.
However the patch should be submitted against Panels 6.x-3.0-beta2. So here it is.
#4
Committed.
#5
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.
#6
Can you explain what this is trying to do?
#7
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.
#8
subscribe