[TYPO3-core] FYI24: #9479: Selected items are not visible after saving the form in BE

Steffen Kamper info at sk-typo3.de
Sat Oct 4 00:28:36 CEST 2008


Hi Dmitry,

reviewed while sitting in a house with view on "Vierwaldstädter See",
switzerland :-)
+1

vg Steffen

"Dmitry Dulepov" <dmitry at typo3.org> schrieb im Newsbeitrag
news:mailman.1.1223054257.20669.typo3-team-core at lists.netfielders.de...
> Hi!
>
> This is SVN patch request.
>
> Type: bug, trivial but major
>
> Branches: trunk, 4.2, 4.1
>
> BT reference: http://bugs.typo3.org/view.php?id=9479
>
> Problem: if a field in the $TCA has a multichoice select field with
`itemsProcFunc` but without `items`, current values will not appear in the
BE form after saving (the right part of the control will be empty). The
problem is in t3lib_transferData class, which does not call `itemsProcFunc`
if `items` is not set in $TCA. t3lib_TCEforms behaves correctly and always
calls `itemsProcFunc` (even if `items` is empty). `items` field is not
declared as "required" in "TYPO3 Core API" and therefore can be be omitted
by a developer.
>
> Solution: the attached patch fixes the issue and calls `itemsProcFunc`
even if items are not set in the $TCA. This makes t3lib_transferData
compatible with t3lib_TCEforms.
>
> Notes: test extension is attached. It adds a new table named "Demo for bug
#9474". Without the patch, selected values will not be visible after saving
the record. With the patch values will be visible as expected.
>
> The solution is trivial, therefore I plan to commit it in 24h if no one
objects.
>
> -- 
> Dmitry Dulepov
> TYPO3 Core team
> My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book
> In the blog:
http://typo3bloke.net/post-details/duplicate_content_with_realurl/
>


----------------------------------------------------------------------------
----


> Index: t3lib/class.t3lib_transferdata.php
> ===================================================================
> --- t3lib/class.t3lib_transferdata.php (revision 4276)
> +++ t3lib/class.t3lib_transferdata.php (working copy)
> @@ -431,13 +431,14 @@
>   if (intval($fieldConfig['config']['maxitems'])>1) {
>
>   // Add regular elements:
> - if (is_array($fieldConfig['config']['items'])) {
> - $fieldConfig['config']['items'] =
$this->procesItemArray($fieldConfig['config']['items'],
$fieldConfig['config'], $TSconfig[$field], $table, $row, $field);
> - foreach($fieldConfig['config']['items'] as $pvpv) {
> - foreach($elements as $eKey => $value) {
> - if (!strcmp($value,$pvpv[1])) {
> -
$dataAcc[$eKey]=rawurlencode($pvpv[1]).'|'.rawurlencode($this->sL($pvpv[0]))
;
> - }
> + if (!is_array($fieldConfig['config']['items'])) {
> + $fieldConfig['config']['items'] = array();
> + }
> + $fieldConfig['config']['items'] =
$this->procesItemArray($fieldConfig['config']['items'],
$fieldConfig['config'], $TSconfig[$field], $table, $row, $field);
> + foreach($fieldConfig['config']['items'] as $pvpv) {
> + foreach($elements as $eKey => $value) {
> + if (!strcmp($value,$pvpv[1])) {
> +
$dataAcc[$eKey]=rawurlencode($pvpv[1]).'|'.rawurlencode($this->sL($pvpv[0]))
;
>   }
>   }
>   }
>




More information about the TYPO3-team-core mailing list