Best practices for modifying tpl files then updating?

General Discussion
  • I may just be mentally challenged but I've not been able to successfully upgrade nodebb once. Every time I've had to back the directory up, redownload from git, reinstall everything and then modify all the tpl files I made changes in and then copy over the plugins.

    Even the little minor commits you guys do, typically I'll do:

    git stash
    git pull
    git pop
    npm install
    npm update

    Though I think it's worth mentioning that after I noticed this never worked for me, I even tried updating it without stashing. Just a straight up git pull, npm install, npm update and nodebb still wouldn't start for me.

    Every time I do the above, my install breaks and I have to re-download everything and start from scratch even though I modify like the header.tpl, footer.tpl and before there was the option for the social links I was editing those out.

    If I'm missing something obvious here if someone could point me in the right direction that'd be great.

  • I've modified both tpl's and core files and my process is different (probably due to not knowing proper way). Not that any of this might be of help to you, but maybe others and myself due to replies.

    1. Download the latest git build via website (Download Zip).
    2. Use WinMergeU to merge changes.
    3. Shutdown nodebb
    4. Upload the new files to nodebb directory.
    5. run npm update
    6. try running, get error about bcrypt, delete bcrypt directory
    7. run npm update again
    8. profit..

    I mainly develop on windows, using sublime text 2 and WinMergeU to merge. There might be a much easier way, if anyone can point it out to me much love.

  • Yeah I get the same error message as your number 6, except when I delete bcrypt and update it's just something else - rinse and repeat till I literally just delete node-modules and npm install.. lol

    Most of my development is done on Mac, but git stash/pop should merge properly and if it doesn't you can go into the file and see where the conflicts are.

  • Is there currently no way to tell a theme to use custom tpl files? That would probably solve this issue.

    I was wondering this myself before I dive into editing the templates.

  • Technically, there is no need to run npm update for packages other than nodebb-* packages. So all you really need to do is npm install.

    However, you'd want to update the nodebb plugins/themes, so:

    cd /path/to/your/nodebb/install
    git pull
    npm install
    cd node_modules
    ls nodebb-* | xargs npm update   // I do not take responsibility for this command, if it burns your house down...
    cd ../
    ./nodebb start
    

    If you run into errors specified by #6, please do an npm rebuild to patch that right up.


Suggested Topics


  • 0 Votes
    1 Posts
    118 Views

    Hello.

    I am quite new to NodeBB. Is there a best practice or a proposed way to temporarily revoke a user's permission to post to the forum? Only allowing reading for a certain amount of time?

    I saw that a user can be banned (= from logging in) and I can also set a timer when the ban is being lifted automatically.

    Is it easier to edit the single user's permissions or is there a quicker way using groups - although thinking of the situation - after a certain time of hour/days - when the permission are given back and the user is allowed to post again.

    Thanks in advance! 🙂

  • 0 Votes
    3 Posts
    1k Views

    Actually, it was a backend issue 😁 we update the forum fairly often, but not always for smaller issues like this one.

    I'll try to update it again today

  • 0 Votes
    4 Posts
    2k Views

    Humm, you can't do that

  • Update, merge issue..

    General Discussion
    39
    1 Votes
    39 Posts
    13k Views

    @julian said:

    @tfraley Okay, run npm install first, before ./nodebb upgrade

    Thank you thank you thank you......

    Saved me hours of frustration lol

  • Update and Plugin System

    General Discussion
    4
    -1 Votes
    4 Posts
    2k Views

    Hi @Netto-Hikari, thanks for your feedback about our upgrade process 😄 We definitely try to make the upgrade process fluid and straightforward, but if files have been changed, then yes, there will be problems as git will not know how to handle changed files.

    Re:

    When it comes to upgrades, I just simply follow the docs and it always says that I have to commit the changes before.

    Did you mean Step 3? As far as I know, the only thing we ask admins to do before upgrading is back up their data. If you have never changed any of the core files, git should never complain.

    If this ever happens, and you are absolutely sure you didn't change anything, then you are advised to run the following:

    $ git fetch # to grab the latest code (but not apply it) $ git reset --hard origin/v0.5.x # force your local files to match the NodeBB repository *EXACTLY* $ ./nodebb upgrade # then proceed with upgrade as usual

    ^ Hooray, more unsolicited advice from strangers on the internet 😄

    After running those commands, future attempts to git pull should not have git complain.