Handlebars helper conflicts

Issue #117 resolved
Michael Leahy created an issue

I’m the developer / maintainer of Forien’s Quest Log and a GM using Shadowrun 6 reported an issue with FQL, but it is an issue with the Shadowrun6 / game system. The problem is too generically named additional Handlebars helpers added in helper.ts. In particular the one that conflicts with FQL is description. Any variable used in a template that matches a helper will invoke the helper. It turns out that there is a description variable in the FQL templates. On review of the registered additional helpers my suggestion is to prepend all custom helpers with sr6_ or another small string to avoid conflicts not only with other modules potentially registering helpers, but situations where the helper names may conflict with variables with the same name in templates beyond the game system code. I verified the conflict by simply temporarily renaming the registered handler for description. Here is the offending helper registration: https://bitbucket.org/rpgframework-cloud/shadowrun6-eden/src/125393f471fead9a7d6a0a6f4fe7c737836c2c54/src/util/helper.ts#lines-107:115

Comments (4)

  1. Stefan Prelle
    • changed status to new

    I admit, I did not really gave name conflicts a thought when naming the handlebar helper. Yes, I can change that.

    (And by the way: I like your work fon FQL - great job(

  2. Michael Leahy reporter

    Awesome. No worries.. FQL registers one custom handler and back in the day it too caused conflicts with other modules. I did something similar prepending the custom helper name. I passed the news onto the fellow who inquired. I haven’t had a chance to use SR6, but it looks pretty good! Cheers.

  3. Stefan Prelle

    It took a lot longer than anticipated to release version 2.1.4, but the fix for this is now finally deployed.

  4. Log in to comment