Release 1.6.10

This minor NarraFirma release adds a few new features and fixes a few bugs.

Your win-win proposal(s)

I realized that NF did not give you an opportunity to write and record win-win proposals: things you want to say to potential project participants. So I added a section with some questions to help you do that. You will find it in the “Describe participant groups” page.

Slightly easier translation options

A user reported a bug, and while we were fixing it, we noticed that they had entered a translation language, entered some translated texts, then changed the name of the language. Because the translation facility in NF relies on a simple lookup function linked to a language name, they then had to re-enter all of their previously translated texts. That seemed like a pain. So I added functions to rename and remove language entries en masse.

On the “Translate story forms” page, you can find these new functions (“Rename language” and “Remove language”) in the list of things you can do next to the “Do it” button. Because these functions reach into and change dictionary entries across all of your translated story-form texts, I suggest that you export your translation dictionary before you use them, in case you make a mistake (or I did).

On the same page, I also changed the counts of translated texts shown below the “additional languages” box. Any translations that are not visible on the page because you renamed or removed a translation language in the “additional languages” box (without using the rename/remove functions) are now counted and marked as “hidden.”

Better error reporting for renamed or removed questions

The user who reported the bug also renamed a few questions, causing some rather cryptic errors to appear when their story form was being shown. I improved the clarity of the error messages.

I also added a flag to the question lists on the “Build story forms” page. The new flag (“NOT FOUND in project”) tells you that a question you have included in your story form no longer exists in the project (because you have renamed or removed it). You should remove these questions from your form (press the > arrow), because until you do, you will keep seeing errors in your console every time you use the form.

Now for the bug

This was a pretty big bug, but it only appears in a very specific situation. This user (the same one as above) created two choice questions.

  • One had numbers for answers: 1, 2, 3, etc
  • Another had number ranges for answers: 1-25, 26-50, etc

They used these questions in a form, associated it with a story collection, then added some translations to it. Then they tried to update the form connected to the story collection. NarraFirma spat out an error message and refused to update or display the form, stopping them from collecting any more stories.

After some investigation, we discovered (to our surprise) that the hash method we were using to verify the security of the transmitted data was slightly different whether it was PHP doing it (within the WordPress server) or Javascript doing it (in the browser client). More specifically, the JSONification method in the Javascript code sorted their data structure differently than the most recent versions of PHP sorted it. That was what caused the error message: sorted data structures (thus hashes) that didn’t match. We never saw it happen before because to see it you had to have two sets of entries that might or might not sort together (1, 1-25, 2, 26-50, 3) or separately (1, 2, 3, 1-25, 26-50).

So Paul changed the Javascript method to bring it into synch with the PHP method. It fixed our user’s bug, and we tested the change with some legacy projects, so we think it will not cause any problems for anyone.

NF is getting out of date

That bug happened because the NF code is pretty old and is getting out of synch with the rest of the web. We really ought to go over it with a fine-toothed comb to bring it up to date with respect to a lot of things that have changed since we first released it in 2015. We are probably not going to be able to do that unless we get more funding to work on it.

If you want NarraFirma to continue to be a useful tool, please make a donation to support it. Without more donations, the best we can do is to fix each problem as our users find it. We intend to do that for as long as we can.

A few smaller bugs

We also discovered that:

  • There were a few places in our PHP code where there should have been return statements. It probably didn’t create any problems, but it’s better now.
  • The Node.js site admin page was confusing in a few places. We fixed it.
  • We improved another error message that appears when a question is missing.

In general we are always trying to make our error messages more clear, so you know what is going on. If NF ever does things you think it should not do, look at your browser console! There is usually something written there.

As always, if you find any bugs – or find anything in NF confusing or hard to use – please tell me on the GitHub issues page.