[MGNLFORM-167] Summary component - incorrectly displays "select box" value & label Created: 15/May/13  Updated: 30/Apr/14  Resolved: 25/Apr/14

Status: Closed
Project: Magnolia Form Module
Component/s: field
Affects Version/s: 1.4.5
Fix Version/s: 1.4.10, 2.2.4

Type: Bug Priority: Neutral
Reporter: Adrien Berthou Assignee: Milan Divilek
Resolution: Fixed Votes: 0
Labels: form, next, quickwin
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Problem: When adding a select box in the form, if in the next form step I had a form summary component, instead of displaying <formFieldLabel> <formFieldValue>, it would display <formFieldValue> followed by a star.

Source of issue: info.magnolia.module.form.templates.components.FormSummaryModel, templateParams.put(controlValueLabelMap.get(value), "*"); - line 204 - seems to be where the problem is coming from.



 Comments   
Comment by Adrien Berthou [ 16/May/13 ]

Patch: info.magnolia.module.form.templates.components.FormSummaryModel class, line 204, replace templateParams.put(controlValueLabelMap.get(value), "*"); by templateParams.put(i18nFieldNode.getTitle() , value);

Comment by Roman Kovařík [ 22/Apr/14 ]

Reopen: Please add unit test and set correct fix version for 2.2.x.

Comment by Roman Kovařík [ 25/Apr/14 ]

Sorry for reopening again :

  1. We decided to not extend RepositoryTestCase if it's really not necessary (it's unnecessary slow).
  2. We prefer usage of matchers instead of single assertions according to this knowledge transfer https://wiki.magnolia-cms.com/display/DEVINT/Knowledge+Transfer#KnowledgeTransfer-Testingtechniques-TestingwithMatchers-session1
    Something like:
    -        assertTrue(values.contains("option1"));
    +	 assertThat(values, IsMapContaining("options1", "value1"))
    

    The reason is that you get more descriptive error message when the test fails.

Generated at Mon Feb 12 05:37:31 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.