Page MenuHomePhabricator

Formatting error when sending data for the "multiple choice" annotations fields
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Open a window to Toolhunt and another to Flower (localhost:5555)
  • Login and select a task of type audiences, content_types, tasks, or subject_domains.
  • Submit data
  • Check Flower logs and you'll find the following result for make_put_request:
{  'code': '1000',   
   'message': 'Validation Failed',   
   'errors': [
   {
      'code': '3101', 
      'field': 'subject_domains', 
      'message': 'Enter a valid value conforming to the JSON Schema.'
   }
]}

What happens?:

This is happening because the data is being sent as a string. Toolhub expects an array of strings.

Unfortunately, Toolhunt expects a string, so this is going to require both front and back-end fixes.

The frontend fix should be as changing line 29 of UserContributionForm.vue to be simply value: fieldValue

I'm working on the backend fix.

Event Timeline

NicoleLBee changed the task status from Open to In Progress.Mar 6 2023, 8:53 AM
NicoleLBee claimed this task.
NicoleLBee moved this task from Backlog to In review on the Toolhunt board.

I was unable to build a custom schema and don't have time to figure it out right now, so I built a hacky workaround that converts the inputted string to a list when the field is one of the "multiple choice" types.

https://github.com/wikimedia/toolhunt/pull/48

No changes necessary on the front-end.

The latest changes to the backend main appear to have broken this. I'll try to figure out what's gone wrong.

NicoleLBee moved this task from In review to Done on the Toolhunt board.