Simon-Initiative / oli-torus

Next Generation OLI Authoring and Delivery Platform
https://proton.oli.cmu.edu
MIT License
78 stars 35 forks source link

[BUG FIX] [MER-3422] Fix failure editing overview details when welcome title blank #4937

Closed andersweinstein closed 1 week ago

andersweinstein commented 1 week ago

Editing project details, e.g. title, from the Authoring Project Overview UI was failing in cases where the welcome title was blank, the usual default. In this case empty string gets sent in update message as value for welcome title, but code was not checking for this case and passing it to Poison.decode, which throws an error since empty string is not valid JSON. This change recodes to check for empty string before parsing, treating empty string as equivalent to nil to prevent rendering welcome title.