Drupal plugin email links to Zanata produce errors
Description
Environment
None
Attachments
2
- 13 Sept 2017, 01:22 pm
- 13 Sept 2017, 01:21 pm
Activity
Show:
Former user 18 September 2017 at 00:23
> So, if the version doesn't exist, where are the docs being sent to?
They probably aren't being sent, since Zanata will probably have a 404 (or 500) error. We should also make sure the REST API gives the best possible error in this case, and that the Drupal plugin displays it. I'll add that to the description.
Carlos Munoz 15 September 2017 at 16:32
So, if the version doesn't exist, where are the docs being sent to?
Details
Details
Assignee
Former user
Former user(Deactivated)Reporter
Carlos Munoz
Carlos MunozTested Version/s
None
Components
Priority

More fields
Time tracking
More fields
Time trackingCreated 13 September 2017 at 13:17
Updated 4 October 2017 at 23:40
When clinking on email links from the zanata drupal plugin the user is being redirected to an error page (See attachments).
Example links:
https://<zanata instance>/webtrans/translate?iteration=<iteration>&project=<project>&locale=en&localeId=ja
Cause
The version configured in Drupal does not exist in Zanata.
Workaround
Create the version in Zanata or change the configuration in Drupal to match an existing version
Fix
Update Zanata to provide a specific error message when the version does not exist. This should be a 404 page with a message along the lines of "You tried to open Project: Foo version: bar, but Foo has no version bar."
Useful additions:
Link to versions page for the project
Show up to 10 versions with the most similar names ("did you mean to open one of these?"
Note that this will not prevent someone configuring a non-existent version, or deleting a version that is currently set in the configuration. It will make it possible for users to tell what has gone wrong and communicate that up to the person responsible for versions in Zanata or for config in Drupal.
We should also audit the REST API endpoints used by the Drupal plugin here and ensure that:
They correctly return a 404 status when the version does not exist.
The error message in the 404 response is specific: clearly indicates that the project exists but there is no version with that name.
The error message is displayed in Drupal when the user attempts to submit translations.
Even better if we can also check when the config is updated and display a warning if the project/version is not present or the Zanata server cannot be reached.
Technical note: probably at ActivateWorkspaceHandler.java:128, thanks @Sean Flanigan)