• Making the cut with jQuery and MooTools in Joomla: The multiple jQuery libraries loading problem - Part 2

    There is an alternative to code jQuery library calls into a Joomla! template or into the Joomla! core. Nowadays, there is a pletora of jQuery plugins available in the Joomla! Extensions Directory that...
  • Create a hidden menu item for search results

    You want to see search results in a specific page, have modules associated to that page but do not want to have a specific menu item for it. Why? Because you already have a search box in your template...
  • You may not need jQuery's Migrate plugin after all

    Migrate has been created to make jQuery code backup compatible with versions of jQuery prior to v1.9. It is packaged with the Joomla! framework (which will hopefully soon contain the latest version of...
Thu09Mar2017

Print

Troubleshoot missing styles and scripts (access permissions errors)

Article Details Article Details Profiles Image from Article Latest News Enhanced Latest News Enhanced Pro SYW Bare Responsive Trombinoscope Contacts Trombinoscope Contacts Pro Truly Responsive Slides Truly Responsive Slides Pro Weblink Logos Weblink Logos Pro

First published October 13, 2015

2072 hits - No rating

 
For:
Any Simplify Your Web extension that has an output display

After installing any of the Simplify Your Web extensions (or after moving the site to a different server with different settings), some users may experience issues with the extension's HTML output. No matter the setup, the output does not look anything like any of the demos or screenshots that the user has seen...

Feelings of disappointment occur (it should work from the start, right?). What is really happening?

This tutorial will help you diagnose the issue (or confirm it) and guide you to fix it.

Step 1 Open the page source view

Most browsers have the option to show the source code generated by webpages. For some, just a right-click on the page is all it takes to find that option.

Step 2 Locate the stylesheets and/or scripts associated with the extension you are trying to troubleshoot.

When having style issues, look for files named 'style.css', 'stylemaster.css' or 'stylemaster.css.php'. When having animation issues, look for files named 'animation.js', 'animationmaster.js' or 'animationmaster.js.php'.

For instance, if you were troubleshooting Trombinoscope Contacts, you would find an associated stylesheet:

<link rel="stylesheet" href="/modules/mod_trombinoscope/themes/stylemaster_92.css" type="text/css" />

In most recent versions, generated stylesheets and scripts are located in the /cache folder of the Joomla implementation. For instance:

<link rel="stylesheet" href="/cache/mod_trombinoscopecontacts/style_92.css" type="text/css" />

Step 3 Click on the links

In page source view, most referenced files can be clicked on. Click on the found link(s) and check its(their) content. If anything goes well, CSS or javascript code must be visible (look through the whole file(s), errors can occur later down the file(s)).
For instance, the 'stylemaster_92.css' file from the previous example should contain something like:

.te_92 {overflow: hidden;position: relative;width: 100%;}.te_92 .personlist {overflow: hidden;text-align: center;font-size: 0; }.te_92 .groupheader {display: inline-block;width: 100%;font-size: 14px;text-align: left;}.te_92 .groupheader .header {border-bottom: 1px solid #DDDDDD;}...

If not (most likely since you are troubleshooting a potential problem), there should be some HTML code with error reporting anywhere inside that code.

<br /><font size='1'><table class='xdebug-error xe-warning' dir='ltr' border='1' cellspacing='0' cellpadding='1'><tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: stylemaster.css.php: failed to open stream: ...

Note Since v1.2.5 of the external library lib_syw, errors are logged instead (the previous file will most likely be blank or just contain your own additional CSS overrides). Go to the logs folder specified in the Joomla configuration of your site and look for the file syw.errors.php. The errors will be clearly notified in that file, if any.

For files located in the /cache folder, the file content may be:

Forbidden
You don't have permission to access /cache/mod_trombinoscopecontacts/style_92.css on this server.

Step 4 Diagnose the issue

The errors are related to file permissions (403 permission error). Simplify Your Web extensions build stylesheets and scripts 'on the fly' to reflect any change made in the extensions parameter options.

Step 5 Modify .htaccess

If the problems are directly linked to file permissions, ensuring those permissions are 644 or 744 (added owner 'execute') may not be enough. You need to tell the server what files can have direct access. And it has to be done in the .htaccess file.

Step 5a Using Admin Tools

When using 'Admin Tools Professional' for instance, the modifications are easy. Go to the 'Exceptions' section of the htaccess maker tool and add the faulty files to the 'Allow direct access to these files' section. For instance, for the Trombinoscope Contacts extension, add:

modules/mod_trombinoscope/themes/stylemaster.js.php

or for the most recent extensions where the scripts and stylesheets are hosted in the /cache folder:

cache/mod_trombinoscopecontacts/style_92.css

You can also just white-list the /cache/mod_trombinoscopecontacts folder.

Step 5b Manually

First, make a copy of the original .htaccess file. Then add the following lines to the file (this is for Trombinoscope Contacts):

##### Advanced server protection rules exceptions -- BEGIN 
RewriteRule ^modules\/mod_trombinoscope\/themes\/stylemaster\.js\.php$ - [L]
##### Advanced server protection rules exceptions -- END

or for the most recent extensions where the scripts and stylesheets are hosted in the /cache folder:

##### Advanced server protection rules exceptions -- BEGIN 
RewriteRule ^cache\/mod_trombinoscopecontacts\/style_92\.css$ - [L]
##### Advanced server protection rules exceptions -- END

You may also just allow all files in the /cache folder (the following code excludes php files from access authorization):

##### Advanced server protection rules exceptions -- BEGIN 
RewriteCond %{REQUEST_FILENAME} !(\.php)$
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^cache/ - [L]
##### Advanced server protection rules exceptions -- END

Extension specifics

Following is an exhaustive list of all the files that may require specific permissions for all the extensions created by Simplify Your Web.

Article Details

This is no longer necessary starting with version 4.0.0. Files located in the /cache/plg_content_articledetails folder need permission instead.

plugins/content/articledetails/stylemaster.css.php
plugins/content/articledetails/printmaster.css.php
plugins/content/articledetails/styles/style.css.php
plugins/content/articledetails/styles/print.css.php
 
plugins/content/articledetails/styles/calendar/original/print.css.php
plugins/content/articledetails/styles/calendar/original/style.css.php

Image from Article

This is no longer necessary starting with version 1.2.0. Files located in the /cache/plg_content_imagefromarticle folder need permission instead.

plugins/content/imagefromarticle/stylemaster.css.php
plugins/content/imagefromarticle/style.css.php

Latest News Enhanced

This is no longer necessary starting with version 2.5.0. Files located in the /cache/mod_latestnewsenhanced folder need permission instead.

modules/mod_latestnewsenhanced/stylemaster.js.php
modules/mod_latestnewsenhanced/stylemaster.css.php
modules/mod_latestnewsenhanced/animationmaster.js.php
modules/mod_latestnewsenhanced/styles/style.css.php
 
modules/mod_latestnewsenhancedextended/styles/overall/original/style.css.php
If using calendars, add:
modules/mod_latestnewsenhancedextended/styles/calendar/original/style.css.php
If using pagination, add:
modules/mod_latestnewsenhanced/animations/justpagination/style.css.php
modules/mod_latestnewsenhanced/animations/justpagination/justpagination.js.php

Latest News Enhanced Pro

This is no longer necessary starting with version 2.5.0. Files located in the /cache/mod_latestnewsenhancedpro folder need permission instead.

modules/mod_latestnewsenhancedextended/stylemaster.js.php
modules/mod_latestnewsenhancedextended/stylemaster.css.php
modules/mod_latestnewsenhancedextended/animationmaster.js.php
modules/mod_latestnewsenhancedextended/styles/style.css.php
modules/mod_latestnewsenhancedextended/styles/overall/original/style.css.php
and/or:
modules/mod_latestnewsenhancedextended/styles/overall/[other style here]/style.css.php
[other style here]: replace with the style you are using

If using calendars, add:
modules/mod_latestnewsenhancedextended/styles/calendar/original/style.css.php
and/or:
modules/mod_latestnewsenhancedextended/styles/calendar/[other style here]/style.css.php
[other style here]: replace with the style you are using

If using pagination only, add:
modules/mod_latestnewsenhancedextended/animations/justpagination/style.css.php
modules/mod_latestnewsenhancedextended/animations/justpagination/justpagination.js.php
If using animations, add:
modules/mod_latestnewsenhancedextended/animations/scroll/style.css.php
modules/mod_latestnewsenhancedextended/animations/scroll/scroll.js.php
and/or:
modules/mod_latestnewsenhancedextended/animations/[other animation here]/style.css.php
modules/mod_latestnewsenhancedextended/animations/[other animation here]/[other animation here].js.php
[other animation here]: replace with the animation you are using

Trombinoscope Contacts

This is no longer necessary starting with version 2.5.0. Files located in the /cache/mod_trombinoscopecontacts folder need permission instead.

modules/mod_trombinoscope/themes/stylemaster.css.php
modules/mod_trombinoscope/themes/style.css.php
modules/mod_trombinoscope/themes/stylemaster.js.php
modules/mod_trombinoscope/themes/original/style.css.php
and/or:
modules/mod_trombinoscope/themes/[other theme here]/style.css.php
[other theme here]: replace with the theme you are using

Trombinoscope Contacts Pro

This is no longer necessary starting with version 2.5.0. Files located in the /cache/com_trombinoscopecontactspro folder need permission instead.

Same as Trombinoscope Contacts plus

If using the Single Contact view, add:
components/com_trombinoscopeextended/assets/themes/contact/stylemaster.css.php
components/com_trombinoscopeextended/assets/themes/contact/style.css.php
components/com_trombinoscopeextended/assets/themes/contact/stylemaster.js.php
components/com_trombinoscopeextended/assets/themes/contact/original/style.css.php
and/or:
components/com_trombinoscopeextended/assets/themes/contact/[other theme here]/style.css.php
[other theme here]: replace with the theme you are using

If using the Trombinoscope view, add:
components/com_trombinoscopeextended/assets/themes/trombinoscope/stylemaster.css.php
components/com_trombinoscopeextended/assets/themes/trombinoscope/style.css.php
components/com_trombinoscopeextended/assets/themes/trombinoscope/stylemaster.js.php
components/com_trombinoscopeextended/assets/themes/trombinoscope/original/style.css.php
and/or:
components/com_trombinoscopeextended/assets/themes/trombinoscope/[other theme here]/style.css.php
[other theme here]: replace with the theme you are using

Truly Responsive Slides

This is no longer necessary starting with version 1.6.0. Files located in the /cache/mod_trulyresponsiveslides folder need permission instead.

modules/mod_trulyresponsiveslides/css/style.css.php
modules/mod_trulyresponsiveslides/css/stylemaster.css.php

Truly Responsive Slides Pro

This is no longer necessary starting with version 1.6.0. Files located in the /cache/mod_trulyresponsiveslidespro folder need permission instead.

modules/mod_trulyresponsiveslider/css/style.css.php
modules/mod_trulyresponsiveslider/css/stylemaster.css.php

Weblink Logos

This is no longer necessary starting with version 2.1.0. Files located in the /cache/mod_weblinklogos folder need permission instead.

modules/mod_weblinklogo/styles/stylemaster.css.php
modules/mod_weblinklogo/styles/style.css.php

Weblink Logos Pro

This is no longer necessary starting with version 2.1.0. Files located in the /cache/com_weblinklogospro folder need permission instead.

Same as Weblink Logos plus

components/com_weblinklogospro/assets/styles/directory/stylemaster.css.php
components/com_weblinklogospro/assets/styles/directory/style.css.php

Bare Responsive

templates/sywbareresponsive/css/styles.css.php
templates/sywbareresponsive/css/grid16.css.php

IIS servers

The previous settings will work on all Apache servers. When using IIS servers, matters get a little bit more complicated because they require the use of server tools to apply the proper file permissions. For help on rewriting rules from Apache to IIS, you can refer to this article for help.