New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration issues due to bug? in Util.fillTemplate #1012

Closed
wuroger opened this Issue Feb 28, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@wuroger

wuroger commented Feb 28, 2018

I am trying to pull a query param value into a config line in my jbrowse.conf:

url = http://server.com/tracks?param={queryParams.param}

and I find looking around at the source a tiny bit here:

jbrowse/src/JBrowse/Util.js

Lines 118 to 134 in f742408

fillTemplate: function( template, fillWith ) {
return template.replace( /\{([\w\s\.]+)\}/g,
function( match, varname ) {
var fill = lang.getObject( varname, false, fillWith );
if((fill = fillWith[varname]) !== undefined ) {
if( typeof fill == 'function' )
return fill( varname );
else
return fill;
} else if( fillWith.callback ) {
var v = fillWith.callback.call( this, varname );
if( v !== undefined )
return v;
}
return match;
});
},

on line 121, fill does actually get set to the param that I am looking for, but then instead of returning, that anonymous function overwrites it and then ends up returning back the original {queryParams.param}.

Should fill be returned if it isn't undefined after line 121?

Thanks!

@rbuels

This comment has been minimized.

Collaborator

rbuels commented Feb 28, 2018

oh man you're right. fixing now, getting in just under the wire for 1.12.5

@rbuels rbuels added this to the 1.12.5 milestone Feb 28, 2018

@rbuels rbuels added the bug label Feb 28, 2018

rbuels added a commit that referenced this issue Feb 28, 2018

@wafflebot wafflebot bot added the in progress label Feb 28, 2018

@rbuels rbuels closed this in a32ac64 Feb 28, 2018

@wafflebot wafflebot bot removed the in progress label Feb 28, 2018

@wuroger

This comment has been minimized.

wuroger commented Feb 28, 2018

Thanks! I was a little hesitant since JS is not my forte but thought it was worth mentioning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment