Ticket #1320 (closed defect: fixed)

Opened 15 months ago

Last modified 15 months ago

article_related.ftl error for PLoS Biology article 0020222

Reported by: ssterling Owned by: npeterson
Priority: medium Milestone: 0.9.3_rc2
Component: ambra Version: 0.9.3
Keywords: Cc:

Description

When attempting to view (on the Demo EC2 instance) the "Related Content" tab of the PLoS Biology article

 http://plosbiology.demo.live.0931/article/related/info%3Adoi%2F10.1371%2Fjournal.pbio.0020222

The following FTL exception was acquired:

2009-06-09 17:12:30,713 ERROR runtime(PLoSBiology)>  [TP-Processor101 freemarker.runtime]
Expression articleInfoX.authors?first is undefined on line 56, column 127 in journals/biology/article/article_related.ftl.
The problematic instruction:
----------
==> ${articleInfoX.authors?first?url} [on line 56, column 125 in journals/biology/article/article_related.ftl]
 in include "${templateFile}" [on line 31, column 1 in templates/main_template.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression articleInfoX.authors?first is undefined on line 56, column 127 in journals/biology/article/article_related.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:208)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:208)

The stack trace is quite a bit longer, of course, but this should be sufficient. It looks like there are no "authors" in the "articleInfoX" object.

Change History

Changed 15 months ago by ssterling

  • version set to 0.9.3
  • milestone set to 0.9.3_rc2

Changed 15 months ago by josowski

Weird, I'll make the template work, but I wonder if the bug is that there are no authors

Changed 15 months ago by josowski

(In [7732]) When an article has no authors, the related articles page will fail. This adds a check to make sure there are more then 0 authors before trying to get the first element of the sequence.

References #1320

Changed 15 months ago by josowski

(In [7733]) Correcting typo commited in r7732

References #1320

Changed 15 months ago by josowski

  • owner changed from josowski to npeterson
  • status changed from new to verify
  • resolution set to fixed

Checked in changes to CVS repository as well. I have no way to test this locally as the article is not ingested on branch.

Changed 15 months ago by rcave

  • status changed from verify to closed

Verified fixed

Note: See TracTickets for help on using tickets.