Install J4
Install Kunena 6.0 alpha 2
Setup Kunena
Go to frontend - forum - help
No error
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
Labels |
Added:
?
|
Labels |
Added:
J4 Issue
|
Status | New | ⇒ | Discussion |
I Load it by:
$cache = Factory::getCache('com_kunena', 'callback');
$cache->setLifeTime(180);
return $cache->call(array('KunenaHtmlParser', 'parseBBCode'), $body);
Yeah, that's the deprecated bit. Change it to $cache->get(array('KunenaHtmlParser', 'parseBBCode'), $body)
.
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
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.
Ok thnx.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-04-23 15:48:53 |
Closed_By | ⇒ | 810 |
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 ofJoomla\CMS\Cache\Controller\CallbackController::get()
.