Problem with tags on new discourse instance?

My new discourse instance (currently on 38950840e0) has been up just a few days. When enabling tags today, I quickly ran into a bunch of issues.

When I make a new topic, I can add a tag and all works as expected. However, when I try to edit an existing topic to add a tag, or to create a new tag, nothing happens. I see the tag going out in the network request on a PUT, and then being logged in to the database I see nothing show up in the topic_tags or tags tables.

I also found that sometimes tags link to /tag/<tagname> and sometimes to /tags/<tagname>. The former works, the latter doesnā€™t.

I have a mostly default install with few plugins - just the multilingual plugin, which does touch the tags feature I suppose? I havenā€™t changed many settings in the admin, regarding tags Iā€™ve just checked Enable tags on topics? and nothing else.

The forum is online but itā€™s currently set to private, I can give an invite link if someone wants to take a lookā€¦

1 Like

The tag route was recently renamed from tags to tag. It seems likely that the issue is being caused by a plugin.

Can you try going to your siteā€™s error logs (found at Admin / Logs / Error Logs) and then tagging a topic? Possibly this will trigger an entry into the logs. If it does, or if you see any old log entries that refer to tags, have a look at what is displayed in the ā€˜infoā€™ and ā€˜backtraceā€™ tabs for the log entry.

The ā€˜backtraceā€™ tab might give us information about what is causing the issue. It will look something like this:

2 Likes

Thanks for the reply. Nothing in the logs. The only thing I can guess would be something from Multilingual Plugin šŸŒ is not updated to the recent changes yet?

In fact I really donā€™t need the whole plugin, only one part of it: disable the use of existing interface languages, but I donā€™t see another way to do that easily.

1 Like

For future reference in case anyone finds this useful, I pulled out the very short snippet needed from the multilingual plugin into a separate plugin and it works fine for my use case:

// assets/javascripts/discourse/initializers/custom-locale-initializer.js.es6

import { withPluginApi } from 'discourse/lib/plugin-api';
import { default as discourseComputed } from "discourse-common/utils/decorators";

export default {
  name: 'custom_locale',
  initialize(container) {
    const siteSettings = container.lookup("site-settings:main");

    if (!siteSettings.custom_locale_disable_others) return;
    
    withPluginApi('0.11.1', api => {
      api.modifyClass('controller:preferences/interface', {
        @discourseComputed()
        availableLocales() {
            return [
                { value: 'en', name: 'English' },
                { value: 'cust', name: 'My Custom Locale'},
            ]
        }
      });
    });
  }
}

Tags working again as expected, so I can confirm the problem is in the plugin. (Tried editing various references from /tags to /tag but was unsuccessful.)

2 Likes

Do you mean ā€œfrom /tags to /tagā€¦ā€? :slightly_smiling_face:

2 Likes