6.0.0-beta1
7/14/25

[#11277] nag: Updating tasks with a Kolab backend fails
Summary nag: Updating tasks with a Kolab backend fails
Queue Nag
Queue Version Git develop
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester thomas.jarosch (at) intra2net (dot) com
Created 07/14/2012 (4748 days ago)
Due
Updated 08/29/2012 (4702 days ago)
Assigned 07/19/2012 (4743 days ago)
Resolved 08/09/2012 (4722 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
08/29/2012 12:47:20 PM Git Commit Comment #17 Reply to this comment
Changes have been made in Git (master):

commit ad59737f3889414ad2b675d7ad2cbde84238cb7a
Author: Jan Schneider <jan@horde.org>
Date:   Thu Aug 9 20:54:15 2012 +0200

     Fix super global access (Bug #11277).

     PHP is optimized so that super globals are only made available if they are
     detected by the parser. Thus they cannot be accessed reliably as variable
     variables or $GLOBALS members.

  .../lib/Horde/Controller/Request/Http.php          |   22 ++++----------
  .../lib/Horde/Controller/Request/Mock.php          |   30 
++++++++++++++++++++
  framework/Controller/package.xml                   |    4 +-
  3 files changed, 38 insertions(+), 18 deletions(-)

http://git.horde.org/horde-git/-/commit/ad59737f3889414ad2b675d7ad2cbde84238cb7a
08/29/2012 12:43:26 PM Git Commit Comment #16 Reply to this comment
Changes have been made in Git (master):

commit af10bded7d53b7150a765ef813ce72b9485bb0d7
Author: Jan Schneider <jan@horde.org>
Date:   Thu Jul 19 02:32:18 2012 +0200

     Fix notice (Bug #11277).

  nag/app/controllers/CompleteTask.php |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/af10bded7d53b7150a765ef813ce72b9485bb0d7
08/29/2012 12:42:59 PM Git Commit Comment #15 Reply to this comment
Changes have been made in Git (master):

commit 376e68ce06f804e7af69ee88c73069f9528896c5
Author: Jan Schneider <jan@horde.org>
Date:   Tue Jul 17 13:54:43 2012 +0200

     Cast to float (Bug #11277).

  nag/lib/Driver/Kolab.php |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/376e68ce06f804e7af69ee88c73069f9528896c5
08/29/2012 12:42:55 PM Git Commit Comment #14 Reply to this comment
Changes have been made in Git (master):

commit b6ad86d97e8a06e24c7c3a07e94061edeb9ad5ed
Author: Jan Schneider <jan@horde.org>
Date:   Tue Jul 17 13:43:58 2012 +0200

     Avoid notice if there is no parent class (Bug #11277).

  .../lib/Horde/Core/Controller/SettingsFinder.php   |    5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)

http://git.horde.org/horde-git/-/commit/b6ad86d97e8a06e24c7c3a07e94061edeb9ad5ed
08/09/2012 06:56:23 PM Jan Schneider State ⇒ Resolved
 
08/09/2012 06:56:14 PM Git Commit Comment #13 Reply to this comment
Changes have been made in Git (develop):

commit ad59737f3889414ad2b675d7ad2cbde84238cb7a
Author: Jan Schneider <jan@horde.org>
Date:   Thu Aug 9 20:54:15 2012 +0200

     Fix super global access (Bug #11277).

     PHP is optimized so that super globals are only made available if they are
     detected by the parser. Thus they cannot be accessed reliably as variable
     variables or $GLOBALS members.

  .../lib/Horde/Controller/Request/Http.php          |   22 ++++----------
  .../lib/Horde/Controller/Request/Mock.php          |   30 
++++++++++++++++++++
  framework/Controller/package.xml                   |    4 +-
  3 files changed, 38 insertions(+), 18 deletions(-)

http://git.horde.org/horde-git/-/commit/ad59737f3889414ad2b675d7ad2cbde84238cb7a
08/09/2012 06:47:02 PM Jan Schneider Comment #12 Reply to this comment
This might also be a "performance optimization" of newer PHP versions:
https://bugs.php.net/bug.php?id=55088
But this is what we're hitting.
08/09/2012 06:41:22 PM Jan Schneider Comment #11 Reply to this comment
-> We construct a variable variable on the fly inside the code.
No, we don't. This is not a variable variable that we use, we just 
access the superglobals as items of the $GLOBALS array, which is 
perfectly valid and has always been.
07/21/2012 02:53:03 PM Thomas Jarosch Comment #10
New Attachment: 0001-Bug-11277-Fix-superglobal-access-via-variable-variab.patch Download
Reply to this comment
Attached is the patch to fix the issue.

I'm still surprised it didn't break earlier for other users :)

Now I can mark items as complete in nag again.

07/21/2012 02:30:28 PM Thomas Jarosch Comment #9 Reply to this comment
Alright, the PHP manual clearly states this:

"Superglobals cannot be used as variable variables inside functions or 
class methods."
(http://www.php.net/manual/en/language.variables.superglobals.php)

-> We construct a variable variable on the fly inside the code.

I'm going to provide a patch for this.

07/19/2012 11:28:47 AM Thomas Jarosch State ⇒ Assigned
 
07/19/2012 11:28:17 AM Thomas Jarosch Comment #8 Reply to this comment
You have locked down or otherwise disabled the request_order PHP setting.
The PHP installation is pretty vanilla, no special lock downs.

This might also be a "performance optimization" of newer PHP versions:
https://bugs.php.net/bug.php?id=55088

I just wrote this small test script based upon the Horde code:
-----------------------------------------
<?php
function getVars($name)
{
     return $GLOBALS['_' . $name];
}

echo "<pre>\n";
print_r(getVars(REQUEST));
print_r($GLOBALS);
print_r($_REQUEST);              // check result with this line commented out
echo "</pre>\n";
-----------------------------------------

The $GLOBALS array will only contain _REQUEST if the 
print_r($_REQUEST) is in place.

07/19/2012 01:06:39 AM Jan Schneider Comment #7
State ⇒ Resolved
Reply to this comment
You have locked down or otherwise disabled the request_order PHP setting.
07/19/2012 12:56:37 AM Git Commit Comment #6 Reply to this comment
Changes have been made in Git (develop):

commit af10bded7d53b7150a765ef813ce72b9485bb0d7
Author: Jan Schneider <jan@horde.org>
Date:   Thu Jul 19 02:32:18 2012 +0200

     Fix notice (Bug #11277).

  nag/app/controllers/CompleteTask.php |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/af10bded7d53b7150a765ef813ce72b9485bb0d7
07/18/2012 03:28:01 PM Thomas Jarosch State ⇒ Assigned
 
07/18/2012 03:12:35 PM Thomas Jarosch Comment #5 Reply to this comment
The 'pear' driver was just a hack of mine to get it working -somehow-.
I've now reverted that hack.

Updating f.e. the description of a task is now possible.

But I can't mark a task as done via the UI. Nothing happens and this 
error message is in the logs:

2012-07-18T17:10:26+02:00 NOTICE: HORDE [nag] PHP ERROR: Undefined 
index: _REQUEST [pid 4151 on line 45 of 
"/datastore/DEVEL/horde/framework/Controller/lib/Horde/Controller/Request/Http.php"]
2012-07-18T17:10:26+02:00 NOTICE: HORDE [nag] PHP ERROR: Undefined 
index: format [pid 4151 on line 40 of 
"/datastore/DEVEL/horde/nag/app/controllers/CompleteTask.php"]

07/17/2012 11:59:20 AM Jan Schneider Comment #4
State ⇒ Feedback
Reply to this comment
2012-07-14T19:19:37+02:00 NOTICE: HORDE [nag] PHP ERROR: Trying to 
get property of non-object [pid 20767 on line 33 of 
"/datastore/DEVEL/horde/framework/Core/lib/Horde/Core/Controller/SettingsFinder.php"]
2012-07-14T19:19:37+02:00 WARN: HORDE [nag] PHP ERROR: 
number_format() expects parameter 1 to be double, string given [pid 
20767 on line 306 of 
"/datastore/DEVEL/horde/nag/lib/Driver/Kolab.php"]
Those don't keep the task from being saved, but are fixed now nonetheless.
Kolab backend driver used is 'pear'.
Not sure what you mean by that. By default the Kolab and IMAP backends 
use the Horde_Imap_Client library, not PEAR, and AFAICS there is no 
way to change that in the configuration. This is for a good reason, 
because the PEAR driver is not well tested.
07/17/2012 11:57:25 AM Git Commit Comment #3 Reply to this comment
Changes have been made in Git (develop):

commit 376e68ce06f804e7af69ee88c73069f9528896c5
Author: Jan Schneider <jan@horde.org>
Date:   Tue Jul 17 13:54:43 2012 +0200

     Cast to float (Bug #11277).

  nag/lib/Driver/Kolab.php |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/376e68ce06f804e7af69ee88c73069f9528896c5
07/17/2012 11:57:19 AM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (develop):

commit b6ad86d97e8a06e24c7c3a07e94061edeb9ad5ed
Author: Jan Schneider <jan@horde.org>
Date:   Tue Jul 17 13:43:58 2012 +0200

     Avoid notice if there is no parent class (Bug #11277).

  .../lib/Horde/Core/Controller/SettingsFinder.php   |    5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)

http://git.horde.org/horde-git/-/commit/b6ad86d97e8a06e24c7c3a07e94061edeb9ad5ed
07/17/2012 10:59:30 AM Jan Schneider Assigned to Jan Schneider
State ⇒ Assigned
 
07/14/2012 05:20:56 PM Thomas Jarosch Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ nag: Updating tasks with a Kolab backend fails
Type ⇒ Bug
Queue ⇒ Nag
Reply to this comment
Hi,

updating an existing task with a Kolab backend fails with this error message:

2012-07-14T19:19:37+02:00 NOTICE: HORDE [nag] PHP ERROR: Trying to get 
property of non-object [pid 20767 on line 33 of 
"/datastore/DEVEL/horde/framework/Core/lib/Horde/Core/Controller/SettingsFinder.php"]
2012-07-14T19:19:37+02:00 WARN: HORDE [nag] PHP ERROR: number_format() 
expects parameter 1 to be double, string given [pid 20767 on line 306 
of "/datastore/DEVEL/horde/nag/lib/Driver/Kolab.php"]

Kolab backend driver used is 'pear'.

Cheers,
Thomas

Saved Queries