CCALI / a2jauthor

CALI A2JAuthor document automation authoring and viewing platform
https://www.a2jauthor.org
Other
4 stars 1 forks source link

Empty string named variable created when author forgets to put a variable in field #136

Closed JessicaFrank closed 2 years ago

JessicaFrank commented 6 years ago

Author creates a field then forgets to associate a variable with it.

A2J 4 ignored that field when creating the answer file.

A2J 6 creates a variable with the name (" ") and stores the user's input in it.

HotDocs freaks out with that empty string named variable, throws an error called "answer name missing" and causes the document to fail to assemble.

We need to remove the code that creates that blank string in A2J 6 AND do author outreach to ensure authors have assigned variables to all fields.

Posted a message to the list serves detailing the author fix to this problem and how they can easily look for variable fields with missing variables by running a full report.

tobiasnteireho commented 5 years ago

community issue. Brought up in LHI debugging call.

JessicaFrank commented 3 years ago

Happened again with a Kansas interview. Very hard to debug. We need to add an author warning that they've left off a variable or remove the code that adds that empty string. Not sure how we'd save no variable name variables then, but we need to brainstorm this.

tobiasnteireho commented 3 years ago

Maybe the variable name could be autogenerated and a warning presented in Author?

JessicaFrank commented 3 years ago

I like that idea. Maybe look first to field label for name. If that's blank too, at least name it "Unnamed variable 1" or something like that.

JessicaFrank commented 3 years ago

Here's what the answer file looks like when a2j inserts the blank string. It's the blank string in the name of the variable that HotDocs is choking on.

Atchison This is the answer file (zipped b/c Github doesn't allow xml uploads) [Example of blank string in answer file.zip](https://github.com/CCALI/a2jauthor/files/6975906/Example.of.blank.string.in.answer.file.zip) Step 3, Question 7 has var field with no variable [Juvenile Expungement (1).zip](https://github.com/CCALI/a2jauthor/files/6975911/Juvenile.Expungement.1.zip)
JessicaFrank commented 3 years ago

@AnubhavDhingra the fix of inserting "Unassigned Variable" + string of numbers/letters/dashes is too long. HotDocs has a 50 character maximum for their variable names, so the new variables still break HotDocs.

I didn't get this confirmed, but I assume special characters, like dashes, may be an issue for HotDocs.

Can we implement a shorter string of random characters + no special characters?

AnubhavDhingra commented 3 years ago

@AnubhavDhingra the fix of inserting "Unassigned Variable" + string of numbers/letters/dashes is too long. HotDocs has a 50 character maximum for their variable names, so the new variables still break HotDocs.

I didn't get this confirmed, but I assume special characters, like dashes, may be an issue for HotDocs.

Can we implement a shorter string of random characters + no special characters?

Can be done.

janebitovi commented 2 years ago

when the variable name is missing: image

I generate a name for the variable that's alphanumeric (no dashes or other special characters), remember what the generated name is, log a console warning with the field object itself for the author/easier discovery, and ensure the debug panel shows that the variable name was missing: image

TODO:

Post a message to the list serves detailing the author fix to this problem and how they can easily look for variable fields with missing variables by running a full report.

mikemitchel commented 2 years ago

@janebitovi maybe this should be a part of this ? https://github.com/CCALI/a2jauthor/issues/269

janebitovi commented 2 years ago

@mikemitchel in the bigger picture, down the line, sure. In the meantime, this small change prevents the HotDocs error and is already implemented locally