Bug #43893

selected = 1 doesn't work in class.tslib_content_form.php

Added by Thorsten Menkenhagen almost 7 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2012-12-11
Due date:
% Done:

100%

TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

When I change

$selected = isset($singleKeyArray['selected.'])
? $this->cObj->stdWrap($singleKeyArray['selected'], $singleKeyArray['selected.'])
: $singleKeyArray['selected'];

in Line 107 to

$selected = isset($singleKey_valueArray['selected.'])
? $this->cObj->stdWrap($singleKey_valueArray['selected'], $singleKey_valueArray['selected.'])
: $singleKey_valueArray['selected'];

then everything is okay.


Related issues

Duplicated by TYPO3 Core - Bug #47484: selected option not respected in sysext frontend -> FormContentObject Rejected 2013-04-23

Associated revisions

Revision 8d30ece2 (diff)
Added by Wouter Wolters over 6 years ago

[BUGFIX] selected = 1 doesn't work in FormContentObject

Wrong variable is used to set selected correctly.

Change-Id: I90623339c4d13eb07d7e5ef87e1b4e3aa8cf147e
Resolves: #43893
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/20282
Reviewed-by: uwe trotzek
Tested-by: uwe trotzek
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

Revision d0024443 (diff)
Added by Wouter Wolters over 6 years ago

[BUGFIX] selected = 1 doesn't work in FormContentObject

Wrong variable is used to set selected correctly.

Change-Id: I90623339c4d13eb07d7e5ef87e1b4e3aa8cf147e
Resolves: #43893
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/20282
Reviewed-by: uwe trotzek
Tested-by: uwe trotzek
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
(cherry picked from commit 8d30ece2f0dfc0306c22a63d9e57a75e32d1365e)
Reviewed-on: https://review.typo3.org/22751

Revision db1c38be (diff)
Added by Wouter Wolters over 6 years ago

[BUGFIX] selected = 1 doesn't work in FormContentObject

Wrong variable is used to set selected correctly.

Change-Id: I90623339c4d13eb07d7e5ef87e1b4e3aa8cf147e
Resolves: #43893
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/20282
Reviewed-by: uwe trotzek
Tested-by: uwe trotzek
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
(cherry picked from commit 8d30ece2f0dfc0306c22a63d9e57a75e32d1365e)
Reviewed-on: https://review.typo3.org/22752

History

#1 Updated by Peter Schuster almost 7 years ago

I can confirm this. The same problem exists in TYPO3 v4.7.
The suggested fix works for me, too.

#2 Updated by Tobias Liebig almost 7 years ago

Could you provide a more detailed description how to test/reproduce this?

I guess it also occurs in 6.0, even if the code looks completely different there

#3 Updated by Tobias Liebig almost 7 years ago

Test TypoScript:

page = PAGE

temp.mailform = FORM
temp.mailform {
  dataArray {
    20.label = Foobar
    20.type = test=select
    20.valueArray {
      10.label = Blue
      10.value = 1
      20.label = Red
      20.value = 2
      20.selected = 1
    }
  }
  recipient = info@example.com
  layout = <div class="some-class">###LABEL### ###FIELD###</div>
}

page.10 < temp.mailform

#4 Updated by Tobias Liebig almost 7 years ago

  • Complexity set to easy

I can confirm this still happens in 6.0, although the TYPO3\CMS\Frontend\ContentObject\FormContentObject seems not to be used at all if the new EXT:form is installed.

However, the suggested fix makes sense and is pretty easy to implement.

#5 Updated by Gerrit Code Review over 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20282

#6 Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20282

#7 Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22751

#8 Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/22752

#9 Updated by Wouter Wolters over 6 years ago

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

#10 Updated by Riccardo De Contardi about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF