[
http://jira.magnolia-cms.com/browse/MAGNOLIA-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=23666#action_23666
]
Will Scheidegger commented on MAGNOLIA-2669:
--------------------------------------------
At least for tags outside of a content node iterator the problem actually seems
to be related to the way how the deprecated Resource class works now.
Resource.getLocalContentNode() simply returns
AggregationState.getCurrentContent() which is always set to the local content
node OR the current active page if one is not inside a content node iterator.
Therefore the resolveNode() method of the BaseContentTag class always thinks
that the tag is inside a content node iterator and therefore does not work
properly.
Simply comparing the handle of the local contente node returned by the Resource
class with the active current page fixes this problem. Since this is a hack and
not really a fix I did not provide a patch but here are the first few lines of
my modified BaseContentTag.resolveNode() methode if you need a quick fix:
{code}
protected Content resolveNode(Content currentPage) {
Content currentParagraph = Resource.getLocalContentNode();
if (currentParagraph != null &&
currentParagraph.getHandle().equals(Resource.getCurrentActivePage().getHandle()))
{
currentParagraph = null;
}
//... rest of the method
}
{code}
> <cms:out inherit="true" fails
> -----------------------------
>
> Key: MAGNOLIA-2669
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2669
> Project: Magnolia
> Issue Type: Bug
> Components: templating
> Affects Versions: 4.0.1
> Environment: Windows Vista Business SP1
> JDK 1.6.0_11
> apache-tomcat-5.5.26
> magnolia-bundled-webapp-4.0.1.war
> Reporter: Oliver Knorr
> Assignee: Philipp Bärfuss
> Priority: Minor
> Fix For: 4.1.1, 4.0.x
>
>
> After upgrading from Magnolia 3.6.3 to 4.0.1, cms:out-Tags stopped printing
> values inherited from parent pages. For example: <cms:out
> nodeDataName="copyright" inherit="true" /> prints something only, if the
> copyright-field is filled for the page, but no longer if it is filled only
> for the parent page.
> Some debugging showed a different code path in BaseContentTag.resolveNode()
> because of different results from Resource.getLocalContentNode().
> This seems to be caused by the changes for MAGNOLIA-2642. If I revert
> Resource.java to the previous revision (from
> http://svn.magnolia-cms.com/view/community/magnolia/trunk/magnolia-taglib-cms/src/main/java/info/magnolia/cms/taglibs/Resource.java?revision=21024),
> the inherited fields work fine for me.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------