MBS-7698: Release editor asks for confirmation to leave even if there are no changes (but the release has URL relationships)

Merged
#1054 · Created  · Last updated

Description

The problem is that when the original and new edit data for the URLs are diffed, the original data includes gids for the URLs and the new data doesn't.

The reason this happens is that the code to cache entities in root/static/scripts/common/entity.js handles URLs weirdly. It'll cache the URL under its gid if the data includes a gid, otherwise it uses the name. So you could end up with two cached instances for the same URL.

The main fix involves caching URL entities under both their names and gids. This is sufficient to fix the bug, but I also fixed the place in externalLinks.js where duplicate URL entities were originating from to begin with. The code there now just creates a new URL if the text actually changes (since despite the name of the urlChanged method, that's not the case in some instances, e.g. it's initially called just for the validation side effects, which should probably be separated out into a new function).

0 attachments

0 comments

Loading commits...