Page 1 of 2

search problem & boilerplate?

Posted: Sat Mar 20, 2021 2:36 pm
by ustalo
Search give mistake
A fatal error occurred. Enable debug mode for further information.
Could be a reason boilerplate?

http://sima.spb.ru
http://cms.sima.spb.ru

Here is OK
http://afon.sima.spb.ru

Re: search problem & boilerplate?

Posted: Sat Mar 20, 2021 4:17 pm
by cmb
ustalo wrote:
Sat Mar 20, 2021 2:36 pm
Search give mistake
A fatal error occurred. Enable debug mode for further information.
Could be a reason boilerplate?

http://sima.spb.ru
http://cms.sima.spb.ru

Here is OK
http://afon.sima.spb.ru
To find the reason, rename userfiles/downloads/XHdebug.txt to userfiles/downloads/_XHdebug.txt. Then log in as administrator, and use the search. That should print the cause of the error.

Re: search problem & boilerplate?

Posted: Sun Mar 21, 2021 5:32 am
by ustalo
Ерч for help/ I follow instruction & get

Uncaught TypeError: Argument 1 passed to li() must be of the type array, null given, called in /Users/sima/Sites/sima.spb.ru/cmsimple/functions.php(242) : eval()'d code on line 1 and defined in /Users/sima/Sites/sima.spb.ru/cmsimple/tplfuncs.php:188
Stack trace:
#0 /Users/sima/Sites/sima.spb.ru/cmsimple/functions.php(242) : eval()'d code(1): li(NULL, 'sitemaplevel')
#1 /Users/sima/Sites/sima.spb.ru/cmsimple/functions.php(242): eval()
#2 /Users/sima/Sites/sima.spb.ru/cmsimple/functions.php(202): XH_evaluateSinglePluginCall('li($hc, 'sitema...')
#3 /Users/sima/Sites/sima.spb.ru/cmsimple/classes/Search.php(134): evaluate_plugincall('

I am far from understand it. Would be happy to get help.

second site same error

Re: search problem & boilerplate?

Posted: Sun Mar 21, 2021 1:29 pm
by lck
ustalo wrote:
Sun Mar 21, 2021 5:32 am
Uncaught TypeError: Argument 1 passed to li() must be of the type array, null given, called in /Users/sima/Sites/sima.spb.ru/cmsimple/functions.php(242) : eval()'d code on line 1 and defined in /Users/sima/Sites/sima.spb.ru/cmsimple/tplfuncs.php:188
Stack trace:
#0 /Users/sima/Sites/sima.spb.ru/cmsimple/functions.php(242) : eval()'d code(1): li(NULL, 'sitemaplevel')
#1 /Users/sima/Sites/sima.spb.ru/cmsimple/functions.php(242): eval()
#2 /Users/sima/Sites/sima.spb.ru/cmsimple/functions.php(202): XH_evaluateSinglePluginCall('li($hc, 'sitema...')
#3 /Users/sima/Sites/sima.spb.ru/cmsimple/classes/Search.php(134): evaluate_plugincall('
I've had that problem before as well. You have somewhere in one of your pages this call of the sitemap.

Code: Select all

{{{li($hc,'sitemaplevel');}}}

Code: Select all

{{{li($hc, 'sitemaplevel');}}}
If you don't find it right away, you can also search for it in your content.htm with Notepad++.

Re: search problem & boilerplate?

Posted: Sun Mar 21, 2021 4:51 pm
by ustalo
yes, I have this code {{{li($hc, 'sitemaplevel');}}}
now I get such error on sites

Maximum execution time of 30 seconds exceeded in /Users/sima/Sites/cms.sima.spb.ru/plugins/foldergallery/classes/ThumbnailService.php on line 123

Re: search problem & boilerplate?

Posted: Sun Mar 21, 2021 4:57 pm
by ustalo
on small site works
thx a lot

Re: search problem & boilerplate?

Posted: Sun Mar 21, 2021 5:50 pm
by frase
ustalo wrote:
Sun Mar 21, 2021 4:51 pm
now I get such error on sites

Maximum execution time of 30 seconds exceeded in /Users/sima/Sites/cms.sima.spb.ru/plugins/foldergallery/classes/ThumbnailService.php on line 123
Foldergallery must create new thumbnails each time it is called for the first time or after a change.
If you get this error message, usually a reload of the page helps - the error is then gone.

Re: search problem & boilerplate?

Posted: Mon Mar 22, 2021 8:07 pm
by lck
ustalo wrote:
Sun Mar 21, 2021 4:51 pm
yes, I have this code {{{li($hc, 'sitemaplevel');}}}
You can replace this with the following code in a page. Strangely enough, this works.

Code: Select all

#cmsimple $output.=li($hc,'sitemaplevel');#
I don't know why

Code: Select all

{{{li($hc,'sitemaplevel');}}}
produces an error in the search. With me and yes also with you it occurs, even if the Onepage_XH plugin is not installed.

Re: search problem & boilerplate?

Posted: Mon Mar 22, 2021 10:22 pm
by cmb
Oh, wanted to reply to this yesterday, but totally forgot to. Sorry.
lck wrote:
Mon Mar 22, 2021 8:07 pm
You can replace this with the following code in a page. Strangely enough, this works.
Well, yeah, sort of. The point is that the search function evaluates all plugin calls on all pages, but no CMSimple scripting. The latter is excluded, because it can be too intrusive (it can just break almost anything). This is why CMSimple scripting doesn't throw the error. The plugin call throws the error, because the search is executed just before $hc is even set. I don't see a particular reason for this order, so it should be possible to swap these two code blocks.

However, in this particular case evaluating the plugin call during the search doesn't make sense, so probably better to change the plugin calls to CMSimple scripting, like lck explained above.

For developers only: This is one of the many reasons why global variables are bad: it is not possible to intercept when they are read, so either they have been properly initialized by that time, or not. Most unfortunately, much of the CMSimple_XH API consists of global variables. Sigh.

Re: search problem & boilerplate?

Posted: Tue Mar 23, 2021 8:05 am
by olape
We already had a solution for this.
So it could be controlled from a plugin whether it is included in the search.
https://cmsimpleforum.com/viewtopic.ph ... =30#p65625

Whether this would be feasible in this particular case?