Content-Plugin-Event doesn't get executed

by Cowboy_Patrick   Last Updated August 07, 2019 16:10 PM

I have the following plugin written:

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.plugin.plugin' );

class plgContentModifyArticle extends JPlugin
{
    function plgContentModifyArticle ( &$subject, $params )
    {
        parent::__construct( $subject, $params );
    }

    function onBeforeContentSave( &$article, $isNew )
    {

        echo "Can you see this?";

        global $mainframe;
        $newText = '<b>Testtext</b>';
        $user =& JFactory::getUser(); // get the user

        $article->fulltext.=$newText;
        $article->introtext.=$newText;

        return true;
    }
}

With the following xml-file:

<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="3.1.0" group="content">
    <name>Modifyarticle</name>
    <version>1.0.0</version>
    <description>Modify your articles</description>
    <files>
       <filename plugin="modifyarticle">modifyarticle.php</filename>
    </files>

    <install>

    </install>
</extension>

I've made all of this based on the following tutorial: https://docs.joomla.org/J3.x:Creating_a_content_plugin

But unfortunately it doesn't add text the a new article. And I don't have any idea on how to debug this.



Related Questions


Make a checkbox group disappear

Updated March 21, 2017 23:10 PM


How to save Custom Fields in Core components

Updated March 19, 2016 08:04 AM