Closed bobsilverberg closed 3 years ago
Upon further investigation, in the frontend, we already disallow creating a collection with no name, and we disallow updating a collection to set an empty name. The collections we are seeing with null
names seem to be ones that were created outside of the new frontend.
Therefore, this issue will only be about updating the code to handle collections with missing names. On the collection listing screen we should output something in place of the missing name, or it will look odd, and we won't have any text to linkify. I am suggesting we simply output "Blank Name".
@jvillalobos Are you fine with this or would you prefer we output a different string for the name of the collection when it is missing?
I'd suggest using something that looks less like the user entered it and stands out, like "(blank)" or "(no name)"
I've verified this issue on stage and I doesn't seem to reproduce anylonger.
In order to create a collection with a blank name, I've edited some of my collections in admin, where it's possible to save with the Name field left empty.
Then, I've accessed My Collections list on the frontend and I was able to open each individual collection without a defined name - they are marked in the list with (no name)
:
A collection example:
https://addons.allizom.org/en-US/firefox/collections/11686381/noname3/
API response for the collection where the null
name is visible:
https://addons.allizom.org/api/v4/accounts/account/11686381/collections/noname3/
"description": null,
"modified": "2021-01-13T10:37:03Z",
"name": null,
"slug": "noname3",
"public": true,
"default_locale": "en-US"
It is also possible to edit the collection details and add add-ons to it.
I'm marking this issue as verified fixed on stage.
This is a spin-off from https://github.com/mozilla/addons/issues/13920. It seems that, when a collection has a
null
for its name, it causes problems for the frontend. I believe this is the cause of the issue filed above, and I think we've also seen it before. The frontend code should be able to deal with a collection with anull
for its name, rather than fail entirely. We should probably also have code in place to prevent collections from having anull
for their names, which could perhaps be enforced on the server, but we'd probably also need frontend code to deal with that if we don't want users seeing errors from the API.I suggest we at least allow our code to work with collections with no/null names, but also try to disallow the creation/editing of collections which would result in a
null
name.