Check_Reminders.php Email Error

Bug #760573 reported by Nick Phillips
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Eventum
Invalid
Low
Unassigned

Bug Description

Hi all,

I've just set up eventum notifications. I'm getting emails through correctly, so everything seems to be in order. However I'm also being notified about an error via email also.

Contents are as follows;

Hello,

An error was found on line '731' of script '/var/eventum_test/lib/eventum/class.reminder.php'.

The error message passed to us was:

'DB Error: syntax error'

A more detailed error message follows:

'SELECT
                    iss_id
                 FROM
                    eventum.eventum_issue
                  WHERE
                    iss_prj_id=9
 AND iss_sta_id = 15
 AND iss_closed_date IS iss_closed_date
 AND iss_trigger_reminders=1 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'iss_closed_date AND iss_trigger_reminders=1' at line 8]'

A backtrace is available:

APP_PATH/crons/check_reminders.php:84
  Reminder::getTriggeredIssues((array )Array, (array )Array)

--
Sincerely yours,
Automated Error_Handler Class

I've done a bit of googling and searched your forums but I've not seen this reported. Any thoughts?

Kind Regards,
Nick Phillips

Revision history for this message
Eric Loyd - Bitnetix (bitnetix) wrote :

Same problem for us, except the SQL is simpler and easier to spot. Here's a snippet:

SELECT
iss_id
FROM
issue
WHERE
iss_prj_id=2
AND iss_sta_id IS 10

The "AND iss_sta_id IS 10" is invalid SQL. It should be "AND iss_sta_id=10".

More specifically, the IS is wrong. It should be an equals sign.

Revision history for this message
Eric Loyd - Bitnetix (bitnetix) wrote :

In looking closer, I believe that it's because of poor selection criteria in the drop down for the action. Instead of using "is" use "equal to." This fixes the SQL statement.

The problem is, it's proper SQL to use IS NULL or IS NOT NULL, but it's not intuitive to someone who doens't know SQL as to why the EQUAL TO would be correct but IS would not be.

Perhaps better wording, with some sort of "IS [NOT] NULL" could be used instead of just "IS".

At any rate, Nick, change your selector to be EQUAL TO instead of IS and you should be all set.

Elan Ruusamäe (glen666)
Changed in eventum:
importance: Undecided → Low
status: New → Invalid
Revision history for this message
Nick Phillips (nick-phillips-cadmidium) wrote :

Brilliant! Thanks for that Eric, sorted it like a charm!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.