Bug #72294

Can't delete FAL image in flexform

Added by Armin Vieweg almost 4 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Category:
FormEngine aka TCEforms
Target version:
Start date:
2015-12-17
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I have got a FAL field with the following configuration.

<config>
    <type>inline</type>
    <foreign_table>sys_file_reference</foreign_table>
    <foreign_field>uid_foreign</foreign_field>
    <foreign_sortby>sorting_foreign</foreign_sortby>
    <foreign_table_field>tablenames</foreign_table_field>
    <foreign_match_fields>
        <fieldname>image</fieldname> <!-- CAUTION!! Replace "fal" with the variable name of this field! -->
    </foreign_match_fields>
    <foreign_label>uid_local</foreign_label>
    <foreign_selector>uid_local</foreign_selector>
    <foreign_selector_fieldTcaOverride>
        <config>
            <appearance>
                <elementBrowserType>file</elementBrowserType>
                <elementBrowserAllowed>gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai</elementBrowserAllowed>
            </appearance>
        </config>
    </foreign_selector_fieldTcaOverride>
    <foreign_types type="array">
        <numIndex index="2">
            <showitem>--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
        </numIndex>
    </foreign_types>

    <minitems>1</minitems>
    <maxitems>1</maxitems>

    <appearance>
        <useSortable>1</useSortable>
        <headerThumbnail>
            <field>uid_local</field>
            <width>45c</width>
            <height>45</height>
        </headerThumbnail>

        <showPossibleLocalizationRecords>0</showPossibleLocalizationRecords>
        <showRemovedLocalizationRecords>0</showRemovedLocalizationRecords>
        <showSynchronizationLink>0</showSynchronizationLink>
        <useSortable>1</useSortable>
        <enabledControls>
            <info>1</info>
            <new>0</new>
            <dragdrop>0</dragdrop>
            <sort>1</sort>
            <hide>1</hide>
            <delete>1</delete>
            <localize>1</localize>
        </enabledControls>

        <createNewRelationLinkTitle>LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference</createNewRelationLinkTitle>
    </appearance>

    <behaviour>
        <localizationMode>select</localizationMode>
        <localizeChildrenAtParentLocalization>1</localizeChildrenAtParentLocalization>
    </behaviour>
</config>

I am not able to delete the image. Furthermore javascript errors appear. Please see attached screenshot. Occured in TYPO3 7.6.1

2015-12-17_1228.png View (49.9 KB) Armin Vieweg, 2015-12-17 12:32


Related issues

Related to TYPO3 Core - Bug #72379: Show button 'add image' after delete inline fails Closed 2015-12-22
Related to TYPO3 Core - Bug #78479: FAL field (in flexform) with minitems=1 and maxitems=1 has no possibility to add image after deleting the previous one New 2016-10-28
Duplicated by Dynamic Content Elements (DCE) - Bug #73431: Unable to delete images Rejected 2016-02-15
Duplicated by Dynamic Content Elements (DCE) - Bug #73601: Deleting a record from FAL element doesn't work Rejected 2016-02-22

Associated revisions

Revision e6727c8e (diff)
Added by Morton Jonuschat almost 4 years ago

[BUGFIX] FormEngine: Fix expanding of inline records in FlexForms

This commit provides the proper configuration information to the
compiler and render so that inline records in FlexForms can be
successfully deleted after being expanded from a collapsed state.

This change also fixes the problem that inline records within a
flexform displayed the default field palette due to missing
configuration information.

Resolves: #72294
Releases: master, 7.6
Change-Id: I330ab93a6127e1f84ed21ff6984721fb655d9136
Reviewed-on: https://review.typo3.org/45364
Reviewed-by: Armin Ruediger Vieweg <>
Tested-by: Armin Ruediger Vieweg <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Michael Oehlhof <>
Tested-by: Michael Oehlhof <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

Revision aa148716 (diff)
Added by Morton Jonuschat almost 4 years ago

[BUGFIX] FormEngine: Fix expanding of inline records in FlexForms

This commit provides the proper configuration information to the
compiler and render so that inline records in FlexForms can be
successfully deleted after being expanded from a collapsed state.

This change also fixes the problem that inline records within a
flexform displayed the default field palette due to missing
configuration information.

Resolves: #72294
Releases: master, 7.6
Change-Id: I330ab93a6127e1f84ed21ff6984721fb655d9136
Reviewed-on: https://review.typo3.org/45401
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

Revision 38a1bc5d (diff)
Added by Christian Kuhn almost 3 years ago

[!!!][TASK] Improve flex and TCA handling in FormEngine

The patch adapts a series of nasty form engine areas to more solid
code. The evaluate condition code is rewritten and works much better
in flex form scenarios. The suggest wizard and svg tree are much
more solid in flex forms. The group element is rewritten
towards a better readable and easier to refactor code, dropping
method dbFileIcons(). A bunch of issues is resolved along the way.

  • TCA "default" now works in flex form section container elements
  • The "displayCond" parser is now strict and throws exceptions on
    invalid syntax and wrong referenced fields to help debugging
    faulty display conditions
  • TCA displayCond on flex fields can now be prefixed with the
    sheet name and can reference field values from neighbor sheets
  • TCA displayCond now works with flex section containers
  • TCA flex section container now throw an exception if select or
    group fields configure a MM relation - this is not supported
  • TCA ctrl requestUpdate field is dropped, onChange=reload is now allowed
    not only on flex form fields, but also on normal columns fields
  • TCA tree now works as section container element and initializes
    correctly on new records and new containers
  • GroupElement rewrite to drop dbFileIcons()
  • config option maxitems now optional for type=group and type=select
    and defaults to "many items allowed"
  • inline now works in "fancy" flex situations with "new" records
    by handing the final dataStructureIdentifier around
  • FormEngine no longer loads extJS

Change-Id: Id1d081627529cc1502bb198389e5bd69372815cd
Resolves: #78899
Resolves: #72307
Resolves: #75646
Resolves: #76637
Resolves: #72106
Resolves: #78824
Resolves: #76793
Resolves: #68247
Resolves: #69715
Related: #78460
Related: #67198
Related: #72294
Releases: master
Reviewed-on: https://review.typo3.org/50879
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

History

#1 Updated by Armin Vieweg almost 4 years ago

This was the line in JS which caused the error:

document.getElementsByName('cmd' + shortName + '[delete]')[0].disabled = false;

And it is not appearing always. Set minitems and maxitems both to 1 seems to be the reason. I want just one image which is required.

#2 Updated by Armin Vieweg almost 4 years ago

When minitems is 0 you are able to delete the image.
But the row in IRRE does not disappear (fade out). The success of deletion becomes only visible, when you save the whole record.

#3 Updated by Gerrit Code Review almost 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45354

#4 Updated by Andreas Fernandez almost 4 years ago

  • Status changed from Under Review to Accepted

#5 Updated by Morton Jonuschat almost 4 years ago

  • Category set to FormEngine aka TCEforms
  • Assignee set to Morton Jonuschat
  • Target version set to 7.6.2

#6 Updated by Gerrit Code Review almost 4 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45364

#7 Updated by Gerrit Code Review almost 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45364

#8 Updated by Gerrit Code Review almost 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45364

#9 Updated by Gerrit Code Review almost 4 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45401

#10 Updated by Morton Jonuschat almost 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#11 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF