When a user puts a watched word into a user field, strange things happen.
This is an example using the User Field
Employer(s), and having
Te Whatu Ora as a watched word link.
Changed field to
Te Whatu Ora:
It also changed the field itself:
That watched-words-links are modified so that they do not apply to user_fields.
Not sure about other watched words (didn’t test them).
@nathankershaw – I really enjoy your posts, you always give a good amount of details for what you find!
I see something similar when I do this as well. I put ‘cow goes boo’ as a watched-word-link and when I add it to a user field it shows the full link. However, mine is also showing the first letter of the watched word too. Are you seeing that also? I changed the link, removed and added it to the link list again and it still shows ‘c’ in front of the link:
July 31, 2022, 10:49pm
@nbianca recently improved the implementation per:
09:58AM - 21 Jul 22 UTC
The previous method for reused the PrettyText logic which applied the
… ord logic, but had the unwanted effect of cooking the text too.
This meant that regular text values were converted to HTML.
Follow up to commit 5a4c35f62714d2d72bc0ee57a10e08116bdc476a.
Are you running latest?
I can replicate this second issue (version:
Add eg ‘Meta’ to
/admin/customize/watched_words/action/link with a link of
Create Custom User Field (editable)
Insert ‘Meta’ into a user’s Custom Field and save
‘Meta’ has been replaced with ‘Mhttps://meta.discourse.org/’
Are you running latest?
Yes, running latest (updated after that merge). Seemed to be a new bug to me - maybe related to that code change?
August 2, 2022, 9:50pm
@flink91 any chances you can have a look at this one?
August 3, 2022, 3:49pm
I can’t reproduce locally. I think this bug has been fixed by this PR which has been merged yesterday:
10:37AM - 12 Jul 22 UTC
Currently, all Watched Words are matched case-insensitively. This presents a pro
… blem for matching words where the case must be considered e.g. Brand names.
This PR introduces support for a toggle/flag(`case_sensitive`) for Watched Words and updates the matching implementation. The `flag` defaults to `false` for new and existing Watched Words.
Summary of changes:
- [X] `WatchedWord` model/table updates to handle case-sensitivity via a `case_sensitive` column/attribute.
- [X] Updates to `Admin::WatchedwordsController` to allow the creation of case-sensitive Watched Words.
- [x] Updates to WordWatcher to handle case-sensitive matching
- [x] UI updates for toggle
<img width="1194" alt="Screenshot 2022-07-18 at 6 05 06 AM" src="https://user-images.githubusercontent.com/849886/179469861-888bbdca-d080-43eb-ad72-a032e33583c9.png">
August 10, 2022, 10:50pm
Are we good to close this? We have no repro, are you on latest
@nathankershaw and able to repro?
August 16, 2022, 9:49pm
@nathankershaw assuming this is fixed now, flag to reopen if still an issue.
Apologies Sam, has been a busy couple of weeks.
I’m afraid that the issue remains. To reproduce it you need the user field set to
Show on public profile?. I was able to do this on a nearly vanilla site as well as my busy / laden with plugins normal site.
It occurs regardless of the case-sensitivity setting, and for
Replace as well as
Link (and probably the others, but I didn’t test them).
November 28, 2022, 9:48am
I just noticed watched words > links also work on custom fields.
discourse = https://meta.discourse.com
Custom profile field X has value: discourse > it will show the link in the profile field.
I do not think this is expected behavior.
November 28, 2022, 11:20am
I am testing this on the latest discourse branch
test-passed but I am unable to reproduce the issue. Can you share which discourse version are you using?
November 28, 2022, 11:22am
Before reporting this, I ran a rebuild, so I am on: 2.9.0.beta13 (
I noticed this in a user custom field. Whenever I edit the field, and click save, it returns the URL value I specified for the word.
November 28, 2022, 11:33am
Yes, I am able to reproduce this issue.
Admin → Customize → Watched Words → Link
Create a watched word link
Admin → Customize → User Fields
Create a custom field with field type:
User Profile → Preferences → Profile
Enter the watched word created in point 2.
Save the preferences.
Reload the page and you will find the watched word replaced with the URL specified in point 2.
here’s the screen recording:
November 28, 2022, 11:40am
Also notice “Test Custom Field” should have the same header styling as “Web Site”, am I right? The same UI bug is visible on my instance.
I think this has been previously mentioned here When a watched-word-link is in a user field, it is changed to the HTML link (and it looks terrible) as well
@MarcP Nathan has confirmed this is the same issue and has merged your topics for easier tracking.
January 30, 2023, 8:39pm
Just noticed, that this issue is still a thing.