Closed (fixed)
Project:
Fieldable Panels Panes (FPP)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2011 at 03:44 UTC
Updated:
20 Dec 2011 at 15:14 UTC
I added an image field to a content pane without a problem. But when trying to use that pane type to insert content onto a panel, the image would not be uploaded. These are the errors:
Notice: Undefined offset: 1 in _fieldable_panels_panes_load_entity() (line 265 of /.../sites/all/modules/contrib/fieldable_panels_panes/plugins/content_types/fieldable_panels_pane.inc).
Notice: Undefined index: field_pane_image in file_ajax_upload() (line 265 of /.../modules/file/file.module).
Notice: Undefined index: #suffix in file_ajax_upload() (line 274 of /.../modules/file/file.module).
Comments
Comment #1
jenlamptonUpdated to the dev branch and image uploads are working :)
this is so cool.
Comment #2
cangeceiro commentedre-opening as I am experiencing this on a sandbox site running the latest -dev branches of ctools/panels/fieldable_panels_panes.
When clicking "upload" the following errors are returned
Notice: Undefined offset: 1 in _fieldable_panels_panes_load_entity() (line 265 of /var/www/cmog/drupal/ubercart/sites/all/modules/fieldable_panels_panes/plugins/content_types/fieldable_panels_pane.inc).
Notice: Undefined index: field_images in file_ajax_upload() (line 265 of /var/www/cmog/drupal/ubercart/modules/file/file.module).
Notice: Undefined index: #suffix in file_ajax_upload() (line 274 of /var/www/cmog/drupal/ubercart/modules/file/file.module).
Comment #3
jenlamptonAre you also running the latest -dev of both ctools and panels?
Did you run update.php after you switched to the latest -dev versions?
Comment #4
merlinofchaos commentedInteresting. I did several image upload tests and didn't run into this using latest -dev of Panels and CTools.
Taking a look at the code, I see one possibility:
Does this problem only happen when adding a new fieldable pane, rather than selecting an existing one or editing an existing one?
It looks like that problem might be that the entity load currently assumes one exists in the database, and that would fit the problem we're seeing. If that's the case, I think the fix is to make sure that we can tell when we're in the process of creating one and to provide the default entity and make sure that is properly cached.
It may also be a different path on the Panels side as we-- my fix may only have worked for 'edit' and not for 'add'.
Comment #5
cangeceiro commentedI can confirm that the issue only happens when creating new panes. Inspecting the pane entity in PanelsPaneController::create() shows no signs of fields, though im not sure if it should at this point. I am going to continue to poke around and try to find a solution, but so far no dice.
Comment #6
merlinofchaos commentedRight, it shouldn't show it at that point. Ok, I think I know at least what the notices are. I will play with this right now and see if I can figure it out.
Also marking active since needs work is a graveyard. :)
Comment #7
merlinofchaos commentedOk, found the problem. The problem is that form caching can load the plugin .inc file outside of the plugin system, which is incompatible with the $plugin = array() format of the plugin. This is easy enough to correct using the 'small hook' function name instead. Patch forthcoming.
Comment #8
merlinofchaos commentedOk, committed the fix and pushed.
Comment #9
cangeceiro commentedThat seemed to fix the php notices and now images are uploading properly to the form, but it also seems to have caused a regression. Now i am running back into this issue http://drupal.org/node/1253566#comment-4902880. So everything looks good on the form, after submitting all of the pane settings are gone. I see in the ctools code that you added $pane = $form_state['pane']; so i dont think the reference is getting lost in the same spot. for shits and giggles i put it in before the if statement in the ctools code and that was also to no avail.
Comment #10
cangeceiro commentedactually, ignore my last comment, i tried this in a separate sandbox i have setup and it worked. Ill test some more
Comment #11
merlinofchaos commentedI saw that once...and then couldn't make it happen again. I also updated CTools in between.
That leaves the possibility that there is *another* transient error that is causing htat but I am not sure what it would be.
Comment #12
cangeceiro commentedTested some more, it looks like the issue i outlined above was happening on a staging site that I am working with. On that site I had updated to the first Nov 3rd dev branch of ctools not realizing there was another release later the same day that had some of the caching fixes. updating to the later Nov 3rd dev branch fixed this issue. Im calling it fixed.
Comment #13
marsdk commentedI have the same issue as cangeceiro had with the new (not a reusable one) fieldable pane which does not seem to save any of the field data. Versions are - Ctools 1.x-dev, fieldable_panels_panes 1.x-dev, panels 3.0-alpha3. I have just updated to ctools 1.x-dev and clear cache, but nothing seems to do it. Any ideas ?
Comment #14
merlinofchaos commentedUpdate to latest Panels -dev. There's a fix in Panels that is needed to save data that was manipulated during ajax operations.
Comment #15
marsdk commentedThanks. Just tested it with Panels -dev and it works like a charm.