• Status Closed
  • Percent Complete
  • Task Type Bug Report
  • Category Backend/Core
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version 1.0-beta
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Flyspray
Opened by TomG - 06.11.2015
Last edited by peterdd - 28.01.2018

FS#2088 - Error when trying to add task with dokuwiki

Steps to reproduce:

  1. install Flyspray 1.0 beta 2 on Turnkey Linux LAMP Stack 14.0 - this is Debian 8 (Jessie), PHP Version 5.6.13-0+deb8u1, see attached phpinfo.htm
  2. run Flyspray setup by navigating to Flyspray install dir in browser
  3. manually run curl / composer as suggested by setup
  4. set write permissions on attachments, cache, and newly created empty flyspray.conf.php
  5. allow FS to create new DB (”flyspraytest”)
  6. rename setup dir at end of setup
  7. navigate to Flyspray install dir in browser
  8. click “add new task”
  9. enter summary and description
  10. click “add this task”

Observed behavior:

Empty web page except for the following output, and task is not created:

Fatal error: Cannot redeclare class DokuHTTPClient in /var/www/flyspray-1.0-beta.2/plugins/dokuwiki/inc/HTTPClient.php on line 20 
Call Stack: 
0.0000 276512 1. {main}() /var/www/flyspray-1.0-beta.2/index.php:0 
0.0067 1874152 2. require_once('/var/www/flyspray-1.0-beta.2/scripts/details.php') /var/www/flyspray-1.0-beta.2/index.php:194 
0.0109 1947272 3. TextFormatter::render() /var/www/flyspray-1.0-beta.2/scripts/details.php:145 
0.0109 1948656 4. call_user_func:{/var/www/flyspray-1.0-beta.2/includes/class.tpl.php:687}() /var/www/flyspray-1.0-beta.2/includes/class.tpl.php:687 
0.0109 1949040 5. dokuwiki_TextFormatter::render() /var/www/flyspray-1.0-beta.2/includes/class.tpl.php:687 
0.0112 2223680 6. require_once('/var/www/flyspray-1.0-beta.2/plugins/dokuwiki/inc/common.php') /var/www/flyspray-1.0-beta.2/plugins/dokuwiki/ 
0.0113 2248136 7. require_once('/var/www/flyspray-1.0-beta.2/plugins/dokuwiki/inc/io.php') /var/www/flyspray-1.0-beta.2/plugins/dokuwiki/inc/common.php:11 
0.0113 2285584 8. require_once('/var/www/flyspray-1.0-beta.2/plugins/dokuwiki/inc/HTTPClient.php') /var/www/flyspray-1.0-beta.2/plugins/dokuwiki/inc/io.php:11 
Closed by  peterdd
28.01.2018 21:07
Reason for closing:  Fixed in devel
Project Manager

At the moment I can't reproduce the error on opensuse13.2 local install. (php5.6.1, yast minimal install + apache2 + php-openssl + php-phar + php-mysql + php-pgsgl packages)

In your attached phpinfo.htm there is _COOKIE["shellInABox"], but no "flyspray"-cookie. This is a hint that it is from an older flyspray version. (?!)
Or you didn't run phpinfo(); from the flyspray-1.0-beta.2/ -dir?

I made some changes to make the composer steps working with flyspray webinstall with more server environments but needs more testing.

TomG commented on 09.11.2015 18:09

I'm using Flyspray 1.0 beta 2 from:

I've attached phpinfo2.htm, this time executed from the flyspray-1.0-beta.2 directory, after having run Flyspray in that browser session. Note that the server automatically updated itself from PHP 5.6.13 to 5.6.14 since the last phpinfo I sent.

I edited HTTPClient.php and moved the DokuHTTPClient class to the end of the file, after HTTPClient, and that seems to have solved the problem. I don't understand why, though.

Project Manager

I have a slightly idea what could happens there:

Lets have a file HTTPClient.php:

new DokuHTTPClient;
class DokuHTTPClient extends HTTPClient {}
class HTTPClient {}

And a script test.php:

function __autoload($class_name) {
        include 'HTTPClient.php';

When I call it on the command line 'php test.php' I get:

PHP Fatal error:  Cannot redeclare class HTTPClient in /srv/www/htdocs/HTTPClient.php on line 4

What happened here probably: The autoloader tries to include the file HTTPClient a second time when the code is at class DokuHTTPClient, it does not know what HTTPClient is and the autoload kicks in..

Did you referenced some external files or something like that in the description or doesn't it happened with also simple text description?

But I haven't an explanation yet why I can't reproduce it with flyspray yet. Some config must be different..

TomG commented on 10.11.2015 03:50

The summary and description I entered were both just simple text like ajksdflj. I tried to keep the test as minimal as possible to reproduce the error.

It looks to me like the PHP docs say you're supposed to declare a parent class before a child class that extends it. But I'm not sure why using the wrong order works in some environments but not others, or if it's not wrong because there's some nuance to the order requirement that I'm not aware of.

Project Manager

The switch of classes in plugins/dokuwiki/inc/HTTPClient.php is now merged to Flyspray 1.0-rc7 dev master.

Couldn’t reproduce yet, but lets follow PHP documentation.


Available keyboard shortcuts


Task Details

Task Editing