Welcome to the LimeSurvey Community Forum

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

Error on "Theme Options"

  • jansch2015
  • jansch2015's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago - 6 years 1 month ago #164456 by jansch2015
Error on "Theme Options" was created by jansch2015

File Attachment:

File Name: PHPwarning.zip
File Size:6 KB
Hi


I get the attached error when trying to open "Theme options". I don't think its a bug since it works totally fine on my dev system (which is totally different, different server, different php version, etc.).

Attached you can find the error.

Any idea how this is caused?

I did not change anything on the themes. It's totally out of the box.

BR
Jan
Attachments:
Last edit: 6 years 1 month ago by jansch2015.
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
6 years 1 month ago #164461 by ollehar
Replied by ollehar on topic Error on "Theme Options"
We need to know what $file really is here. Weirdly it's not included in the error message. You can also contact your hosting provider about open_basedir restriction.
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
6 years 1 month ago - 6 years 1 month ago #164462 by ollehar
Replied by ollehar on topic Error on "Theme Options"
Try setting debug => 2 in config.php and try again.
Last edit: 6 years 1 month ago by ollehar.
The topic has been locked.
  • jansch2015
  • jansch2015's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #164473 by jansch2015
Replied by jansch2015 on topic Error on "Theme Options"
This is on debug 2. It works fine on 0.

Based on the error message, $file is "..", which causes the error.
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
6 years 1 month ago #164474 by ollehar
Replied by ollehar on topic Error on "Theme Options"
Which theme?
The topic has been locked.
  • jansch2015
  • jansch2015's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #164475 by jansch2015
Replied by jansch2015 on topic Error on "Theme Options"
Any of the 3 standard.
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
6 years 1 month ago #164476 by ollehar
Replied by ollehar on topic Error on "Theme Options"
Could it be that

$file = readdir($handle)

return files '.' and '..'? Could you disable line 344 and var_dump all the $file?
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
6 years 1 month ago #164478 by ollehar
Replied by ollehar on topic Error on "Theme Options"
Maybe we need this line?

stackoverflow.com/a/9697772/2138090
The topic has been locked.
  • jansch2015
  • jansch2015's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #164514 by jansch2015
Replied by jansch2015 on topic Error on "Theme Options"
Correct!

Changing line 344 to
Code:
if ($file != ".." && $file != "." && !is_dir($file)) {
did the trick...

Could you add that to github since I'm not registered?

Cheers and thanks!
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
6 years 1 month ago #164529 by ollehar
Replied by ollehar on topic Error on "Theme Options"
Yes, no problem. Thank you for your feedback!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose