This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Pages: 1 - Last Post: 06-Oct-2017 19:16 Last Post By: AndreWolff Threads: [ Previous | Next ]
AndreWolff

Posts: 1,993
Registered: 12/14/07
Problem with keywords.length()
Posted: 06-Oct-2017 10:24
 
  Click to reply to this thread Reply
Line 198 of file slidePagePar.htt in the PhotoSwipe skin contains:
<ja:if test="<%= showKeywordsOnSlide && (keywords.length() > 0) %>"> + '${keywords}' +

I am pretty sure that this line did not give problems in jAlbum 13 and the first version of jAlbum 14, but with version 14.1.13 I get a crash:
Stack trace for jAlbum 14.1.13 using skin PhotoSwipe 1.6.4:
 
se.datadosen.util.ScriptException: bsh.TargetError: Sourced file: inline evaluation of: ``    File slideshowTemplate = new File(skinDirectory, "slidePagePar.htt");     if . . . '' : Method Invocation engine.processTemplateFile : at Line: 6 : in file: inline evaluation of: ``    File slideshowTemplate = new File(skinDirectory, "slidePagePar.htt");     if . . . '' : engine .processTemplateFile ( slideshowTemplate , new File ( outputDirectory , slidePage ) ) 
 
Target exception: se.datadosen.tags.ElementException: se.datadosen.tags.ElementException: bsh.EvalError: Sourced file: inline evaluation of: `` showKeywordsOnSlide && (keywords.length() > 0) ;'' : Attempt to resolve method: length() on undefined variable or class name: keywords : at Line: 1 : in file: inline evaluation of: `` showKeywordsOnSlide && (keywords.length() > 0) ;'' : keywords .length ( ) 
 in inline evaluation of: `` showKeywordsOnSlide && (keywords.length() > 0) ;'' at line number 1 (slidePagePar.htt:198) (slidePagePar.htt:63)
 in index.htt at line number 780
	at se.datadosen.jalbum.TemplateParser.eval(TemplateParser.java:891)
etc.
I know that recently something has been changed in version 14, see here.

Is it possible that my code has been broken by that change?
And if so, what do I have to add to get it working again?

The message disappears if I replace the line by:
<ja:if test="<%= showKeywordsOnSlide > 0) %>"> + '${keywords}' +
In Advanced/ Metadata / 'EXIF Image Desc'. is set and 'Includer photographic data in generated pages' is set.
RobM

Posts: 4,250
Registered: 08/04/06
Re: Problem with keywords.length()
Posted: 06-Oct-2017 12:42   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
There is no error on a Mac, you probably have made another change that has caused the error.
AndreWolff

Posts: 1,993
Registered: 12/14/07
Re: Problem with keywords.length()
Posted: 06-Oct-2017 12:51   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
There is no error on a Mac, you probably have made another change that has caused the error.
No, I did not make any change here, I am quite sure that something has been changed in jAlbum.

But there is an easy fix for this problem:
<ja:if exists="keywords"> 
    <ja:if test="<%= showKeywordsOnSlide && (keywords.length() > 0) %>"> + '${keywords}' +
    </ja:if>
 </ja:if>
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums