Categories text color is wrongly set to #FFF instead of #FFFFFF in import scripts, causing issues

AI-generated summary

A bug is reported where the save button for category settings remains greyed out unless the category color inputs are altered. The issue is traced back to the text color being set to #FFF instead of #FFFFFF during migrations from platforms like vBulletin and phpBB. This invalid value bypasses validation, causing the save button to remain inactive. The problem affects categories created by import scripts, and a proposed fix involves changing the color value from FFF to FFFFFF in the base import script. Canapin details the issue and provides a video demonstration, while JammyDodger identifies the validation problem. Canapin confirms the root cause and notes the issue persists across multiple migrated forums. Canapin suggests a specific code change to resolve the issue, and pfaffman links to a related GitHub pull request.

I edited the topic’s title to point out the exact issue, see the replies for details


When editing category settings, the save button is and stays greyed out.

Oddly, the button will magically be active again if we alter the category color inputs, either by changing the category color input, or by clicking the text color input, then the category color input.

The button is never not greyed out for categories that don’t have default permissions settings (everyone can read, post and create), or are pre-seeded categories.

I may have missed some subtleties about this bug, but this is what I experience.

Discourse version: 3.6.0.beta1-dev(0fa102b838)

Safe mode doesn’t fix the issue.

2 Likes

FWIW Looking at your first video the text colour is set as #FFF which I don’t think passes the validation for the field (it needs to be 6 characters or more):

Having that too short would grey out the save button.

2 Likes

Wow. This is the issue. The pre-seeded categories thing doesn’t exist, the text color was set to #FFFFFF in this one category.

If I set #FFFFFF as the text color category, then the problem vanishes.

/admin/logs/staff_action_logs shows that I never set the text colors to #FFF. It was the default value. It was a migration from vBulletin to Discourse, if it’s of some importance.

Perhaps the import script set the value to #FFF, avoiding the validation script and creating this bug (though I’m not sure at all import scripts set colors…). :person_shrugging:

1 Like

I think someone else tripped over this recently as well - Access to category after 10 posts (automatic group membership)

I think that was a migration too. I’m not sure if some magic could be added to autocorrect obvious ones as part of the category save?

2 Likes

I have the same issue on another migrated forums from phpBB as old as 2018 as less than a year.

It seems that in migrated forums, only the categories created by the scripts have their color set to #FFF. So I guess there’s an underlying issue to fix that affects any importer.

2 Likes

I think the issue can be fixed by changing this line:

By replacing FFF with FFFFFF.

1 Like

https://github.com/discourse/discourse/pull/34859

Darn. I should have waited until October 1st

2 Likes