search problem & boilerplate?

General questions about CMSimple
ustalo
Posts: 164
Joined: Mon Aug 16, 2010 7:42 am
Location: Russia
Contact:

search problem & boilerplate?

Post by ustalo » 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
Aleksei

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: search problem & boilerplate?

Post by cmb » Sat Mar 20, 2021 4:17 pm

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.
Christoph M. Becker – Plugins for CMSimple_XH

ustalo
Posts: 164
Joined: Mon Aug 16, 2010 7:42 am
Location: Russia
Contact:

Re: search problem & boilerplate?

Post by ustalo » Sun Mar 21, 2021 5:32 am

Ерч 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
Aleksei

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: search problem & boilerplate?

Post by lck » Sun Mar 21, 2021 1:29 pm

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++.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

ustalo
Posts: 164
Joined: Mon Aug 16, 2010 7:42 am
Location: Russia
Contact:

Re: search problem & boilerplate?

Post by ustalo » Sun Mar 21, 2021 4:51 pm

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
Aleksei

ustalo
Posts: 164
Joined: Mon Aug 16, 2010 7:42 am
Location: Russia
Contact:

Re: search problem & boilerplate?

Post by ustalo » Sun Mar 21, 2021 4:57 pm

on small site works
thx a lot
Aleksei

frase
Posts: 5085
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: search problem & boilerplate?

Post by frase » Sun Mar 21, 2021 5:50 pm

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.

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: search problem & boilerplate?

Post by lck » Mon Mar 22, 2021 8:07 pm

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.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: search problem & boilerplate?

Post by cmb » Mon Mar 22, 2021 10:22 pm

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.
Christoph M. Becker – Plugins for CMSimple_XH

olape
Posts: 2731
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: search problem & boilerplate?

Post by olape » Tue Mar 23, 2021 8:05 am

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?
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

Post Reply