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