View Issue Details

IDProjectCategoryView StatusLast Update
11405Bug reports[All Projects] Otherpublic2016-07-21 14:30
Reporteraltay Assigned ToLouisGac  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version2.50.x 
Target VersionFixed in Version2.50.x 
Summary11405: .css and .js not loading on public pages
Description

Environment:
CentOS 6.8 (64-bit), limesurvey250plus-build160614, postgres9.4, php-5.3.3-47, httpd-2.2.15-53.

Following installation admin pages show fine. When a survey is created, preview works fine. When the survey is published, .css and .js does not appear to load on the public pages.

Steps To Reproduce

Install limesurvey250plus-build160614 on a CentOS 6.8 system.
Install and configure postgres9.4.
Configure httpd.
Login through the admin interface.
Create a new survey.
Publish the survey.
Look at the survey using the survey URL.

Additional Information

When config.php is put in debug 1 or 2, the problem disappears and the style sheets load fine.

TagsNo tags attached.
Complete LimeSurvey version number (& build)limesurvey250plus-build16061
I will donate to the project if issue is resolvedNo
BrowserFirefox 46.0
Database & DB-Versionpostgres9.4
Server OS (if known)CentOS 6.8
Webserver software & version (if known)httpd-2.2.15-53
PHP Versionphp-5.3.3-47

Activities

vincentb

vincentb

2016-06-20 10:38

reporter   ~39695

Hello,
We have the same problem on 2 servers Ubuntu 12.04.5 LTS with MySQL database.
PHP Version : 5.3.10
Browser : Firefox 47.0 / Chrome 51.0.2704.103

When Limesurvey is in debug mode, CSS and JS load fine.

LouisGac

LouisGac

2016-06-20 12:08

manager   ~39696

is your tmp folder on a exotic place?

vincentb

vincentb

2016-06-20 12:21

reporter   ~39698

No, it's in the default folder :
$config['tempdir'] = $config['rootdir'].DIRECTORY_SEPARATOR."tmp";

LouisGac

LouisGac

2016-06-20 12:30

manager   ~39701

ok.
could you please send us a screenshot of the error? (like in chrome tools, etc)

vincentb

vincentb

2016-06-20 13:47

reporter   ~39709

We actually have no error : no HTTP 404, nothing in Apache log files.
We just have the survey loading without CSS (see screenshot of the source code).

vincentb

vincentb

2016-06-20 13:48

reporter  

bugls.PNG (50,611 bytes)
bugls.PNG (50,611 bytes)
vincentb

vincentb

2016-06-20 13:48

reporter  

bugls2.PNG (53,216 bytes)
bugls2.PNG (53,216 bytes)
LouisGac

LouisGac

2016-06-20 13:56

manager  

css1.jpg (73,895 bytes)
css1.jpg (73,895 bytes)
LouisGac

LouisGac

2016-06-20 13:56

manager   ~39710

Last edited: 2016-06-20 13:56

View 2 revisions

the css files are no more loaded between those comments

<!-- The following line includes jquery-ui.css or jquery-ui-custom.css from template dir, template.css and needed specific css file for survey -->

<!-- The following line includes jquery.js, jquery-ui.js, survey_runtime.js , template.js and needed specific js file for survey

I should update it.

They are loaded on top of it (see attached screenshot)
Could you please provide a new screenshot? Thanks.

c_schmitz

c_schmitz

2016-06-20 13:56

administrator   ~39711

Can you please attach the full HTML page? Thank you.

vincentb

vincentb

2016-06-20 14:04

reporter  

lm_view_debug0.html (7,895 bytes)
vincentb

vincentb

2016-06-20 14:05

reporter  

lm_view_debug1.html (8,386 bytes)
vincentb

vincentb

2016-06-20 14:07

reporter   ~39713

Ok, sorry. I have uploaded 2 files :

  • lm_view_debug0.html is the source code when debug value is 0 (when the problem occurs),
  • lm_view_debug1.html is the source code when debug value is 1 (the problem does not occur).
LouisGac

LouisGac

2016-06-20 14:17

manager   ~39716

thx

LouisGac

LouisGac

2016-06-20 14:39

manager   ~39717

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=19507

LouisGac

LouisGac

2016-06-20 14:43

manager   ~39718

could you provide a link to the survey?

vincentb

vincentb

2016-06-20 14:55

reporter   ~39720

Here is the link to a test survey : https://gestpoll.fondation-ove.fr/index.php/625334

I have applied your commit but it doesn't change anything if i'm not in debug mode.
In the "application/helpers/replacements_helper.php" file, I am going into the "if(!YII_DEBUG)" condition, and not in the "else" condition.

131 if(!YII_DEBUG)
132 { echo "test template";
133 Yii::app()->clientScript->registerPackage( 'survey-template' );
134 }
135 else
136 {
137 .....

The text "test template" is displayed on the survey page.

Thanks

LouisGac

LouisGac

2016-06-20 14:57

manager   ~39721

yep sorry, indeed, the commit wasn't a fix for your problem....

LouisGac

LouisGac

2016-06-20 15:13

manager   ~39722

it seems that your SSL certificate is not up to date, causing the errors.

vincentb

vincentb

2016-06-20 15:29

reporter   ~39723

Sorry, but I have deactivated SSL on limesurvey, and i still got the same problem.

LouisGac

LouisGac

2016-06-20 16:06

manager   ~39738

yep that very strange, because all the files are in the asset directory. For example :
http://gestpoll.fondation-ove.fr/tmp/assets/18b263fe/config.xml
http://gestpoll.fondation-ove.fr/tmp/assets/18b263fe/css/template.css
http://gestpoll.fondation-ove.fr/tmp/assets/18b263fe/css/flat_and_modern.css

some of them are published (like http://gestpoll.fondation-ove.fr/tmp/assets/18b263fe/scripts/template.js), some are not published (like http://gestpoll.fondation-ove.fr/tmp/assets/18b263fe/scripts/bootstrap-slider.js)

also, when you try to access to a directory you have an error message :
http://gestpoll.fondation-ove.fr/tmp/assets/18b263fe/scripts/

maybe related...

whatever, it seems to be related to your server configuration rather than to limesurvey. Nobody never experienced something like that by the past.

If you provide me some credential to connect to the server, I could try to fin what's happen.

LouisGac

LouisGac

2016-06-21 10:25

manager   ~39759

let me know if you find anything related to this problem, or if you want us to give more test. For now, you're the only one experiencing that bug.

Are you using plugins ?

vincentb

vincentb

2016-06-21 12:27

reporter   ~39774

Last edited: 2016-06-21 12:27

View 2 revisions

Hi,

I don't really think it's a server side problem, as we have 2 instances on two disctint servers. Both have the same problem at the same time. And the user altay, who opened this bug, has the same problem.

I have looked again this morning, and think I have a hint.
The CSS files are loaded in the file application/models/TemplateConfiguration.php, inside the private function createTemplatePackage() function.

CSS are defined by this line : $aCssFiles = (array) $this->config->files->css->filename;
But this give me only the first item on the config file :

$aCssFiles = (array) $this->config->files->css->filename;
var_dump($aCssFiles);

Result :
array(1) {
[0]=> string(24) "css/jquery-ui-custom.css"
}

But if write this :
$test =(array) $this->config->files->css;
$aCssFiles = $test['filename'];
var_dump($aCssFiles);

Result :
array(5) {
[0]=> string(24) "css/jquery-ui-custom.css"
[1]=> string(24) "css/bootstrap-slider.css"
[2]=> string(61) "css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"
[3]=> string(23) "css/flat_and_modern.css"
[4]=> string(16) "css/template.css"
}
And I have my CSS back on my LimeSurvey instance.

I don't know PHP enough to understand what is really the difference between the 2 solutions, but I think the problem comes from here.
Same problem and same solution for JS files defined in the same function.

LouisGac

LouisGac

2016-06-21 12:42

manager   ~39777

that's what I call a server side problem...
I think we really should rise the minimum PHP version to 5.5
PHP 5.3 is soooo buggy...
https://goo.gl/mho0SX

Thank you for your deep investigation.
I will implement a "fix" around it

LouisGac

LouisGac

2016-06-21 12:56

manager   ~39780

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=19518

LouisGac

LouisGac

2016-06-21 12:57

manager   ~39781

vincentb : could you apply the commit to test if it resolves the problem?

vincentb

vincentb

2016-06-21 13:57

reporter   ~39782

Thanks, but I just tried the commit, but no difference, problem still there. Sorry :s

LouisGac

LouisGac

2016-06-21 14:03

manager   ~39783

ok I'm going to install a VM with PHP 5.3

hermann

hermann

2016-07-05 14:31

reporter   ~39831

I had the very same problem. The fix in
https://github.com/LimeSurvey/LimeSurvey/commit/1b26318658b43e767ae41e7e8bc9e2530cac50cc#diff-7724b0b4a704b4e5592ea1093a9f4c14
did not help me as well. I tried using xpath() instead and that solved the problem for me.

@altay: Could you please try to apply this patch:
https://github.com/LimeSurvey/LimeSurvey/files/347713/use_xpath_to_fix_issue_11405.txt

Greetings
Hermann

LouisGac

LouisGac

2016-07-05 14:36

manager   ~39832

hey hermann, could you confirm you're using php 5.3 ?

hermann

hermann

2016-07-05 14:56

reporter   ~39833

Hi LouisGac,

sorry forgot to add that here (as I did in the comment on the github-commit):
PHP 5.3.3
Red Hat Enterprise Linux Server release 6.8

Greetings
Hermann

LouisGac

LouisGac

2016-07-05 15:00

manager   ~39834

ok. I'll apply your patch.
Still : don't forgot that PHP 5.3 is no more maintained, and PHP official team remind it's full of bugs and security issues. See:
http://php.net/supported-versions.php

hermann

hermann

2016-07-05 15:35

reporter   ~39836

Thanks, LouisGac,

regarding the patch/fix: Denis Chenu suggests (https://github.com/LimeSurvey/LimeSurvey/commit/1b26318658b43e767ae41e7e8bc9e2530cac50cc#commitcomment-18124301) I should make a pull request.
Do you take the patch-file I sent an hour ago or shall I create that pull request?

LouisGac

LouisGac

2016-07-05 15:49

manager   ~39837

Well, if you want to create a pull request would be perfect, and then you'll can proudly prove that you contribute to LimeSurvey ;-)

THank you again for your implication.

davidrnewman

davidrnewman

2016-07-06 00:27

reporter   ~39838

This problem is also occuring on my installation. It started as soon as I did the comfort update to limesurvey250plus-build160620.tar.bz2. All the user interface for survey responses has disappeared. See
http://www.e-consultation.org/survey/index.php/826621?lang=en

I am using PHP version 5.3.10

Any chance of an ordinary download without having to set up git?

hermann

hermann

2016-07-06 10:01

reporter   ~39839

@LouisGac: Just made a pull-request on github:
https://github.com/LimeSurvey/LimeSurvey/pull/518

hermann

hermann

2016-07-06 10:09

reporter   ~39840

Hi davidrnewman,

same here: no more css- and js-styling after comfort update to build160620. This is a php compatibility problem: in (at least) 5.3.x not all "array-contexts" are recognised by simplexml when using the '->' operator. I.e. only the first of all configured css- and js-files is loaded.
But it works when the xpath() method is used.

So a quick fix would be to download this patch:
https://github.com/LimeSurvey/LimeSurvey/files/347713/use_xpath_to_fix_issue_11405.txt
and apply it. Or change those 5 lines manually if you can't use patch(1).

LouisGac

LouisGac

2016-07-06 10:23

manager   ~39841

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=19542

LouisGac

LouisGac

2016-07-06 10:24

manager   ~39842

Ok I merged the PR.
But again: using PHP 5.3.x is a very bad idea.

davidrnewman

davidrnewman

2016-07-06 13:42

reporter   ~39844

Thanks for the patch, hermann, that worked.

I am stuck with PHP 5.3.x because my hosting provider is using an older Ubuntu LTS version.

LouisGac

LouisGac

2016-07-06 13:59

manager   ~39845

davidrnewman : well that's not acceptable. You should threat your host provider to move to a more serious one.

PHP team officially says that PHP 5.3 is not safe to use. Soon, even 5.5 will not be supported anymore.

See:
http://php.net/supported-versions.php

Staying on 5.3: you're in danger.

LouisGac

LouisGac

2016-07-21 14:30

manager   ~40006

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=19697

Related Changesets

LimeSurvey: master e5268c72

2016-06-20 12:39:38

LouisGac

Details Diff
Fixed issue 11405: .css and .js not loading on public pages (on specific servers) Affected Issues
11405
mod - application/helpers/replacements_helper.php Diff File

LimeSurvey: master 1b263186

2016-06-21 10:55:31

LouisGac

Details Diff
Fixed issue 11405: .css and .js not loading on public pages
Dev: used a temporary variable using a temporary variable to array dereference the result of the simpleXML methods (PHP < 5.4 compatibility).
Affected Issues
11405
mod - application/models/TemplateConfiguration.php Diff File

LimeSurvey: master ede82d50

2016-07-06 07:53:09

hermann

Details Diff
Fixed 11405: for php compatibility-reasons use xpath() instead of '->' to retrieve array of settings from config.xml Affected Issues
11405
mod - application/models/TemplateConfiguration.php Diff File

LimeSurvey: master c8b12f02

2016-07-06 08:23:08

LouisGac


Committer: GitHub Details Diff
Merge pull request #518 from hermannschwaerzlerUIBK/master

Fixed 11405: for php compatibility-reasons use xpath() instead of '-…
Affected Issues
11405
mod - application/models/TemplateConfiguration.php Diff File

LimeSurvey: master 867f830c

2016-07-21 12:29:56

LouisGac

Details Diff
Fixed issue 11405: .css and .js not loading on public pages
Fixed issue 11476: CSS and JS files not included at "default" template though {TEMPLATECSS} and {TEMPLATEJS} placeholders exist
Affected Issues
11405, 11476
mod - application/models/TemplateConfiguration.php Diff File

Issue History

Date Modified Username Field Change
2016-06-17 20:15 altay New Issue
2016-06-20 10:38 vincentb Note Added: 39695
2016-06-20 12:08 LouisGac Note Added: 39696
2016-06-20 12:21 vincentb Note Added: 39698
2016-06-20 12:30 LouisGac Note Added: 39701
2016-06-20 13:47 vincentb Note Added: 39709
2016-06-20 13:48 vincentb File Added: bugls.PNG
2016-06-20 13:48 vincentb File Added: bugls2.PNG
2016-06-20 13:56 LouisGac File Added: css1.jpg
2016-06-20 13:56 LouisGac Note Added: 39710
2016-06-20 13:56 c_schmitz Note Added: 39711
2016-06-20 13:56 LouisGac Note Edited: 39710 View Revisions
2016-06-20 14:04 vincentb File Added: lm_view_debug0.html
2016-06-20 14:05 vincentb File Added: lm_view_debug1.html
2016-06-20 14:07 vincentb Note Added: 39713
2016-06-20 14:17 LouisGac Note Added: 39716
2016-06-20 14:39 LouisGac Changeset attached => LimeSurvey master e5268c72
2016-06-20 14:39 LouisGac Note Added: 39717
2016-06-20 14:39 LouisGac Assigned To => LouisGac
2016-06-20 14:39 LouisGac Resolution open => fixed
2016-06-20 14:43 LouisGac Note Added: 39718
2016-06-20 14:55 vincentb Note Added: 39720
2016-06-20 14:57 LouisGac Note Added: 39721
2016-06-20 15:13 LouisGac Note Added: 39722
2016-06-20 15:29 vincentb Note Added: 39723
2016-06-20 15:59 LouisGac Sticky Issue No => Yes
2016-06-20 16:06 LouisGac Note Added: 39738
2016-06-20 16:15 LouisGac Sticky Issue Yes => No
2016-06-21 10:25 LouisGac Note Added: 39759
2016-06-21 12:27 vincentb Note Added: 39774
2016-06-21 12:27 vincentb Note Edited: 39774 View Revisions
2016-06-21 12:42 LouisGac Note Added: 39777
2016-06-21 12:53 LouisGac Sticky Issue No => Yes
2016-06-21 12:56 LouisGac Changeset attached => LimeSurvey master 1b263186
2016-06-21 12:56 LouisGac Note Added: 39780
2016-06-21 12:57 LouisGac Note Added: 39781
2016-06-21 13:57 vincentb Note Added: 39782
2016-06-21 14:03 LouisGac Note Added: 39783
2016-06-22 10:57 LouisGac Sticky Issue Yes => No
2016-07-05 14:31 hermann Note Added: 39831
2016-07-05 14:36 LouisGac Note Added: 39832
2016-07-05 14:56 hermann Note Added: 39833
2016-07-05 15:00 LouisGac Note Added: 39834
2016-07-05 15:35 hermann Note Added: 39836
2016-07-05 15:49 LouisGac Note Added: 39837
2016-07-06 00:27 davidrnewman Note Added: 39838
2016-07-06 10:01 hermann Note Added: 39839
2016-07-06 10:09 hermann Note Added: 39840
2016-07-06 10:23 hermann Changeset attached => LimeSurvey master ede82d50
2016-07-06 10:23 LouisGac Changeset attached => LimeSurvey master c8b12f02
2016-07-06 10:23 LouisGac Note Added: 39841
2016-07-06 10:24 LouisGac Note Added: 39842
2016-07-06 13:42 davidrnewman Note Added: 39844
2016-07-06 13:59 LouisGac Note Added: 39845
2016-07-19 11:23 c_schmitz Status new => closed
2016-07-19 11:23 c_schmitz Fixed in Version => 2.5
2016-07-21 14:30 LouisGac Changeset attached => LimeSurvey master 867f830c
2016-07-21 14:30 LouisGac Note Added: 40006