Bug #70956

Story #69617: FormEngine bugs

Behavior of keepItems changed

Added by Simon Praetorius over 4 years ago. Updated over 2 years ago.

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

100%

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

Description

I just noticed that the behavior of the keepItems setting in page TSconfig changed from TYPO3 6.2 to TYPO3 7.x (tested in 7.5).

Example 1:

TCEFORM.tt_content {
  header_layout {
    keepItems =
    addItems {
      1 = Ebene 1 (nur einmal auf der Seite verwenden)
      0 = Ebene 2
      12 = Ebene 2 (Akzentfarbe)
      3 = Ebene 3
      13 = Ebene 3 (Akzentfarbe)
      4 = Ebene 4
      14 = Ebene 4 (Akzentfarbe)
      100 = Verborgen
    }
  }
}
  • TYPO3 6.2: Removes all existing items from the select and adds all new ones
  • TYPO3 7.5: Adds all new ones and keeps all existing items

Example 2:

TCEFORM.tt_content {
  header_layout {
    keepItems = 1
    addItems {
      1 = Ebene 1 (nur einmal auf der Seite verwenden)
      0 = Ebene 2
      12 = Ebene 2 (Akzentfarbe)
      3 = Ebene 3
      13 = Ebene 3 (Akzentfarbe)
      4 = Ebene 4
      14 = Ebene 4 (Akzentfarbe)
      100 = Verborgen
    }
  }
}
  • TYPO3 6.2: Removes all existing items except for 1 from the select and adds all new ones
  • TYPO3 7.5: Adds all new ones and then removes both existing and new ones except for both 1s

Example 3:

TCEFORM.tt_content {
  header_layout {
    removeItems = 0,1,2,3,4,5,6,100
    addItems {
      1 = Ebene 1 (nur einmal auf der Seite verwenden)
      0 = Ebene 2
      12 = Ebene 2 (Akzentfarbe)
      3 = Ebene 3
      13 = Ebene 3 (Akzentfarbe)
      4 = Ebene 4
      14 = Ebene 4 (Akzentfarbe)
      100 = Verborgen
    }
  }
}
  • TYPO3 6.2: Adds all new ones and then removes both existing and new ones except for 12, 13 and 14
  • TYPO3 7.5: the same

In my opinion the way TYPO3 6.2 interpreted the keepItems setting was more flexible because it allowed me to rename and reorder items without messing with the css_styled_content TypoScript.


Related issues

Related to TYPO3 Core - Bug #78628: selectTree pageTsConfig addItems broken Closed 2016-11-09
Related to TYPO3 Core - Bug #82980: Handling of mixed string and 0 broken for keepItems and removeItems page ts Closed 2017-11-12

Associated revisions

Revision 2da8b474 (diff)
Added by Morton Jonuschat about 4 years ago

[BUGFIX] FormEngine: Fix keepItems, addItems and removeItems handling

With the FormEngine rewrite the evaluation order and handling of the
options changed. This patch restores the previous order, adds tests
for the addItems handling as well as for the execution order of
keepItems, addItems and removeItems.

In addition the behavior of keepItems with an empty list of items has
been restored.

Resolves: #70956
Releases: master
Change-Id: I44b3036e2ba4dd824037aa689543dc2f1c653b93
Reviewed-on: https://review.typo3.org/44570
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>

History

#1 Updated by Christian Kuhn over 4 years ago

  • Parent task set to #69617

#2 Updated by Christian Kuhn about 4 years ago

  • Category changed from TypoScript to FormEngine aka TCEforms

#3 Updated by Morton Jonuschat about 4 years ago

  • Status changed from New to Accepted
  • Assignee set to Morton Jonuschat

#4 Updated by Gerrit Code Review about 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/44570

#5 Updated by Gerrit Code Review about 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/44570

#6 Updated by Gerrit Code Review about 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/44570

#7 Updated by Morton Jonuschat about 4 years ago

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

#8 Updated by Riccardo De Contardi over 2 years ago

  • Status changed from Resolved to Closed

#9 Updated by Helmut Hummel about 2 years ago

  • Related to Bug #82980: Handling of mixed string and 0 broken for keepItems and removeItems page ts added

Also available in: Atom PDF