Dieser Blog im Fediverse: @joomla_test_blog@ug-mayen.de

Error im RSS-Feed - Call to undefined method Joomla\CMS\Document\FeedDocument::addCustomTag()
Error im RSS-Feed - Call to undefined method Joomla\CMS\Document\FeedDocument::addCustomTag()

Error im RSS-Feed - Call to undefined method Joomla\CMS\Document\FeedDocument::addCustomTag()

Der #RSS-Feed in diesem #Joomla Test-Blog zeigte einen #Fehler.

Die Fehlermeldung lautete:

0
Call to undefined method Joomla\CMS\Document\FeedDocument::addCustomTag()

Lösung: Es war mein Fehler. Ich habe in einem System-Plugin die Funktion "addCustomTag" aufgerufen, ohne zu prüfen, wo der Aufruf erfolgt.
public function onAfterDispatch()
{
 $doc = $this->app->getDocument();
 $doc->addCustomTag('');
}
Nach dem Einfügen der if-Prüfung ist das Problem behoben.
public function onAfterDispatch()
{
 $doc = $this->app->getDocument();

if (!$this->app->isClient('site') || $doc->getType() !== 'html') {
  return;
 }

 $doc->addCustomTag('');
}
Webmentions
Syndication