diff options
| -rw-r--r-- | phpBB/phpbb/notification/type/bookmark.php | 12 | ||||
| -rw-r--r-- | phpBB/phpbb/notification/type/post.php | 19 | 
2 files changed, 20 insertions, 11 deletions
diff --git a/phpBB/phpbb/notification/type/bookmark.php b/phpBB/phpbb/notification/type/bookmark.php index 003998677d..c981695f74 100644 --- a/phpBB/phpbb/notification/type/bookmark.php +++ b/phpBB/phpbb/notification/type/bookmark.php @@ -110,10 +110,14 @@ class bookmark extends \phpbb\notification\type\post  			unset($notify_users[$row['user_id']]);  			$notification = $this->notification_manager->get_item_type_class($this->get_type(), $row); -			$sql = 'UPDATE ' . $this->notifications_table . ' -				SET ' . $this->db->sql_build_array('UPDATE', $notification->add_responders($post)) . ' -				WHERE notification_id = ' . $row['notification_id']; -			$this->db->sql_query($sql); +			$update_responders = $notification->add_responders($post); +			if (!empty($update_responders)) +			{ +				$sql = 'UPDATE ' . $this->notifications_table . ' +					SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . ' +					WHERE notification_id = ' . $row['notification_id']; +				$this->db->sql_query($sql); +			}  		}  		$this->db->sql_freeresult($result); diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 7d4bc06879..987651887f 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -152,10 +152,14 @@ class post extends \phpbb\notification\type\base  			unset($notify_users[$row['user_id']]);  			$notification = $this->notification_manager->get_item_type_class($this->get_type(), $row); -			$sql = 'UPDATE ' . $this->notifications_table . ' -				SET ' . $this->db->sql_build_array('UPDATE', $notification->add_responders($post)) . ' -				WHERE notification_id = ' . $row['notification_id']; -			$this->db->sql_query($sql); +			$update_responders = $notification->add_responders($post); +			if (!empty($update_responders)) +			{ +				$sql = 'UPDATE ' . $this->notifications_table . ' +					SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . ' +					WHERE notification_id = ' . $row['notification_id']; +				$this->db->sql_query($sql); +			}  		}  		$this->db->sql_freeresult($result); @@ -392,7 +396,7 @@ class post extends \phpbb\notification\type\base  		// Do not add them as a responder if they were the original poster that created the notification  		if ($this->get_data('poster_id') == $post['poster_id'])  		{ -			return array('notification_data' => serialize($this->get_data(false))); +			return array();  		}  		$responders = $this->get_data('responders'); @@ -404,7 +408,7 @@ class post extends \phpbb\notification\type\base  			// Do not add them as a responder multiple times  			if ($responder['poster_id'] == $post['poster_id'])  			{ -				return array('notification_data' => serialize($this->get_data(false))); +				return array();  			}  		} @@ -415,6 +419,7 @@ class post extends \phpbb\notification\type\base  		$this->set_data('responders', $responders); -		return array('notification_data' => serialize($this->get_data(false))); +		$serialized_data = serialize($this->get_data(false)); +		return array('notification_data' => $serialized_data);  	}  }  | 
