Agent can create tags even if this should be prohibited

Infos:

  • Used Zammad version: 2.9
  • Used Zammad installation source: Centos Package
  • Operating system: Centos 7
  • Browser + version: many

Expected behavior:

  • Tag Creation is prohibited in the settings, so it should not be possible to create own tags during ticket creation

Actual behavior:

  • every now and then I find new tags in the taglist (often containing little typos). They have to be created by the agents during ticket creation even though its prohibited in the settings. Unfortunately, I couldn’t find a reliable workflow to reproduce this issue it seems to happen in an occasional manner.

Steps to reproduce the behavior:

  • If I’d only know…

Sorry, I can’t reproduce this on 2.9 and current 3.0.

Please provide exact browsers (and versions) or even better a screencast showing the issue.
Please note that you have admins or agents having access to the tag menu on admin-settings, they can manually add new tags which can contain errors.

I didn’t stand a change on ticket update or creation.

Hi MrGeneration

I know, i’ve also not been able to reproduce this issue by myself.
I’ve talked back to one agent who has created a tag recently… He uses Firefox 67.1 and he has definitely no admin rights nor access to the tag management screen. As he told me, he can remember that when he has created this ticket, the autocompletion didn’t work. So he has written the whole tag manually and ended up with the quite odd tag “Solidworks;Optionen”:


As far as I can see, the missing autocompletion happens if a ticket has been created and haven’t been touched for a certain amount of time.
But even when autocompletion has timed out I wasn’t able to reproduce the problem, so there have to be some other factors to match…
If it helps I can upload the logs from this day. I haven’t been able to find any information regarding the creation of this tag in the production log.

Best regards
Kay

Hey,

sorry, I’m afraid it might not help me.
I fired up Firefox, but no chance.

If you find out how to reproduce this, we’ll gladly check this.
At the curent moment, I can’t help you.

I am sorry.

Hi Marcel

No Problem. I knew it would be difficult to help with such a “unreproducible” issue. I’ve thought that there may be someone out there who has dealt with something similar…
I’ll do some further tests to find a way to reproduce it. I’ll get back when I know more.
If anyone else has an idea… feel free to let me know :slight_smile:

best regards
Kay

1 Like

I haven’t been able to reproduce the bug itself, but I have a suspicion what could be going on here. Whether or not an agent is able to create tags is governed by App.Config.get("tag_new") on the client:

App.Config.get("tag_new");
false

Circumventing this is currently as easy as running App.Config.set("tag_new", true); in the browser console - apparently tag creation is only prevented in the frontend, but not in the backend.

This leads me to believe that the JS code on the client side crashed or was otherwise prevented from working properly. I bet that App.Config also wasn’t initialized properly, and that App.Config.get("tag_new") wasn’t really false. There are several places in the code that explicitly check with is false:

zammad ~/app/assets/javascripts (develop) % ag --no-pager tag_new .
app/views/tag/index.jst.eco
11:         <input name="tag-new" type="checkbox" id="tag-new" <% if @C('tag_new'): %>checked<% end %>>

app/controllers/widget/tag.coffee
99:    return if source != 'macro' && App.Config.get('tag_new') is false && !@possibleTags[item]

app/controllers/tag.coffee
19:    currentNewTagSetting = @Config.get('tag_new') || true
30:    App.Setting.set('tag_new', value)

app/controllers/_ui_element/tag.coffee
22:        if App.Config.get('tag_new') is false && !possibleTags[e.attrs.value]

I’ve made a half-assed attempt to re-enact this on codepen.io (jsfiddle’s CoffeeScript unfortunately seems to be broken currently), and I think this confirms it: https://codepen.io/anon/pen/NZgqzK

The console output says:

undefined
is not false

So the code does in fact seem to interpret undefined as true, which may have caused this issue.

Hi alltogether

To be honest, I have not much clue about all the technical details from Martins post, but it has lead me to another approach to reproduce this issue. Finally I’ve been able to create a new tag on through the ticket creation screen.

Steps to reproduce:

  1. Open a new ticket, fill in some details but do not click on "save"
  2. Close the Zammad Browser Tab
  3. Login to Zammad on a new tab
  4. Go the the former opened ticket and fill in a new tag of your choice
  5. Safe the ticket

Pow, You should receive a new ticket with the brand new tag in the taglist

I simply love Zammad and this forum especially :wink:

Best regards
Kay

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.