[MAGNOLIA-971] CLONE -ifEmpty is not working properly Created: 12/Jul/06  Updated: 09/Nov/06  Resolved: 09/Nov/06

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: None
Fix Version/s: 3.0 Final

Type: Bug Priority: Minor
Reporter: Yves-Marie DANIEL Assignee: Magnolia International
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
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   

from an email:

i noticed some strange things with the core cms tags "ifNotEmpty" and "ifEmpty"...

i have a content element 'textTitle', which has content set. so it's not empty (at least to my understanding )

i have following test code:
nodeData 'textTitle' = <cms:out nodeDataName="textTitle" />

<cms:ifNotEmpty nodeDataName="textTitle" >
<br><cms:out nodeDataName="textTitle" /> --> from 'if not empty'
</cms:ifNotEmpty>

<cms:ifEmpty nodeDataName="textTitle" >
<br><cms:out nodeDataName="textTitle" /> --> from 'if empty'
</cms:ifEmpty>

the surprising result:
nodeData 'textTitle' = A line of Text
A line of Text --> from 'if empty'

i expect that i should get "A line of Text --> from 'if NOT empty'

why that? i am not using a collection or so. simply a "top level" content element.



 Comments   
Comment by Yves-Marie DANIEL [ 12/Jul/06 ]

The ifEmpty / ifNotEmpty bug is supposed to be fixed in 2.1, but with magnolia 3RC, i have exactly the same bug !

In fact with :

<cms:ifEmpty nodeDataName="title">
<cms:out nodeDataName="title" />
</cms:ifEmpty>

The title is displayed !!!

Comment by Yves-Marie DANIEL [ 12/Jul/06 ]

I am a bit new with magnolia. When you write "Fix version/s 3.0RC3", it means this bug is fixed ? But i still have the bug... ;-C

Comment by Yves-Marie DANIEL [ 13/Jul/06 ]

The tags ifNotEmpty and ifEmpty don't work on a few pages... But i have used :

<c:if test="${titre ne '' }">
<c:out value="${titre}" />
</p></c:if>

and it works

Comment by Yves-Marie DANIEL [ 13/Jul/06 ]

you can close this issue. Thanks

Comment by Magnolia International [ 09/Nov/06 ]

Just tried this again out of consciousness - just works.
From svn history, I see these tags haven't changed since before rc1.

Generated at Mon Feb 12 03:22:24 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.