When a watched-word-link is in a user field, it is changed to the HTML link (and it looks terrible)

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.

Baseline:

image


Changed field to Te Whatu Ora:

It also changed the field itself:

image

Suggestion

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).

4 Likes

Hey @nathank – 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:


3 Likes

@nbianca recently improved the implementation per:

Are you running latest?

1 Like

I can replicate this second issue (version: af912b4b0e):

  • Add eg ‘Meta’ to /admin/customize/watched_words/action/link with a link of https://meta.discourse.org/
  • Create Custom User Field (editable)
  • Insert ‘Meta’ into a user’s Custom Field and save
  • Refresh page
  • ‘Meta’ has been replaced with ‘Mhttps://meta.discourse.org/’

4 Likes

Yes, running latest (updated after that merge). Seemed to be a new bug to me - maybe related to that code change?

1 Like

@flink91 any chances you can have a look at this one?

1 Like

I’ll have a look :+1:

1 Like

I can’t reproduce locally. I think this bug has been fixed by this PR which has been merged yesterday:

5 Likes

Are we good to close this? We have no repro, are you on latest @nathank and able to repro?

2 Likes

@nathank assuming this is fixed now, flag to reopen if still an issue.

1 Like

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 :ballot_box_with_check: 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).

1 Like

I just noticed watched words > links also work on custom fields.

e.g.
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.

3 Likes

Hi @MarcP
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?

Before reporting this, I ran a rebuild, so I am on: 2.9.0.beta13 (0cb6d8c8fc).

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.

1 Like

Yes, I am able to reproduce this issue.

Reproducing Steps:

  1. Visit AdminCustomizeWatched WordsLink
  2. Create a watched word link
  3. Visit AdminCustomizeUser Fields
  4. Create a custom field with field type: Text Field
  5. Navigate User ProfilePreferencesProfile
  6. Enter the watched word created in point 2.
  7. Save the preferences.
  8. Reload the page and you will find the watched word replaced with the URL specified in point 2.

here’s the screen recording:

3 Likes

Perfect.

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.

1 Like

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. :+1:

8 Likes

Just noticed, that this issue is still a thing.

1 Like