Cachy is incompatible with the search plugin

Post Reply
rahuldottech
Ssr. Bludit
Posts: 27
Joined: Fri Sep 22, 2017 8:13 pm

Sat Jan 05, 2019 5:51 am

When on PHP7, with the latest version of bludit, if I enable both plugins, I get this error:

Code: Select all

[05-Jan-2019 10:18:34 Asia/Kolkata] [INFO] [3.5] [/search/who] Plugin::webhook | Webhook requested.
[05-Jan-2019 10:18:34 Asia/Kolkata] [INFO] [3.5] [/search/who] Plugin::webhook | Webhook requested.
[05-Jan-2019 10:18:34 Asia/Kolkata] PHP Fatal error:  Uncaught Error: Call to a member function key() on boolean in /rahul.tech/bl-plugins/cachy/plugin.php:162
Stack trace:
#0 /rahul.tech/bl-kernel/helpers/theme.class.php(229): pluginCachy->beforeSiteLoad()
#1 /rahul.tech/bl-kernel/boot/site.php(17): Theme::plugins('beforeSiteLoad')
#2 /rahul.tech/index.php(41): require('/home/rahulcom/...')
#3 {main}
  thrown in /rahul.tech/bl-plugins/cachy/plugin.php on line 162
Both plugins work perfectly independently.
User avatar
Edi
Site Admin
Posts: 1476
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sat Jan 05, 2019 9:51 pm

I presume this happens because the "page" (this means the key of the page) with the search results cannot be found in the database file pages.php.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
rahuldottech
Ssr. Bludit
Posts: 27
Joined: Fri Sep 22, 2017 8:13 pm

Sun Jan 06, 2019 5:27 am

Thanks for your response. Is there a solution to this? Any way to exclude pages from Cachy?
User avatar
Edi
Site Admin
Posts: 1476
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sun Jan 06, 2019 12:11 pm

I asked Diego to have a look at it.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
User avatar
diego
Site Admin
Posts: 688
Joined: Sat May 16, 2015 2:53 pm
Contact:

Mon Jan 07, 2019 2:34 pm

Try to add this line before the line 162 of the plugin Cachy.

Code: Select all

if ($GLOBALS['WHERE_AM_I'] !== 'page') { return false }
rahuldottech
Ssr. Bludit
Posts: 27
Joined: Fri Sep 22, 2017 8:13 pm

Mon Jan 07, 2019 4:51 pm

This worked! Thanks sooooo much!
Post Reply