joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.73k stars 3.64k forks source link

[5.0beta] onContentBeforeDisplay only accepts String results. #41611

Closed HLeithner closed 1 year ago

HLeithner commented 1 year ago

@angieradtke reported

com_tags view tagged items 0, Event onContentBeforeDisplay only accepts String results.

() JROOT\libraries\src\Event\Result\ResultTypeStringAware.php:67 2 Joomla\CMS\Event\Content\BeforeDisplayEvent->typeCheckResult() JROOT\libraries\src\Event\Result\ResultAware.php:64 3 Joomla\CMS\Event\Content\BeforeDisplayEvent->addResult() JROOT\libraries\src\Plugin\CMSPlugin.php:297 4 Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin{closure}() JROOT\libraries\vendor\joomla\event\src\Dispatcher.php:454 5 Joomla\Event\Dispatcher->dispatch() JROOT\libraries\src\Application\EventAware.php:111 6 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT\components\com_tags\src\View\Tag\HtmlView.php:207 7 Joomla\Component\Tags\Site\View\Tag\HtmlView->display() JROOT\libraries\src\MVC\Controller\BaseController.php:697 8 Joomla\CMS\MVC\Controller\BaseController->display() JROOT\components\com_tags\src\Controller\DisplayController.php:68 9 Joomla\Component\Tags\Site\Controller\DisplayController->display() JROOT\libraries\src\MVC\Controller\BaseController.php:730 10 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT\libraries\src\Dispatcher\ComponentDispatcher.php:143 11 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT\libraries\src\Component\ComponentHelper.php:361 12 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT\libraries\src\Application\SiteApplication.php:218 13 Joomla\CMS\Application\SiteApplication->dispatch() JROOT\libraries\src\Application\SiteApplication.php:261 14 Joomla\CMS\Application\SiteApplication->doExecute() JROOT\libraries\src\Application\CMSApplication.php:306 15 Joomla\CMS\Application\CMSApplication->execute() JROOT\includes\app.php:58 16 require_once() JROOT\index.php:32

Fedik commented 1 year ago

I suspect one of legacy plugin do return false or return true for this event. That does not make sense for this event.

Fedik commented 1 year ago

This one https://github.com/joomla/joomla-cms/blob/d4aeb5553816a897b50197cf89d57d64c5ac193e/plugins/content/pagenavigation/src/Extension/PageNavigation.php#L46-L54

Should be just return; or return ''; I will do PR later

angieradtke commented 1 year ago

I disable plugins/content/vote and the issue is gone

Fedik commented 1 year ago

Please test https://github.com/joomla/joomla-cms/pull/41616