Jump to content


Issue information

  • #035772

  • Fixed

  • 3.2.3

  • 3.3.0 Beta 1

  • 0 - None Assigned


Issue Confirmations

  • Yes (0)No (0)
Photo

Topic notifications

Posted by Jason H on 08 February 2012 - 05:46 PM

Ok.. This.. Is one of those that I can't figure out how it's made it this far without being noticed.. User was getting notifications like this

labonte has just posted a new topic entitled "5" in forum "2".

Broken URL.. everything pretty much wrong in it other than the username. And, no, the topic wasn't titled "5" nor was the forum named "2".

The issue is that when posting moderation is enabled, and a post is approved, the forum notification is incorrect..

In moderate.php, we have this..

			   	 $_postClass->sendOutTrackedForumEmails( $r['forum_id'], $r['tid'], $r['title'], $this->registry->class_forums->allForums[ $r['forum_id'] ]['name'], $r['post'], $member['member_id'], $member['members_display_name'] );

Now.. Why all that is being sent.. i'm not sure, because, the function is

	public function sendOutTrackedForumEmails( $forum, $topic, $content )

So, past the forum ID, topic ID and title.. I don't know what the rest of that is doing.. I assume there's a reason, though..

Well, as you can see, it's strings that are sent.. In the function..

   	 if ( empty( $topic['tid'] ) )
		{
			return true;
		}

It should pretty much die there.. but.. $topic is not an array.. It's a string.. And.. $topic['tid'] has a value.. I'm guessing it's the first number in the $topic variable, but..

So, $topic and $forum are strings, so, when you get into the function, things like

																																  'FORUM'		=> $forum['name'],
																										   						   'TITLE'		 => $topic['title'],

Are not valid.. my solution on it, before the $topic['tid'] check, was to add

		if ( ! is_array($topic) )
		{
				$topic = $this->registry->getClass('topics')->getTopicById($topic);
				$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
		}

Which.. Converts the strings into a usable array, and seems to work.. I just can't figure out how this made it so far without being noticed. I SEEM to remember it at some point, so, there might already be a report on this. I think there's more to this than what I've found, but.. It seems to work with what I did.

changed status to: Confirmed - FAO Matt

changed status to: Fixed
changed fixed-in version to: 3.3.0 Beta 1

Good find. Fixed in a different way but fixed all the same.






1 user(s) are reading this issue

0 members, 1 guests, 0 anonymous users