J4 Issue ?
avatar 810
810
23 Apr 2019

Steps to reproduce the issue

Install J4
Install Kunena 6.0 alpha 2
Setup Kunena
Go to frontend - forum - help

Expected result

No error

Actual result

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Joomla\CMS\Cache\Cache' does not have a method 'call' in C:\wamp\www\j4\libraries\src\Cache\CacheController.php on line 74

System information (as much as possible)

Additional comments

avatar 810 810 - open - 23 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 23 Apr 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Apr 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 23 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Apr 2019
Status New Discussion
avatar mbabker
mbabker - comment - 23 Apr 2019

Please provide a stack trace and some more info (i.e. what's actually calling the cache API in Kunena), there isn't a Joomla\CMS\Cache\Cache::call() method in 3.9 or 4.0.

You might be trying to use the deprecated Joomla\CMS\Cache\Controller\CallbackController::call(), which is removed in 4.0 in favor of Joomla\CMS\Cache\Controller\CallbackController::get().

avatar 810
810 - comment - 23 Apr 2019

I Load it by:

$cache = Factory::getCache('com_kunena', 'callback');
$cache->setLifeTime(180);

return $cache->call(array('KunenaHtmlParser', 'parseBBCode'), $body);
avatar mbabker
mbabker - comment - 23 Apr 2019

Yeah, that's the deprecated bit. Change it to $cache->get(array('KunenaHtmlParser', 'parseBBCode'), $body).

avatar 810
810 - comment - 23 Apr 2019

Too few arguments to function KunenaHtmlParser::parseBBCode(), 0 passed and at least 1 expected

Call stack
--
# | Function | Location
1 | () | C:\Users\Jelle\Documents\gitkraken\Kunena-Forum\src\libraries\kunena\html\parser.php:171
2 | KunenaHtmlParser::parseBBCode() |  
3 | call_user_func_array() | JROOT\libraries\src\Cache\Controller\CallbackController.php:124
4 | Joomla\CMS\Cache\Controller\CallbackController->get() | C:\Users\Jelle\Documents\gitkraken\Kunena-Forum\src\components\com_kunena\controller\application\misc\default\display.php:189
5 | ComponentKunenaControllerApplicationMiscDefaultDisplay->{closure}() | C:\Users\Jelle\Documents\gitkraken\Kunena-Forum\src\libraries\kunena\layout\base.php:513
6 | KunenaLayoutBase->__get() | C:\Users\Jelle\Documents\gitkraken\Kunena-Forum\src\components\com_kunena\template\crypsisb4\pages\misc\default\default.php:17
7 | include() | C:\Users\Jelle\Documents\gitkraken\Kunena-Forum\src\libraries\kunena\layout\base.php:167
8 | KunenaLayoutBase->render() | C:\Users\Jelle\Documents\gitkraken\Kunena-Forum\src\libraries\kunena\layout\layout.php:80
9 | KunenaLayout->render() | C:\Users\Jelle\Documents\gitkraken\Kunena-Forum\src\libraries\kunena\controller\application\display.php:116
10 | KunenaControllerApplicationDisplay->execute() | C:\Users\Jelle\Documents\gitkraken\Kunena-Forum\src\components\com_kunena\kunena.php:104
11 | require_once() | JROOT\libraries\src\Dispatcher\LegacyComponentDispatcher.php:69
12 | Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() | JROOT\libraries\src\Dispatcher\LegacyComponentDispatcher.php:71
13 | Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() | JROOT\libraries\src\Component\ComponentHelper.php:382
14 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT\libraries\src\Application\SiteApplication.php:211
15 | Joomla\CMS\Application\SiteApplication->dispatch() | JROOT\libraries\src\Application\SiteApplication.php:250
16 | Joomla\CMS\Application\SiteApplication->doExecute() | JROOT\libraries\src\Application\CMSApplication.php:241
17 | Joomla\CMS\Application\CMSApplication->execute() | JROOT\includes\app.php:63
18 | require_once() | JROOT\index.php:36

avatar mbabker
mbabker - comment - 23 Apr 2019

Oh, the second param has to be an array. So $cache->get(array('KunenaHtmlParser', 'parseBBCode'), array($body)). From the looks of things, $cache->call() was just a shortcut method that would turn all the arguments after the callback into an array for you.

avatar 810 810 - close - 23 Apr 2019
avatar 810
810 - comment - 23 Apr 2019

Ok thnx.

avatar 810 810 - change - 23 Apr 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-04-23 15:48:53
Closed_By 810

Add a Comment

Login with GitHub to post a comment