Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

upgrade to build 160810 from 2.00 - problem with database upgrade and User.php

  • fpicabia
  • fpicabia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago #140758 by fpicabia
I followed the upgrade instructions. As I want to be safe and not dead in the water (as the -dev site is now), I made a copy of the production database and web installation and upgraded that. All that is kept from the production area is tmp and upload, and I copied them in over the extracted files.

The upgrade wizard worked OK up until the database upgrade. It displays a page saying it will upgrade from DB version 177 to version 259. This is with pgsql. I "click here ot continue", and then there is a blank page at limesurveydev.example.org/index.php/admi...e/sa/db/continue/yes

With debug set to 2, this page is displaying:

Parse error: syntax error, unexpected '[' in /usr/local/www/limesurveydev/application/models/User.php on line 340

That line number contains:

data-user='".$this->getName($this->uid)[0]."'

So there seems to be a problem with the username. I have not logged in during this upgrade, so there is no user name - we got here from the upgrade script. If I visit the page /admin, it doesn't prompt for a login, but displays the same upgrade wizard page for the DB upgrade. We used ldap for authentication if that might matter.

Any ideas what is wrong or how to debug it further?
The topic has been locked.
More
7 years 7 months ago #140761 by rjohnson
I have had this issue on a fresh install. I believe that you will find it is a problem with your PHP version.

I was trying to install on PHP Version 5.3.10-1ubuntu3.11 and I got exactly your error. When I installed on a fresh machine with PHP Version 5.5.9-1ubuntu4.19 on it, the install ran fine.

You can fix this by making the following changes to User.php

Add the code

$dUserA = $this->getName($this->uid);
$dUser = $dUserA[0];

just after line 331 ($changeOwnershipUrl = Yii::app()->getController()->createUrl('admin/user/sa/setasadminchild'); )

and then change all instances of $this->getName($this->uid) [0] [ 'full_name' ] to $dUser

Now, I can't recommend this because there could be other instances of similar code that will not parse in 5.3.10 so I would recommend upgrading your PHP to 5.5+ which is what I will be doing now I understand the error

If anyone from the documentation team reads this then I suggest changing the documentation because it says that LimeSurvey will run on PHP 5.3.3+ which it clearly will not.
The following user(s) said Thank You: fpicabia
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 7 months ago #140763 by holch
The documentation is a wiki and anyone with a account to post in the forum can add to the documentation and contribute to making Limesurvey a better software. :-)

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: fpicabia
The topic has been locked.
  • fpicabia
  • fpicabia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago #140768 by fpicabia
Thank you for this response. I was able to update to a newer 5.4 PHP from webtatic repository. That and making the Lime Survey install area temporarily writable by other (chmod -R o+w ) for the DB upgrade step, allowed it to complete.
(Of course, reverse the chmod with o-w after).
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose