Plugin not picking up events

More
7 years 10 months ago #82278 by Ian
Plugin not picking up events was created by Ian
Hi,

I have built a very basic plugin to respond to membership events but am unable to get the most basic functionality working. Is there something else required other than installing and enabling the plugin in order for events to be detected ?

Membership Pro version is 2.3.0, Joomla 3.5.1, PHP 5.4.31

Code is shown below.

many thanks.

<?php
/**
* @package DoofaMPro
* @version 1.0
* @author
* @copyright
*/
defined('_JEXEC') or die('Restricted access');

class plgOSMembershipDoofa extends JPlugin
{
protected $autoloadLanguage = true;

public function onMembershipActive($row)
{
$this->log('onMembershipActive for OSMembershipDoofa triggered');

return true;

}


public function onAfterStoreSubscription($row)
{

$this->log('onAfterStoreSubscription for OSMembershipDoofa triggered');

return true;

}


public function log($string)
{
jimport('joomla.log.log');
JLog::addLogger(array('text_file' => 'iantestOSMembership.log'), JLog::ALL, array('IanTestOS'));
JLog::add($string, JLog::NOTICE, 'IanTestOS');
}


}

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82359 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Plugin not picking up events
The code looks good to me. I don't know why it didn't work. How did you test it? Did you try to subscribe for one plan from frontend of your site?

Maybe you can submit a support ticket sending us super admin account of your site so that we can check and solve the issue for you directly on your site

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82513 by Ian
Replied by Ian on topic Plugin not picking up events
I have tried both subscribing at the front end and manually adding a subscription as administrator.

Thank you, I will log a support ticket.

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82525 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Plugin not picking up events
You can also send me a copy of the plugin so that I can install and check it directly on my local computer if that's easier

Tuan

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82538 by Ian
Replied by Ian on topic Plugin not picking up events
That would be a good place to start, thanks.
Attached is the plugin.
regards,
Ian
Attachments:

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82545 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Plugin not picking up events
Hi Ian

Quick look at the code, I see that the name of the class is wrong. As your plugin name is DoofaMPro, the name of the plugin called need to be plgOSMembershipDoofaMPro

Could you change name of the class and check it again?

Regards,

Tuan
The following user(s) said Thank You: Ian

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82578 by Ian
Replied by Ian on topic Plugin not picking up events
Many Thanks Tuan, quite right. I should have spotted that. Yes, it works fine with the correct class name.
Regards,
Ian

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #82735 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Plugin not picking up events
Great. Thanks for confirming Ian

Please Log in or Create an account to join the conversation.