Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexandreelise/3b61edcddd13d8944d7093c1bfe4d62a to your computer and use it in GitHub Desktop.
Save alexandreelise/3b61edcddd13d8944d7093c1bfe4d62a to your computer and use it in GitHub Desktop.
Quick fix on line 29 to prevent error from happening when using this plugin with Joomla! 4.x Webservices Api. Fix made for one of my Super Joomler friends: Custom King.
<?php
/**
* @package Articles Field
* @version 3.9.0
*
* @author Peter van Westen <info@regularlabs.com>
* @link http://regularlabs.com
* @copyright Copyright © 2022 Regular Labs All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\Router\Route as JRoute;
use Joomla\Component\Content\Site\Helper\RouteHelper as JContentHelperRoute;
/*
* @var array $displayData
* @var object $article
* @var object $settings
*/
extract($displayData);
$title = htmlentities($article->title);
if ($settings->link_title)
{
$slug = $article->alias ? ($article->id . ':' . $article->alias) : $article->id;
$link = JRoute::link('site', JContentHelperRoute::getArticleRoute($slug, $article->catid, $article->language));
$title = '<a href="' . $link . '">' . $title . '</a>';
}
echo $title;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment