Support

Akeeba Ticket System

#18379 Notify managers - allways notifying all managers

Posted in ‘Akeeba Ticket System for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Ticket System version
n/a

Latest post by nicholas on Tuesday, 03 December 2013 01:12 CST

blaztoma
 Hello!

I'm not really sure, but it seems like a bug in postemail plugin. It sends notification to all the managers although i have selected only one to receive notifications.
I had to change this code:
		// Nope! I have to notify a subset. Let's start removing them
		$t_managers = $managers;
		for($i = 0; $i < count($t_managers); $i++)
		{
			if(!in_array($t_managers[$i]->id, $notify))
			{
				unset($managers[$i]);
			}
		}

into this one:
		foreach($managers as $manager)
		{
			if(in_array($manager->id, $notify))
			{
				$xmanagers[]=$manager;
			}
		}

in file postemail.php to make it work as it should. At least it notifies only managers i have selected.

Is this some bug or did i miss something?

nicholas
Akeeba Staff
Manager
I honestly can't see how your code, as posted here, has the effect you claimed it has. The $xmanagers variable is not defined or use anywhere else. As a result, in the end of the method you return the unmodified $managers which contains all of the managers of the category.

In other words, your change is causing the bug you claim it's fixing.

I think you made more changes to that file, otherwise this just doesn't make sense?

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

blaztoma
Thanks for an answer!
I didn't want to provide the bug fix - just to say that unset part somewhat isn't working. I don't know why. Because of this, the plugin sends email to all the managers regardless of what i selected in "notify managers" box.
Regarding my solution - it's an empty array (xmanagers) which i populate with people in $notify list (the $notify list is correct). At the end i return $xmanagers (sorry forgot to copy that line).

nicholas
Akeeba Staff
Manager
Ah, OK, now I understand what you mean. I was looking at the code and saw the problem. It has to do with the way PHP handles array variables. My solution is essentially the same as yours, provided that I return the array where I added managers at the end. All right, we've arrived at the identical solution so yes, you are right, that's a bug and your fix is correct.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!