Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-01-09 07:53:23

sandersonlindsay
Member
From: Whitehorse, Yukon
Registered: 2012-09-25
Posts: 26
Website

Unexpected error: Undefined variable: customStylesheetFilename

Hi gents,

I've recently just switched to Backlight (cool stuff!!!), and have come upon an error showing at the bottom of each page:

Unexpected error: Undefined variable: customStylesheetFilename in 89-page-1.1.1-1-2-menu_10-83-content-1.1.1-5-6.view.template on line 124

I've not done anything fancy, mainly sticking to default settings. Thoughts on how to resolve?

URL: www.andersonlindsay.com

Thanks,
Stephen

Offline

#2 2017-01-09 09:03:32

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Unexpected error: Undefined variable: customStylesheetFilename

In the Advanced Customisation section of the page template, are you using custom CSS? If so, is the file chosen still available?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2017-01-09 12:48:38

sandersonlindsay
Member
From: Whitehorse, Yukon
Registered: 2012-09-25
Posts: 26
Website

Re: Unexpected error: Undefined variable: customStylesheetFilename

Hi Rod,

I checked the Advanced Customization for the page template 'Backlight Standard Page' (which I'm using for all Pages), and confirmed that Customer Stylesheet is not enabled (enabled = off).

I toggled Custom Stylesheet on/off, but this also didn't resolve the issue.

Offline

#4 2017-01-14 05:58:29

sandersonlindsay
Member
From: Whitehorse, Yukon
Registered: 2012-09-25
Posts: 26
Website

Re: Unexpected error: Undefined variable: customStylesheetFilename

Any further insight on this issue?

Offline

#5 2017-01-14 06:45:17

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Unexpected error: Undefined variable: customStylesheetFilename

First thing to do is try clearing template cache. In Backlight, hover over Designer>Templates, then click on Clear Template Cache. Then click Clear

hard to tell though without seeing the template file referred to in the error.

go to your site via FTP and look in:
/backlight/data/designer/cache/ for the 89-page-1.1.1-1-2-menu_10-83-content-1.1.1-5-6.view.template file.
Open that file with a text editor and see what's on line 124.

In one of mine, right around line 124 (138 in mine), is a bit of code that looks for a custom css file. In yours, it's probably 124.

If after clearing template cache you still have problems, you might try dropping an email to Matt and referencing this topic.
You can use the contact form on the support page: http://theturninggate.net/support/


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#6 2017-01-14 16:19:05

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Unexpected error: Undefined variable: customStylesheetFilename

The variable may be getting checked whether it's being used or not. That probably shouldn't be the case, but even if not using custom CSS, ensure that whatever file name is used by the setting corresponds to an existing custom CSS file.


Matt

The Turning Gate, http://theturninggate.net

Offline

#7 2017-01-14 16:52:52

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Unexpected error: Undefined variable: customStylesheetFilename

I have checked the code, and this variable should only be referred to if already declared.  So I can't see why this notice is appearing for you.  Can you email me the template file that Rod described, using the Email link under my photo?

Offline

#8 2017-01-15 02:35:23

sandersonlindsay
Member
From: Whitehorse, Yukon
Registered: 2012-09-25
Posts: 26
Website

Re: Unexpected error: Undefined variable: customStylesheetFilename

Hi Ben,

The template file has been sent to your address.  Here's the code at line 124:

<?php
    if ($customStylesheetFilename && file_exists(realpath(CORE_DIR.'/../custom/css/').'/'.$customStylesheetFilename)) {
    echo '    <link rel="stylesheet" href="'.$customPath.'/css/'.$customStylesheetFilename.'" />';
    }
?>

Offline

#9 2017-01-15 02:36:55

sandersonlindsay
Member
From: Whitehorse, Yukon
Registered: 2012-09-25
Posts: 26
Website

Re: Unexpected error: Undefined variable: customStylesheetFilename

Matt,

I did ensure that the CSS files were on the server (backlight/custom/css); activating CSS for the chosen template and selecting one of these files from the pulldown didn't resolve the issue (checked after clearing history in Safari).

Offline

#10 2017-01-15 09:27:52

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Unexpected error: Undefined variable: customStylesheetFilename

Thanks for the file, Stephen.  The generated template file should include a line that creates the $customStylesheetFilename variable, before the line that's tries to use the variable.  This is irrespective of custom CSS or phplugin settings.  Your template file does not include the first line, which causes the error on the second.  I can see no reason in our code why the first line wouldn't exist in your template.

Can you try removing and re-uploading the directory backlight/modules/standard-page/  and see whether that fixes it?  If not, can you provide me with an FTP login so that I can look further into it?

Offline

#11 2017-01-15 12:13:31

sandersonlindsay
Member
From: Whitehorse, Yukon
Registered: 2012-09-25
Posts: 26
Website

Re: Unexpected error: Undefined variable: customStylesheetFilename

Hi Ben,

I removed the /Backlight/Modules/Standard-Page/ directory, and then re-uploaded. I erased history in Safari and the Quit. Unfortunately this did not resolve the issue.

I will send FTP login information to your email.

Thanks for your assistance!

Offline

#12 2017-01-15 20:44:20

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Unexpected error: Undefined variable: customStylesheetFilename

Hi Stephen, Thanks for the FTP access.  I believe that your re-upload actually did solve the problem, but that the old templates persisted.
I was able to view the error at http://www.andersonlindsay.com/galleries/landscape/, and it resolved itself after viewing again at http://www.andersonlindsay.com/gallerie … e/?recache.  The ?recache forces the template to be re-created.

Comparing the two versions of the template, which I was able to grab via FTP, showed that they differed in the code references for $customStylesheetFilename.  The new template included the line to set the variable that was missing in the old template.

To fix this across the board, log into the Backlight admin and visit Designer > Templates > Clear Template Cache.  You should no longer see that error anywhere after doing that.

Offline

#13 2017-01-16 12:21:06

sandersonlindsay
Member
From: Whitehorse, Yukon
Registered: 2012-09-25
Posts: 26
Website

Re: Unexpected error: Undefined variable: customStylesheetFilename

Right you are!

Thanks very much for your assistance in resolving this; I appreciate it.

Offline

Board footer

Powered by FluxBB