[SOLVED] Notification module: body property does not exist

leprechaun

Joined: 2012-05-02
Posts: 5
Posted: Wed, 2012-05-02 19:40

I'm trying to enable email notifications when users upload a picture to my site. Every time a notification email would be sent (e.g., the addition of a new item), I see the following in my log file:

2012-05-02 11:42:35 -07:00 --- error: @todo notification_event::batch_complete() failed
2012-05-02 11:42:35 -07:00 --- error: The body property does not exist in the Pending_notification_Model class
#0 /home/{my_user}/{my_site}/modules/notification/helpers/notification.php(177): ORM_Core->__get('body')
#1 /home/{my_user}/{my_site}/modules/notification/helpers/notification_event.php(95): notification::send_pending_notifications()
#2 /home/{my_user}/{my_site}/modules/gallery/helpers/module.php(400): notification_event_Core::batch_complete()
#3 /home/{my_user}/{my_site}/modules/gallery/helpers/batch.php(33): module_Core::event(Array, Array)
#4 /home/{my_user}/{my_site}/modules/gallery/controllers/uploader.php(116): batch_Core::stop('batch_complete')
#5 [internal function]: Uploader_Controller->finish()
#6 /home/{my_user}/{my_site}/system/core/Kohana.php(331): ReflectionMethod->invokeArgs()
#7 /home/{my_user}/{my_site}/system/core/Event.php(208): Kohana_Core::instance(Object(Uploader_Controller), Array)
#8 /home/{my_user}/{my_site}/application/Bootstrap.php(67): Event_Core::run(NULL)
#9 /home/{my_user}/{my_site}/index.php(102): require('/home/{my_user}...')
#10 {main}

So far I've tried running all the maintenance actions as the admin, and I've removed all the rows in the "pending_notifications" table. Neither solved the problem, although running the maintenance actions does cause the notification to be "sent" again (I say "sent" because it fails again).

Relevant version numbers/system info:
Gallery 3.0.3
PHP 5.2.17
Debian 5.0.9
Apache 2.2.17-1

Thanks for any information you can provide.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25938
Posted: Thu, 2012-05-03 03:02

Does email work on your server? Test with the 'forgot your password?' link when trying to login.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
leprechaun

Joined: 2012-05-02
Posts: 5
Posted: Thu, 2012-05-03 09:12

Apologies, that would certainly have been useful information. Yes, emails do work correctly on the server; I get an email when I use the "Forgot your password?" link.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25938
Posted: Sun, 2012-05-06 06:54

just tested this module and it works for me.
Does the pending_notifications table exist in your DB?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
leprechaun

Joined: 2012-05-02
Posts: 5
Posted: Sun, 2012-05-06 07:56

Yes. Here's the structure (copy/paste from phpMyAdmin, apologies for the formatting):

Quote:
Field Type Collation Attributes Null Default Extra
id int(9) No None AUTO_INCREMENT
locale char(10) utf8_general_ci Yes NULL
email varchar(128) utf8_general_ci No None
subject varchar(255) utf8_general_ci No None
text text utf8_general_ci Yes NULL

It currently has a single row (I moved the "text" column because of formatting issues with copy/paste):

Quote:
id locale email subject text
21 en_US {my email address} Photo "Chrysanthemum" added to "Amira" (see below)

<html>
<head>
<title>Photo "Chrysanthemum" added to "Amira" </title>
</head>
<body>
<h2>Photo "Chrysanthemum" added to "Amira"</h2>
<table>
<tr>
<td>Title:</td>
<td>Chrysanthemum</td>
</tr>
<tr>
<td>Url:</td>
<td>
<a href="http://{my site}/index.php/amira/Chrysanthemum">
http://{my site}/index.php/amira/Chrysanthemum </a>
</td>
</tr>
</table>
</body>
</html>

 
leprechaun

Joined: 2012-05-02
Posts: 5
Posted: Thu, 2012-05-10 21:50

Any ideas?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25938
Posted: Thu, 2012-05-10 22:21

just grasping at straws here....
edit /modules/notification/helpers/notification.php about line 177
->message($pending->body)
to
->message($pending->text)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
leprechaun

Joined: 2012-05-02
Posts: 5
Posted: Thu, 2012-05-10 22:36

An excellent grasp, sir! That worked. Thank you very much!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25938
Posted: Sun, 2012-05-13 22:28

Created ticket: https://sourceforge.net/apps/trac/gallery/ticket/1862

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25938
Posted: Wed, 2012-05-16 20:50