[magnolia-dev] [JIRA] (MGNLSITE-38) Provide in SiteFunctions: Nested call to get theme and additonal null handling.
Title: Message Title Christian Ringele updated an issue Magnolia Site Module / MGNLSITE-38 Provide in SiteFunctions: Nested call to get theme and additonal null handling. Change By: Christian Ringele Component/s: api Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to:
[magnolia-dev] [JIRA] (MGNLSITE-38) Provide in SiteFunctions: Nested call to get theme and additonal null handling.
Title: Message Title Christian Ringele updated an issue Magnolia Site Module / MGNLSITE-38 Provide in SiteFunctions: Nested call to get theme and additonal null handling. Change By: Christian Ringele Affects Version/s: 1.0.2 Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to:
[magnolia-dev] [JIRA] (MGNLSITE-38) Provide in SiteFunctions: Nested call to get theme and additonal null handling.
Title: Message Title Christian Ringele updated an issue Magnolia Site Module / MGNLSITE-38 Provide in SiteFunctions: Nested call to get theme and additonal null handling. Change By: Christian Ringele When you need the current configured theme you need to retrieve it with two calls:{code}[#assign currentSite = sitefn.site(content)][#assign currentTheme = sitefn.theme(currentSite)]//Clear, you can also do it in one line of code, but its still two calls:[#assign currentTheme = sitefn.theme(sitefn.site(content)))]{code}Which is a bit confusing for beginners. And also its more error prone and less straight forward.It would be easy to provide it in one method fir getting the theme accepting Node, doing the nested call:{code}[#assign currentTheme = sitefn.theme(content)]{code}Would look like this:{code}public Theme theme(Node content) { if(content == null) return null; Site site = this.site(content); return (site == null) ? null : this.theme(site);}{code}I included a patch containing the code, and also a version for ContentMap.Also I added some missing null handling in:{code} public Theme theme(Site site) { code} And // site.getTheme().getName(); will produce NPE {code} And {code} the 'getTheme public Site site ( Node ContentMap content) ' { // content.getJCRNode(); will produce NPE{code} Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums:
[magnolia-dev] [JIRA] (MGNLSITE-38) Provide in SiteFunctions: Nested call to get theme and additonal null handling.
Title: Message Title Christian Ringele updated an issue Magnolia Site Module / MGNLSITE-38 Provide in SiteFunctions: Nested call to get theme and additonal null handling. Change By: Christian Ringele Summary: Provide in SiteFunctions: Nested call to get theme and additonal null handling. Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to:
[magnolia-dev] [JIRA] (MGNLSITE-38) Provide in SiteFunctions: Nested call to get theme and additonal null handling.
Title: Message Title Christian Ringele updated an issue Magnolia Site Module / MGNLSITE-38 Provide in SiteFunctions: Nested call to get theme and additonal null handling. Change By: Christian Ringele When you need the current configured theme you need to retrieve it with two calls:{code}[#assign currentSite = sitefn.site(content)][#assign currentTheme = sitefn.theme(currentSite)]//Clear, you can also do it in one line of code, but its still two calls:[#assign currentTheme = sitefn.theme(sitefn.site(content)))]{code}Which is a bit confusing for beginners. And also its more error prone and less straight forward.It would be easy to provide it in one method fir getting the theme accepting Node, doing the nested call:{code}[#assign currentTheme = sitefn.theme(content)]{code}Would look like this:{code}public Theme theme(Node content) { if(content == null) return null; Site site = this.site(content); return (site == null) ? null : this.theme(site);}{code}I included a patch containing the code, and also a version for ContentMap. Also I added into the patch some missing null handling in:{code}public Theme theme(Site site) {// site.getTheme().getName(); will produce NPE{code}And{code}public Site site(ContentMap content) {// content.getJCRNode(); will produce NPE{code} Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe,
[magnolia-dev] [JIRA] (MGNLSITE-38) Provide in SiteFunctions: Nested call to get theme and additonal null handling.
Title: Message Title Christian Ringele updated an issue Magnolia Site Module / MGNLSITE-38 Provide in SiteFunctions: Nested call to get theme and additonal null handling. Change By: Christian Ringele Attachment: SiteFunctions-MGNLSITE-38.patch Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to:
[magnolia-dev] [JIRA] (MGNLSITE-38) Provide in SiteFunctions: Nested call to get theme and additonal null handling.
Title: Message Title Christian Ringele updated an issue Magnolia Site Module / MGNLSITE-38 Provide in SiteFunctions: Nested call to get theme and additonal null handling. Change By: Christian Ringele Attachment: site-MGNLSITE-38.patch Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to:
[magnolia-dev] [JIRA] (MGNLSITE-38) Provide in SiteFunctions: Nested call to get theme and additonal null handling.
Title: Message Title Christian Ringele updated an issue Magnolia Site Module / MGNLSITE-38 Provide in SiteFunctions: Nested call to get theme and additonal null handling. Change By: Christian Ringele Attachment: site-MGNLSITE-38.patch Add Comment This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4) For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: