I tried to edit some of the core files in Joomla. Im using MVC override plugin:enter link description here
I want to override article.php and articles.php in components/com_content/models.
The override is done and is now working. My problem is that i get this error on my frontpage/homepage.
Fatal error: Cannot redeclare class ContentModelArticles in /Applications/MAMP/htdocs/site/components/com_content/models/articles.php on line 680
Thats the only place i get that error. In articles.php and other places, there are no sign of any similar errors. Can anyone pleas tell me what the solution would be?
Im not sure how to do the override. i just copied the articles.php and put it inside another folder in my templates file. so everything is the same except I added some more fields to my articles.php. It starts like this:
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
/**
* This models supports retrieving lists of articles.
*
* @since 1.6
*/
class ContentModelArticles extends JModelList
{
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JController
* @since 1.6
*/
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
Im not sure what to do. If I change the ContentModelsArticles to something else.
I tried to edit some of the core files in Joomla
>> why? If you want to override anything in Joomla's core, please develop a plugin to extend the class you'd like to override. Editing core file will cause potential problems for you and will be lost in future Joomla updates