Skip to content
  • Unable to override scripts

    Solved Plugin Development
    4
    0 Votes
    4 Posts
    405 Views
    magnusvhendinM

    @julian This worked great. I did this in my main client file (like persona.js).

    require(['hooks'], (hooks) => { hooks.on('filter:script.load', (data) => { const replaceMap = { register: { target: 'forum/register', with: 'replacement/register', }, }; const replace = replaceMap[data.tpl_url]; if (replace) { const index = data.scripts.indexOf(replace.target); if (index > -1) data.scripts[index] = replace.with; else data.scripts.push(replace.with); } return data; }); });

    Then I can just add my scripts that I want to replace to the replaceMap object.

  • 0 Votes
    7 Posts
    787 Views
    magnusvhendinM

    @baris This worked like a charm. Thank you!

  • NodeBB 2.0 Upgrade Issues

    Unsolved Technical Support
    17
    1 Votes
    17 Posts
    1k Views
    phenomlabP

    @baris @julian I've just found out that this problem goes much deeper. If you look at the general page in the ACP, all of the values are missing (but are there in the database). In addition, the email page does not allow any changes to be saved.

    Appears to be the same bug on page load

    586b69c7-bf48-4d73-a27b-177bfb90dcb5-image.png