Closed (fixed)
Project:
Panopoly
Version:
7.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 May 2012 at 18:26 UTC
Updated:
13 Aug 2012 at 19:31 UTC
Jump to comment: Most recent file
This affect both beta1 and beta3.
To reproduce:
"Customize this page" -> "Add new pane" -> "Add image" -> uploade an image -> "Finish" -> "Save" -> then go back to "customize this page" -> "Edit" that image pane -> "Remove" previously added image.
This results in an AJAX error:
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /<Drupal_directory>/file/ajax/content_settings/field_basic_image_image/und/0/form-zXJAhwNBWp8QiWYNo-2SDkkicctqhDR9nF8UcHB-Zb4
StatusText: n/a
ResponseText:
...
Error The website encountered an unexpected error. Please try again later.
Error message
Recoverable fatal error: Argument 2 passed to drupal_array_set_nested_value() must be an array, null given, called in /full/path/to/<Drupal_directory>/site/includes/form.inc on line 2500 and defined in drupal_array_set_nested_value() (line 6422 of /full/path/to/Drupal/site/includes/common.inc).
ReadyState: undefinedThe image is impossible to remove and the whole pane needs to get deleted instead.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1567704-fix-image-remove.patch | 3.08 KB | beeradb |
Comments
Comment #1
populist commentedI can verify that this is a problem. There is something tricky going on.
Comment #2
populist commentedComment #3
populist commentedComment #4
beeradb commentedI've been taking a look at this. No definite solution yet but I figured I would post what is known so far.
This looks to be caused by the fieldable panel panes specific form_alters in panopoly_widgets_form_alter. Although most of the fields in that tree don't mind being form altered under the "General Settings" fieldset, the remove button stops working. The reason for this is #parents gets incorrectly set when the remove button is pressed, causing the image fid to not be properly cleared. Moving the image field (back) to the root of the form causes the button to behave correctly.
My favored approach for fixing this would be to create actual fieldsets for this stuff via field_group.module, which appears to implement this stuff in #pre_render methods. This would also have the added benefit of allowing placement of these fields to once again be controlled via the fieldable panel panes field config UI. Unfortunately, converting this to use the field_group module causes the image field to not properly populate on a node edit. I'm looking into why this is currently.
I'll post back when I have more on this.
Comment #5
beeradb commentedThis fixes the bug by moving the Content Settings fieldset into a pre-render method.
I still think long term we should look at letting the field group module handle this stuff, but it's probably beyond the scope of this patch. This patch should maintain the exact same behavior but allow images to be removed.
Comment #6
populist commentedLovely. I spent a lot of time struggling with this issue. Glad it got fixed and committed!
Comment #7.0
(not verified) commentedremoved unnecessary details