First Joomla Plugin - Not working

Hi, all.

Using instructions found at

http://docs.joomla.org/Make_changes_to_an_article_automatically_using_a_plugin

I just created and installed my first plugin.  It installs (and uninstalls) fine, and I have activated
it, but it is not making the changes I intended.

It is supposed to force a "pending" status for any article submitted or edited by an "Author" user type, and to set specific values for the attribs field based upon the sectionid.  None of these changes are being made, but other fields that were edited manually are updated.

I added a "die()" in my plugin code, and it never fires.  It looks like the function is never being called.  I've tried moving the plugin from first in the list to last.  No change.

I'm running Joomla! Version 1.5.12, Legacy 1.0.  (Is this because of
Legacy mode?)

Can someone take a look at my plugin code and let me know what I'm
doing wrong?  Would really appreciate it!

Thanks,
Bruce

File pulsesave.xml:

<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" type="plugin" group="content">
	<name>Content - Pulse Save</name>
	<author>Bruce Springthorpe</author>
	<creationDate>October 2010</creationDate>
	<copyright>Copyright (C) 2010 Winding Creek Design. All rights reserved.</copyright>
	<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
	<authorEmail>bruce@windingcreekdesign.com</authorEmail>
	<authorUrl>www.windingcreekdesign.com</authorUrl>
	<version>1.0</version>
	<description>Saves articles with specific parameters.</description>
	<files>
		<filename plugin="pulsesave">pulsesave.php</filename>
	</files>
	<params/>
</install>


File pulsesave.php:

<?php
/**
 * @copyright   Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
 * @license             GNU/GPL, see LICENSE.php
 */
 
// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport( 'joomla.plugin.plugin' );
 
class plgContentModifyArticle extends JPlugin
{
 
	/**
	 * Constructor
	 *
	 * For php4 compatability we must not use the __constructor as a constructor for plugins
	 * because func_get_args ( void ) returns a copy of all passed arguments NOT references.
	 * This causes problems with cross-referencing necessary for the observer design pattern.
	 *
	 * @param object $subject The object to observe
	 * @param object $params  The object that holds the plugin parameters
	 * @since 1.5
	 */

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

	/**
	 * Example before save content method
	 *
	 * Method is called right before content is saved into the database.
	 * Article object is passed by reference, so any changes will be saved!
	 * NOTE:  Returning false will abort the save with an error.
	 *      You can set the error by calling $article->setError($message)
	 *
	 * @param       object          A JTableContent object
	 * @param       bool            If the content is just about to be created
	 * @return      bool            If false, abort the save
	 */
	function onBeforeContentSave( &$article, $isNew )
	{
		global $mainframe;
		$user =& JFactory::getUser(); 				// get the user
		
		die("Inside onBeforeContentSave." . '<br />Article ID=' . $article->id);
				
		if ($user->usertype == 'Author') { 			
			// If Author, make the article pending by setting publish to True and publish_up to
			//  14 days in the future.
			$article->state = 1;					// Set publish to True & publish_up to 
			$article->publish_up = strtotime(date('Y-m-d', time() + (14 * 24 * 60 * 60)));
		}
		
		// Set the article attributes according to the section.
		if ($article->sectionid == '10') {			// This is a pulse article
			$article->attribs = 
			  "show_title=1\n"
			. "link_titles=0\n"
			. "show_intro=1\n"
			. "show_section=1\n"
			. "link_section=0\n"
			. "show_category=1\n"
			. "link_category=0\n"
			. "show_vote=\n"
			. "show_author=0\n"
			. "show_create_date=\n"
			. "show_modify_date=\n"
			. "show_pdf_icon=0\n"
			. "show_print_icon=\n"
			. "show_email_icon=\n"
			. "language=\n"
			. "keyref=\n"
			. "readmore=";
		} else {
			if ($article->sectionid = '11') {		// This is a site content article
				$article->attribs = 
				  "show_title=0\n"
				. "link_titles=0\n"
				. "show_intro=\n"
				. "show_section=0\n"
				. "link_section=0\n"
				. "show_category=0\n"
				. "link_category=0\n"
				. "show_vote=\n"
				. "show_author=0\n"
				. "show_create_date=0\n"
				. "show_modify_date=0\n"
				. "show_pdf_icon=0\n"
				. "show_print_icon=\n"
				. "show_email_icon=\n"
				. "language=\n"
				. "keyref=\n"
				. "readmore=";
			}
		}
		return true;
	}
}
?>

Open in new window

springthorpeSoftwareAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

springthorpeSoftwareAuthor Commented:
Per Ian McLennon on the Google Joomla! 1.5 user group,  the problem was an incorrect Class name in the .php file.  Changing it to plgContentPulseSave fixed the problem!

Ian, if you're a member of Experts Exchange, you deserve the points!

Bruce

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Joomla

From novice to tech pro — start learning today.