Bug #9257

Flexform Sections Cannot Be Deleted

Added by Jeff Segars almost 3 years ago. Updated over 1 year ago.

Status:Accepted Start date:2010-08-11
Priority:Should have Due date:
Assignee:Jeff Segars % Done:

0%

Category:Editing Form
Target version:1.5.1
Votes: 0

Description

New flexform sections can be added and existing sections can be modified but cannot be deleted.

Associated revisions

Revision 4271
Added by Jeff Segars over 1 year ago

Follow-up to bug #9257: Flexform section processing breaks normal backend editing of sections.

History

Updated by Jeff Segars almost 3 years ago

After some investigation, I see the POST data is different in the frontend and backend and the incorrect element name on the delete action is clearly causing the issue.

FRONTEND

-----------------------------168072824752491622650073
Content-Disposition: form-data; name="_ACTION_FLEX_FORMTSFE_EDIT[data][tt_content][357][pi_flexform][data][sDEF][lDEF][images][el][_ACTION][1]" 

DELETE
-----------------------------168072824752491622650073
Content-Disposition: form-data; name="TSFE_EDIT[data][tt_content][357][pi_flexform][data][sDEF][lDEF][images][el][1][image][el][file][vDEF]_mul" 

0
-----------------------------168072824752491622650073
Content-Disposition: form-data; name="TSFE_EDIT[data][tt_content][357][pi_flexform][data][sDEF][lDEF][images][el][1][image][el][file][vDEF]" 

adults-ministries_04.jpg

BACKEND

-----------------------------9849436581144108930470211272
Content-Disposition: form-data; name="_ACTION_FLEX_FORMdata[tt_content][357][pi_flexform][data][sDEF][lDEF][images][el][_ACTION][1]" 

DELETE
-----------------------------9849436581144108930470211272
Content-Disposition: form-data; name="data[tt_content][357][pi_flexform][data][sDEF][lDEF][images][el][1][image][el][file][vDEF]_mul" 

0
-----------------------------9849436581144108930470211272
Content-Disposition: form-data; name="data[tt_content][357][pi_flexform][data][sDEF][lDEF][images][el][1][image][el][file][vDEF]" 

adults-ministries_04.jpg

Updated by Jeff Segars almost 3 years ago

After further debugging, this is primarily a core issue since t3lib_tcemain is hardcoded to use backend naming conventions at this point. I've opened a ticket at http://bugs.typo3.org/view.php?id=15496 to track the issue. It may be possible to use a tcemain hook to work around it for the time being in feeditadvanced.

Updated by Jeff Segars almost 3 years ago

  • Category set to Editing Form
  • Status changed from New to Resolved
  • Assignee set to Jeff Segars
  • Target version set to 1.5.0

Fixed in r2541 by using a TCEMain hook to manipulate the POST data to match backend naming conventions. The core bug will remain open, but this gets it working in the meantime.

Updated by Sonja Schubert over 1 year ago

This hook/solution is nice but causes another bug.

As soon as $_POST['_ACTION_FLEX_FORMdata'] is not empty, because in backend someone deletes a flexform section, this class which uses the hook will empty this array/var.

It would be better to check in the hook class if the var is empty before overwriting it. Something like this:

if(empty($_POST['_ACTION_FLEX_FORMdata'])) {
    $_POST['_ACTION_FLEX_FORMdata'] = $temp['data'];
}

Would be nice if this issue could be reopened and this could be fixed in the next version.

Updated by Jeff Segars over 1 year ago

  • Status changed from Resolved to Accepted
  • Target version changed from 1.5.0 to 1.5.1

Hey Sonja,
I just had a coworker run into the exact same problem. He hadn't identified feeditadvanced as the culprit yet, but your description was helpful for him in isolating the problem. I'll get this fixed in the next release...

Thanks,
Jeff

Updated by Jeff Segars over 1 year ago

Fixed in r4271.

Also available in: Atom PDF