Page MenuHomePhabricator

Non-configured selection steps should be ignored
Closed, ResolvedPublic

Description

The Web2Cit translation server is throwing an error if asked to use a translation procedure that includes a selection step that has not been configured.

For example, the following two translation requests fail because (at the time of writing this) the translation procedures to be used include a Citoid selection step with no configuration value:

These selections steps should be ignored, just like they are ignored when they are misconfigured (i.e., using an invalid configuration.

Until this bug is fixed, please ensure a configuration value is provided for all configuration steps. For example, title for a Citoid selection step used in the "Title" field, or authorLast for a Citoid selection step used in the "Author last names" field.

Event Timeline

diegodlh created this task.

When fixed, clarify what happened in the recording of our first workshop: https://www.youtube.com/watch?v=wlf3On0YgcI

The Web2Cit translation server is throwing an error

Error was "internal server error". But note that with supporting translation tests, we started supporting multiple translation targets and, consequently, individual target translation errors should no longer cause a complete internal server error.

For example, the following two translation requests fail because (at the time of writing this) the translation procedures to be used include a Citoid selection step with no configuration value:

Also note that when this task was created the JSON editor had a free-text field to configure Citoid selection steps. Now, it has a dropdown menu instead. Therefore, it would be unlikely, using the JSON editor, that a Citoid selection step remains unconfigured.

What happens with the other selection steps?

  • XPath: Template fails with a "Set selection config value before attempting selection" error, and translation stops for that one target (same error returned when Citoid selection is omitted).
  • Fixed: an empty configuration value is valid (means an empty string output). Hence, this shouldn't be a problem (unless used in the title field; see T311519).

What happens with transformation steps?

  • Join: an empty-string configuration is valid and means "join with empty-string separator".
  • Split: an empty-string config is valid and means "split everywhere".
  • Range: an empty configuration produces an empty output. This is probably unexpected (see T317444).
  • Date: an empty configuration is ignored as invalid. This is what should be happening with the others too!
  • Match: an empty configuration is taken as valid and produces an output of n+1 empty strings, where n is the length of the input. This is probably unexpected (T317445).

Also note that once this is solved, it will become one of the silently caught errors mentioned in T317441.

diegodlh renamed this task from Web2Cit translation server shouldn't fail on non-configured selection steps to Non-configured selection steps should be ignored.Sep 9 2022, 8:59 PM
diegodlh edited projects, added Web2Cit-Core; removed Web2Cit-Server.
diegodlh claimed this task.

Fixed in w2c-core's v2 branch: bdb7a5d2.