There is an amazing module called FAPE (drupal.org/project/fape) that allows links to be generated to allow editing of individual fields (i.e. admin/field/edit/node/1/body). It currently integrates with contextual module (turn on fape + contextual and use the IPE on a panelizer node), but could be extended to a larger use case.

The task here is...
-- update panopoly magic to include the edit form as part of the configuration as per http://drupal.org/files/fape-added-to-ipe.png
-- empower the "update field" button to save the field + update the preview
-- create a patch for FAPE that disables the hard requirement of contextual

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

beeradb’s picture

We'll call this Alpha 1.

FAPE is not yet added to the build so you'll need to manually install it if you want to test this.

There's still a lot of kinks to work out in this implementation, so here's some of the stuff that's wrong.

  • After adding a new image, it auto submits and takes you to step 2, rather than just previewing and staying on step 1
  • After editing an image field, the node is saved after step 1. We should delay this until the multi step is completed. We can probably just add a check on the clicked button in panopoly_magic_fape_submit(). Or perhaps we need to find a way to delay until the save button in IPE is clicked?
  • When editing a field body, it goes to step 2 even though there are no options. I need to reinstall a fresh version w/ panelizer enabled to see if this is a general panelizer issue, or if this was introduced somehow.
  • Edit forms for 'phantom' fields show up. Things like node categories etc. Not sure if this happens with vanilla panelizer / FAPE or not. Need to take a look at this on a vanilla install as well.
  • Need to add FAPE to the build scripts
  • Better checking / handling all around to make sure things are properly added to fieldsets. Much of our current handling of this for fieldable panels panes doesn't kick in for this

This is generally working, but there's definitely quite a bit of polish to add.

beeradb’s picture

Status: Active » Needs review
FileSize
6.98 KB
601 bytes

Here's alpha 2.

Improvements:

  • This now saves almost all fields (body field is the exception) at the end of the wizard, rather than when data is entered
  • Better handling of fieldsets for edit fields

Issues:

  • Image widget still auto submits to next step after changing the image.
  • There is some weirdness when moving backwards between steps.
  • Need to resolve handling of body fields. For some reason custom form state attributes (the modified entity) gets cleared out between steps for body fields.

This patch requires #1788170: Allow the context object to be altered by form submitters and validators and #1785056: Remove contextual dependency

beeradb’s picture

FileSize
8.76 KB

Ack. The second patch was wrong. This should be used in replacement of the 1772824-fape.patch.

populist’s picture

Status: Needs review » Postponed (maintainer needs more info)

Alright! This is looking pretty sharp and I went ahead and committed all work to date in #1 and #2. I even enabled the fape.module by default (and removed the conditional logic) since it was so cool. In terms of the issues:

-- Image widget still auto submits to next step after changing image

I believe I fixed this with http://drupalcode.org/project/panopoly_admin.git/commitdiff/f182ffc. There was trouble with the auto submit code and our auto upload code conflicting.

-- There is some weirdness when moving backwards between steps.

What wierdness are you seeing? I think it is wierd you can move backwards anyway and that there are empty steps, but thats a ctools issue :)

-- Need to resolve handling of body fields. For some reason custom form state attributes (the modified entity) gets cleared out between steps for body fields.

How can i replicate this and does your patch to panels context fix this or http://drupal.org/files/fape-panoply-widgets.patch? I wasn't able to replicate it.

beeradb’s picture

-- There is some weirdness when moving backwards between steps.

What wierdness are you seeing? I think it is wierd you can move backwards anyway and that there are empty steps, but thats a ctools issue :)

Try moving backwards with an image widget. It doesn't properly re-populate the form fields when moving from step 2 back to step 1 (assuming you changed the image in step 1)

-- Need to resolve handling of body fields. For some reason custom form state attributes (the modified entity) gets cleared out between steps for body fields.

How can i replicate this and does your patch to panels context fix this or http://drupal.org/files/fape-panoply-widgets.patch? I wasn't able to replicate it.

No. That patch is just for improved handling for fieldsets. Currently the body field is special cased in the submitter to save after step 1. It's not optimal, but it works. See the if statement in panopoly_magic_fape_submit().

populist’s picture

Status: Postponed (maintainer needs more info) » Active
beeradb’s picture

Status: Active » Needs review
FileSize
1.43 KB

Here's a patch which fixes moving backwards when editing image fields

populist’s picture

Status: Needs review » Fixed

Looks good. I tested, committed, and pushed this patch. Marking this issue as fixed since core FAPE support is on the scene, but will require ongoing testing.

Status: Fixed » Closed (fixed)

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