@julian Yes. I saw it. Thanks !
alfazaz
Posts
-
Use response:router.page instead of filter:router.page (deprecated) -
TreeError on build@pitaj I made two issues on benchpressjs related to this topic if it helps :
Give template which gives TreeError · Issue #98 · benchpressjs/benchpressjs
Hello ! This issue is created after this nodebb community topic : https://community.nodebb.org/topic/15235 If we use bad {{{ if tutu }}} xxxxx {{{ end tutu }}} in a template, the build raises one or many Failed at parse::tree::tree, Tree...
GitHub (github.com)
Strange problem when going from old syntax to new syntax · Issue #99 · benchpressjs/benchpressjs
Hello ! This issue is created after this nodebb community topic : https://community.nodebb.org/topic/15235 I tried to convert all xxxxxx in my templates and I detected a strange thing you can reproduc...
GitHub (github.com)
-
Use response:router.page instead of filter:router.page (deprecated)@pitaj Thanks ! It worked (without next in fact).
-
TreeError on buildTwo things :
-
It could be great to have the filename of the template which raises the TreeError error (if possible). It could help debugging.
-
Found something that I don't know if it's desired... It seems that changing
<!-- IF toto --> xxxx <!-- ENDIF toto -->
to{{{ if toto }}} xxxx {{{ end }}}
doesn't work for example for functions like in the<!-- IF function.displayMenuItem, @index -->
in menu.tpl . It's a little strange or I understand things wrong ?
-
-
Use response:router.page instead of filter:router.page (deprecated)Hello !
I'm upgrading my plugins and I have a problem. I get this message in my nodebb 1.15.5 logs :
2021-01-01T17:32:47.395Z [5678/284882] - warn: [plugins/nodebb-plugin-forcelogin-YA] Hook "filter:router.page" is deprecated, please use "response:router.page" instead.
so I want to change the hook I use in my plugin. I changed in plugin.json filter to response but it gives error on running after this change. How must I change the following function called by this hook ?
plugin.YAfonction = function(req, res, next) { if (!req.uid && !req.originalUrl.startsWith(nconf.get('relative_path') + '/login') && !req.originalUrl.startsWith(nconf.get('relative_path') + '/api/login') && !req.originalUrl.startsWith(nconf.get('relative_path') + '/api/reset') && !req.originalUrl.startsWith(nconf.get('relative_path') + '/reset')) { helpers.notAllowed(req,res); } else { next(); } };
May be it's simple... But I'm not a great programmer...
Thanks in advance ! -
TreeError on build@pitaj {{{ end toto }}} never worked effectively.
In fact, I tried this because of warnings with the old <!-- ENDIF toto --> or <!-- END toto --> on build.
Now, I changed everything with {{{ end }}} ; this problem is solved (I have different problems to solve now ).
-
TreeError on build@pasib said in TreeError on build:
<!-- IF toto --> ... <!-- ENDIF toto -->
Should work here.
It's now an old thing which gives warnings (for me).
-
TreeError on buildWell it seems to come from things like
{{{ if toto }}} many things {{{ end toto }}}
I thought it was possible but the error messages disappears when using
{{{ if toto }}} many things {{{ end }}}
So it is not possible now to use the first version ? I found it greatest to have a clear code.
-
TreeError on buildHello !
I'm trying to upgrade my nodebb 1.14.3 to 1.15.5 (before going on 1.16.0)... but it doesn't work for now.
When I activate some of my plugins, I have bad build messages like this one :
Failed at parse::tree::tree, TreeError
I think it's related with changes in benchpressjs from @PitaJ but I don't know what kind of error(s) in my templates I must track to solve these problems. Do you have tricks to solve this ?
Happy new year to everybody (hope it will be greater than 2020...) !
-
1.15.0 Breaking Changes@baris Thanks, that was this ! This problem is solved now.
-
1.15.0 Breaking Changes@baris said in 1.15.0 Breaking Changes:
Slugify module was added in 1.15.0, utils.slugify is being removed in 1.16.0. Check if you have slugify.js in
public/src/modules
and post how you are requiring the module.Hello @baris,
I have slugify.js in public/src/modules .
I require module in my library.js of my plugin like you said :
const slugify = require('slugify'); console.log(slugify('string to slugify'));
and it gives :
2020-12-12T11:40:23.482Z [5678/68409] - error: Error: Cannot find module 'slugify' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18)
...
-
1.15.0 Breaking Changes@baris said in 1.15.0 Breaking Changes:
utils.slugify
deprecated in 1.15.0, will be removed in 1.16.0. Use theslugify
module that will be available in 1.15.0.Client side
require(['slugify'], function (slugify) { console.log(slugify('string to slugify')); });
Server side
const slugify = require('slugify'); console.log(slugify('string to slugify'));
Hello @baris !
I began to upgrade nodebb from 1.14 to 1.15 and, when I use these changes for slugify in my plugins, I get this error :
2020-12-11T14:23:34.787Z [5678/37554] - error: Error: Cannot find module 'slugify'
These changes for slugify are for nodebb 1.15 or nodebb 1.16 ? Or is it something else that I must do to make it works right ?
-
Get isSection and link of categories on 'account/categories'Hello !
Which is the simplest way to get 'isSection' and 'link' properties of categories to render 'account/categories' pages ? I need them for my account/categories.tpl template.
Thanks in advance for help !
-
Parse aboutme problemWell, I found a solution using utils.decodeHTMLEntities for chars between dollars tags of KaTeX, before the markdown conversion.
I hope it's not too much insecure...
-
Parse aboutme problemHello !
I added KaTeX (for mathematical formula) with a plugin to parse many things on my nodebb forum (posts content, topics title, shoutbox messages...). It runs, as necessary, before any markdown conversion (using action:markdown.updateParserRules to update parser to use MarkdownItTexmath).
I have a problem to implement this also for the "About me" part in profile. It is not parsed like posts etc.
I tried to use the "filter:parse.aboutme" hook but it's not working. Here is the reason : my parse function converts LaTeX formulas into an html specific code and it must do it before the markdown filter:parse.aboutme call. But, when this last one runs, it breaks all. For example,
<span>
is changed into</span>
...Is there a way to parse the aboutme content before markdown and without losing the html code ?
-
Way to parse topics titles@baris Yes. I see also that there is a problem for some other pages like /search ... I will see if I can get it work for all (I thought there were just one place/hook to parse title for all uses but it's not the case).
-
Way to parse topics titles@baris Finally, I used filter:topics.get because, with template.build hooks, it doesn't work on an "ajax" load (example : load of new topics in infinite scroll). (?)
I hope my filter:topics.get hook to parse topic titles doesn't lead to unforeseen things by me...
-
Way to parse topics titles@baris Ok. I will try as you say (I was thinking about filter:controllers.topic.get to unify things but there may be bad things with this idea).
Thanks !
-
Way to parse topics titlesHello !
I installed katex on my nodebb forum and it parses well my shoutbox messages (using filter:parse.raw hook) and posts contents (using action:markdown.updateParserRules and filter:composer.formatting hooks) to get mathematical formulas with a good display.
But, topics titles are not parsed (and also breadcrumbs). What could be the simplest way to parse these ? Which hook(s) do you recommend ?
Thanks in advance !
-
Table not well-arranged@PitaJ Same problem like @sharonyue ... There shouldn't be the part with a border at the right of the table. No?