v17development / flarum-support-feedback

The Flarum Support public repository to report bugs, feature requests and feedback
4 stars 0 forks source link

Knowledge base tags not shown when editing tags #15

Open hackerESQ opened 11 months ago

hackerESQ commented 11 months ago

When trying to edit the tags on an existing article, the KB tags are not shown. Looks like the .KnowledgeBaseTagSelector is not being injected into the modal div element.

Screenshot 2023-12-05 at 2 35 06 PM

When manually adding that class to the div, I see the appropriate tags.

Is this an easy fix?

hackerESQ commented 11 months ago

Tracked it down. Should be super easy to resolve. The "edit tags" button is using the TagDiscussionModal class. Rather it should be using the KnowledgeBadeTagModal class.

The relevant code for creating a new article correctly references the KnowledgeBadeTagModal class:

Screenshot 2023-12-05 at 3 02 09 PM

The KnowledgeBadeTagModal class extends the TagDiscussionModal class:

Screenshot 2023-12-05 at 3 00 14 PM

The edit article editor incorrectly uses the underlying TagDiscussionModal class. This should really be usingKnowledgeBadeTagModal:

Screenshot 2023-12-05 at 2 59 28 PM
hackerESQ commented 11 months ago

Anyone else having this issue can use this scriptmonkey script:

// ==UserScript==
// @name         Add modal class for knowledgebase
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://support.lumifylabs.com/knowledgebase/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=lumifylabs.com
// @grant        none
// ==/UserScript==

(function() {

    const $ = document.querySelector.bind(document);

    let int = setInterval(()=>{
        let modal = $('div.TagDiscussionModal:not(.KnowledgeBaseTagSelector)')

        if (modal) {
            console.log('found!')

            modal.classList.add("KnowledgeBaseTagSelector");

            //window.clearInterval(int);

        }
        console.log('still looking')
    }, 1500);

})();