nathank
(Nathan Kershaw)
29 Luglio 2022, 10:01pm
1
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:
Changed field to Te Whatu Ora
:
It also changed the field itself:
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 Mi Piace
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 Mi Piace
sam
(Sam Saffron)
31 Luglio 2022, 10:49pm
3
@nbianca recently improved the implementation per:
discourse:main
← discourse:watched_words
opened 09:58AM - 21 Jul 22 UTC
The previous method for reused the PrettyText logic which applied the
watched w… 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?
1 Mi Piace
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 Mi Piace
nathank
(Nathan Kershaw)
2 Agosto 2022, 2:04pm
6
Sam Saffron:
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?
1 Mi Piace
zogstrip
(Régis Hanol)
2 Agosto 2022, 9:50pm
7
@loic any chances you can have a look at this one?
1 Mi Piace
loic
(Loïc Guitaut)
3 Agosto 2022, 3:49pm
10
I can’t reproduce locally. I think this bug has been fixed by this PR which has been merged yesterday:
discourse:main
← s3lase:feature/support-case-sensitive-watched-words
opened 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">
5 Mi Piace
sam
(Sam Saffron)
10 Agosto 2022, 10:50pm
14
Are we good to close this? We have no repro, are you on latest @nathank and able to repro?
2 Mi Piace
sam
(Sam Saffron)
16 Agosto 2022, 9:49pm
15
@nathank assuming this is fixed now, flag to reopen if still an issue.
1 Mi Piace
nathank
(Nathan Kershaw)
21 Agosto 2022, 5:54am
18
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).
1 Mi Piace
MarcP
(MarcP)
28 Novembre 2022, 9:48am
19
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 Mi Piace
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?
MarcP
(MarcP)
28 Novembre 2022, 11:22am
21
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 Mi Piace
Yes, I am able to reproduce this issue.
Reproducing Steps:
Visit Admin → Customize → Watched Words → Link
Create a watched word link
Visit Admin → Customize → User Fields
Create a custom field with field type: Text Field
Navigate 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:
3 Mi Piace
MarcP
(MarcP)
28 Novembre 2022, 11:40am
23
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 Mi Piace
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.
8 Mi Piace
MarcP
(MarcP)
30 Gennaio 2023, 8:39pm
33
Just noticed, that this issue is still a thing.
1 Mi Piace