Non riesco a far funzionare il tagging automatico

I have added several words under the auto tagging area of watched words.

However creating a new topic and having any of these words in the title or body of the post doesn’t seem to set any auto tags. I assume I must be doing something wrong, but no clue as to what.

Is this not how the feature works?

2 Mi Piace

Does anyone else have this working?

1 Mi Piace

Same, it’s not working for me either (the ‘test’ works but not in actual topic creation).

I wanted to check to see if it wors for the title as well as the post and whether it appends the tags to the tag field on typing i.e before the user clicks on submit. This would allow them to remove a tag if they don’t think it is suitable.

1 Mi Piace

Well for a feature they just rolled out you’d think it would be working. :smiley:

I just did a quick test of this on my local development site. When I add an auto-tag watched word, the test works for me, but so far I haven’t been able to get it to auto tag a topic when a post contains one of the watched words. I’ll look into this some more.

Edit: I did a quick test of this on a hosted Discourse site and am running into similar issues to what I’m seeing on my development site. Testing this on my dev site, what I’m finding is that the auto_tag method isn’t being called when I create a new topic that contains an auto-tag word. If I edit an existing topic to add an auto-tag word, the auto_tag method is called and the topic gets tagged.

I’ll move this topic to the bug category.

6 Mi Piace

I did just note that on an embedded topic import from a remote site the auto-tagging did work. I thought maybe it had been patched, but tried it on a normal new topic creation and no joy. So it’s working partially anyway.

1 Mi Piace

I came here with the same issue (auto-tagging is not triggering when creating a new topic with watched words). But I also can’t get the tags to be added when editing an existing post.

I did a few changes to this feature a few weeks ago and I am expecting these issues to be fixed. Are you still having trouble with it?

3 Mi Piace

Thx. I need to upgrade. I’ll test later today.

1 Mi Piace

Having tried again it still seems broken to me.

  • Regex “PSYC611” does not match this text in a new topic
  • Neither does the regex “psy(c?)6\d{2,3}” (which is what I would like to use
  • The “test” popup doesn’t match any tags, no matter what the input

Interestingly, when I look in the console, typing any text into the ‘test’ box on this page gives this error:

[Error] SyntaxError: Invalid regular expression: nothing to repeat
	RegExp (admin-355470031debabd8f424394656ad96526be89c17169165b65dc4fc52262cabf7.js:1:255499)
	matches (admin-355470031debabd8f424394656ad96526be89c17169165b65dc4fc52262cabf7.js:1:255499)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:201058)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:114334)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:113340)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:415053)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:407829)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:421290)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:458048)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:462227)
	De (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:187812)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:146212)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:146530)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:147093)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:488589)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:487600)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:489624)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:494999)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:491569)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:495515)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:311475)
	dispatch (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:42931)

Ho implementato alcune altre correzioni che, secondo me, risolveranno i tuoi ultimi problemi. Puoi aggiornare e ricontrollare?

Sono su 2.7.0.beta9. Ho provato git pull e non ci sono modifiche…

Oh, non è ancora in beta perché ho appena inviato le modifiche. Puoi provarlo se aggiorni alla versione tests-passed.

1 Mi Piace

Ah, scusa… Dovremo aspettare per testare, poiché al momento non disponiamo di un ambiente di staging.

Alla fine ho visto che i test erano passati, ma per qualche motivo ci è voluto un po’ prima che diventasse visibile nell’aggiornamento. Comunque, non sono su 2.8.0.beta1 db7038e6c2 e ho eseguito nuovamente i test. Ho ancora problemi con il JavaScript. Questi sono i tag che sto usando:

(L’interfaccia utente sarebbe molto migliore come elenco: questa griglia diventa ingestibile quando si usano molti tag)

Questo è l’aspetto della casella di test:

E questo è l’errore nella console JavaScript:

Screenshot 2021-05-20 at 09.23.16

Il browser è Safari Version 14.0 (15610.1.28.1.9, 15610).

1 Mi Piace

Capisco ora. C’è un errore nella tua prima espressione regolare. Hai scritto “\d+{1,3}”, che non è valido. Volevi dire “\d{1,3}”?

4 Mi Piace

Ah, scusa. Grazie per averlo notato. Ora funziona perfettamente.

Mi chiedo se sia utile intercettare gli errori e avvisare l’utente, soprattutto perché le persone non tecniche potrebbero scrivere per sbaglio stringhe che non sono espressioni regolari valide? Sarebbe anche ottimo se un errore in una regex non si propagasse alle altre. In questo caso, alcune delle regex successive avevano corrispondenze valide che non sono state individuate a causa dell’errore nella prima.

2 Mi Piace

C’è qualcosa che possiamo fare qui per avvisare gli utenti quando si stanno facendo del male con le espressioni regolari, @sam? Possiamo mettere le regex dietro una modalità avanzata? Possiamo impostare come predefinito i confini di parola, che è comunque ciò che la maggior parte delle persone desidera quando inserisce una parola?

2 Mi Piace

Sembra che funzioni anche per i miei elementi con due punti o barra (cioè: 1:35, 1/35)

Grazie!

1 Mi Piace

Il mio consiglio sarebbe semplicemente di non aver bisogno delle espressioni regolari complete e di supportare abbastanza funzionalità già integrate in modo che solo 1 comunità su 10.000 debba sporcarsi le mani e utilizzare le espressioni regolari.

In questo esempio specifico di @ben, se supportassimo ?, allora:

PSY7?? → masters
PSY6?? → stage4
PSYC7?? → masters
PSYC6?? → stage4

Chiudo questa discussione perché sembra che la funzionalità stia funzionando. (sì, le regex sono più ricche, ma questo sembra sufficiente per catturare ciò che Ben sta cercando di fare)

3 Mi Piace