Skip to content
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

Layer condition of getTokens() and getTokenNames() not accepting string #1204

Closed
Phergus opened this issue Jan 28, 2020 · 1 comment
Closed
Assignees
Labels
bug macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) tested This issue has been QA tested by someone other than the developer.

Comments

@Phergus
Copy link
Contributor

Phergus commented Jan 28, 2020

Describe the bug
Using a string for the value of the layer condition to getTokens() and getTokenNames() results in an Illegal Argument Exception.

To Reproduce
Steps to reproduce the behavior:

  1. Execute the following a macro:
    [h: conditions = json.set("{}", "visible", 1, "layer", "token")]
    [h: tokenList = getTokenNames(",", conditions)]
  2. Observe exception.
    java.lang.IllegalArgumentException: No enum constant net.rptools.maptool.model.Zone.Layer."TOKEN" error executing expression tokenList = getTokenNames(",", conditions).

Expected behavior
Passing a string with a single layer name should be supported per Wiki documentation.
http://www.lmwcs.com/rptools/wiki/getTokens

MapTool Info

  • Version: 1.5.12

Desktop (please complete the following information):

  • OS: Any

Additional context
Reported on Discord.

Workaround
Passing a JSON Array containing the layer(s) for the condition works as expected.

@Phergus Phergus added bug macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) labels Jan 28, 2020
Phergus added a commit that referenced this issue Jan 28, 2020
Fix for when layer argument to getTokenNames is not an array #1204
@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Feb 2, 2020
@Phergus
Copy link
Contributor Author

Phergus commented Feb 2, 2020

Tested and working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) tested This issue has been QA tested by someone other than the developer.
Projects
None yet
Development

No branches or pull requests

2 participants