6.0.0-alpha14
6/24/25

[#14214] PHP Fatal error: Call to a member function before() on a non-object
Summary PHP Fatal error: Call to a member function before() on a non-object
Queue Nag
Queue Version 4.2.6
Type Bug
State Resolved
Priority 3. High
Owners mrubinsk (at) horde (dot) org
Requester hordeproject (at) kyoshiro (dot) org
Created 01/05/2016 (3458 days ago)
Due
Updated 10/20/2017 (2804 days ago)
Assigned 01/06/2016 (3457 days ago)
Resolved 01/06/2016 (3457 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
10/20/2017 08:33:52 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 8fbe7150484675e0911f386476d8770da4f12917
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Tue, 05 Jan 2016 21:17:57 -0500

Bug: 14214 Require a non-empty due date too.

While we enfore this in Nag's UI, it wasn't enforced when
adding tasks via the API - like from Kronolith, or external clients.
Even though that is now fixed, we still include this requirement
in the query to catch any existing tasks added like this.

Note: We could use a migration for this, but there already exists
newer migrations in master that make this difficult to handle.

  M lib/Driver.php
  M lib/Driver/Sql.php

https://github.com/horde/nag/commit/8fbe7150484675e0911f386476d8770da4f12917
01/06/2016 04:08:33 AM Michael Rubinsky Comment #6
State ⇒ Resolved
Reply to this comment
Nag 4.2.7
01/06/2016 02:22:41 AM Git Commit Comment #5 Reply to this comment
Changes have been made in Git (master):

commit 5b3f53bfde96875842e650f0a6e5111a223f8cac
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Tue Jan 5 21:03:13 2016 -0500

     Bug: 14214 Require a non-empty due date too.

     While we enfore this in Nag's UI, it wasn't enforced when
     adding tasks via the API - like from Kronolith, or external clients.
     Even though that is now fixed, we still include this requirement
     in the query to catch any existing tasks added like this.

     Note: We could use a migration for this, but there already exists
     newer migrations in master that make this difficult to handle.

  nag/lib/Driver.php     |    4 ++--
  nag/lib/Driver/Sql.php |    4 +++-
  2 files changed, 5 insertions(+), 3 deletions(-)

http://github.com/horde/horde/commit/5b3f53bfde96875842e650f0a6e5111a223f8cac
01/06/2016 02:18:08 AM Git Commit Comment #4 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit dd66aaba51038eb6b38d6208c52001f644d698b8
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Tue Jan 5 21:03:13 2016 -0500

     Bug: 14214 Require a non-empty due date too.

     While we enfore this in Nag's UI, it wasn't enforced when
     adding tasks via the API - like from Kronolith, or external clients.
     Even though that is now fixed, we still include this requirement
     in the query to catch any existing tasks added like this.

     Note: We could use a migration for this, but there already exists
     newer migrations in master that make this difficult to handle.

  nag/lib/Driver.php     |    4 ++--
  nag/lib/Driver/Sql.php |    4 +++-
  2 files changed, 5 insertions(+), 3 deletions(-)

http://github.com/horde/horde/commit/dd66aaba51038eb6b38d6208c52001f644d698b8
01/06/2016 01:53:39 AM Michael Rubinsky Comment #3
State ⇒ Assigned
Reply to this comment
The query only selects tasks with an alarm that is set which *should* 
mean there is a due date set. This is enforced via Nag's UI. However,   
it is currently possible to create an event via Kronolith that has no 
due date set, but has an alarm set. It could also theoretically be 
possible that an external client is importing tasks into horde that 
have no due date. These cases should be fixed, but we should also add 
protection to the query to prevent returning these entries as well.
01/05/2016 03:37:03 PM Michael Rubinsky Comment #2
Assigned to Michael Rubinsky
Priority ⇒ 3. High
Reply to this comment
Indeed. It looks like that could be a null value as well. Looks like 
non-recurring tasks with alarms will trigger this.

I'll take a look this afternoon. Should fix this before the next bug 
fix release drops.
01/05/2016 01:10:36 PM hordeproject (at) kyoshiro (dot) org Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ PHP Fatal error: Call to a member function before() on a non-object
Queue ⇒ Nag
Milestone ⇒
Patch ⇒ Yes
New Attachment: nag_lib_Driver_Sql.diff Download
State ⇒ Unconfirmed
Reply to this comment
Hi,

Whenever I try to login, I get this error (permanent):
PHP Fatal error:  Call to a member function before() on a non-object 
in ****/horde/nag/lib/Driver/Sql.php on line 538

I fixed it by adding a is_object() check in the condition, but I'm not 
sure it's the correct fix.

Regards

Saved Queries