View Full Version : CSS.php Error
coolhula
03-02-2014, 12:57 PM
Whenever I try and edit a style on Style Manager I get this error:
Warning: Invalid argument supplied for foreach() in ..../admincp/css.php on line 451
This is my code for the surrounding area 451:
448 - // get style options
449 - $stylevars = array();
450 - $stylevar_info = array();
451 - foreach($template_cache['stylevar'] AS $title => $template)
452 - {
453 - $stylevars["$title"] = $template['template'];
454 - $stylevar_info["$title"] = $template['styleid'];
455 - }
Is this a common problem with vb4 and if so does anyone know a fix for it?
Lynne
03-02-2014, 06:30 PM
What version vB are you using? And what version of PHP on your site?
coolhula
03-02-2014, 07:34 PM
vB 4.2.2
PHP Version 5.3.3-7+squeeze17
Lynne
03-02-2014, 10:09 PM
Have you tried adding this line to your config.php file under the <?php line:
define('SKIP_ALL_ERRORS', true);
coolhula
03-02-2014, 10:16 PM
Just tried that, still have the same error.
Lynne
03-03-2014, 12:14 AM
Try disabling your modifications/plugins and see if you still have this problem.
Note: To temporarily disable the plugin system, edit includes/config.php and add this line right under <?php
define('DISABLE_HOOKS', true);
coolhula
03-03-2014, 10:42 AM
The error is still there. Its rather annoying, it doesn't let me save any edits I make to the main CSS.
ozzy47
03-03-2014, 10:56 AM
Are you getting this error by going to, ACP --> Style Manager --> Main CSS?
coolhula
03-03-2014, 02:49 PM
Yes I am
ozzy47
03-03-2014, 04:32 PM
Then that is the problem, that is obsolete in vB4, you need to edit the style in stylevars, that page you are viewing is just there as a layover from the vB3 series.
coolhula
03-03-2014, 09:21 PM
Ok, lastly I get this error when I go to Community - albums:
https://vborg.vbsupport.ru/external/2014/03/68.png
Do you know a fix for this?
Lynne
03-03-2014, 09:31 PM
Did you add that SKIP_ALL_ERRORS line like I said to? That should remove those warnings.
coolhula
03-03-2014, 09:33 PM
I tried both your other solutions, neither worked.
Zachery
03-03-2014, 09:34 PM
Try re-downloading the 4.2.2 package, and then reuploading the files. Then, make sure that the skip line is included.
coolhula
03-03-2014, 11:46 PM
No worries, managed to get it working. Thanks for all your help!
ozzy47
03-03-2014, 11:50 PM
Care to share what you did, incase someone else runs into the issue?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.