How to debug Error: [] operator not supported for strings Topic is solved

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
quiquedcode
Joomla! Ace
Joomla! Ace
Posts: 1378
Joined: Thu Aug 18, 2005 10:11 pm
Location: San Juan - Argentina
Contact:

How to debug Error: [] operator not supported for strings

Post by quiquedcode » Tue Oct 23, 2018 12:30 am

Hi
I'm about to smash my head agains the wall
I've upgraded to PHP 7.x in a shared hosting and now I can't get out of this

Error: [] operator not supported for strings

I've read it is related to a php syntax change and now this causes that error.

1) I've set the php.ini error_reporting to E_ALL and the error does not show which file/line is causing it

2) I've disabled almost any 3rdparty extension in my site, without luck
https://imgur.com/4gvQoBb
Should I also delete/rename the disabled_extension's folder?

3) I've latest Joomla!. Downloaded and overwrote again with standard install just in case, without luck

Does anyone know a secure method to detect where is this error being caused and patch it accordingly?

Thanks a lot in advance
Last edited by imanickam on Thu Jun 04, 2020 2:50 am, edited 1 time in total.
Reason: Moved topic » from General Questions/New to Joomla! 3.x to Templates for Joomla! 3.x
@kabeza
Freelance Joomla/CodeIgniter Developer
Home: http://www.beza.com.ar

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1866
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: How to debug Error: [] operator not supported for strings

Post by SharkyKZ » Tue Oct 23, 2018 5:33 am

Enable Debug in Global Configuration.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27674
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: How to debug Error: [] operator not supported for strings

Post by Per Yngve Berg » Tue Oct 23, 2018 6:39 am

Raise the Error Report Level to 'Developer' in Global Configuration

quiquedcode
Joomla! Ace
Joomla! Ace
Posts: 1378
Joined: Thu Aug 18, 2005 10:11 pm
Location: San Juan - Argentina
Contact:

Re: How to debug Error: [] operator not supported for strings

Post by quiquedcode » Wed Oct 24, 2018 12:17 am

Hi
I've solved with a forum post in rockettheme forums
The solution is to edit some code

file:
templates\rt_xxx\html\mod_roknavmenu\themes\gantry-fusion\layout.php)

Change these 3 lines from:

$wrapper_css = '';
$ul_css = '';
$group_css = '';

To:

$wrapper_css = array();
$ul_css = array();
$group_css = array();

Now the site works with PHP 7.x

Thanks
@kabeza
Freelance Joomla/CodeIgniter Developer
Home: http://www.beza.com.ar

shenkwen
Joomla! Intern
Joomla! Intern
Posts: 92
Joined: Mon Sep 12, 2011 10:39 pm

Re: How to debug Error: [] operator not supported for strings

Post by shenkwen » Tue Jul 30, 2019 1:41 pm

I've had this and solved it by uprading Gantry 4 to the latest version.

But what obsessed me is how come this error doesn't give out filename and line number, it doesn't even get logged into the error log. For this one I was lucky because I was able to guess it was gantry that caused the problem, but what if I can't figure it out in the future? So what could be be preventing the error reporting mechanism from showing filename and line number is the more essential question.

User avatar
jjspelman
Joomla! Explorer
Joomla! Explorer
Posts: 269
Joined: Tue Apr 07, 2009 6:27 am
Location: Tampa, FL
Contact:

Re: How to debug Error: [] operator not supported for strings

Post by jjspelman » Thu Jun 04, 2020 1:54 am

Thank you VERY MUCH for posting your solution to this problem. I had the very same issue with a Gantry template when updating to PHP 7.3 and no idea what happened. Many, many thanks!

When gantry is updated I hope it will update those 3 lines of code, lol.


quiquedcode wrote:
Wed Oct 24, 2018 12:17 am
Hi
I've solved with a forum post in rockettheme forums
The solution is to edit some code

file:
templates\rt_xxx\html\mod_roknavmenu\themes\gantry-fusion\layout.php)

Change these 3 lines from:

$wrapper_css = '';
$ul_css = '';
$group_css = '';

To:

$wrapper_css = array();
$ul_css = array();
$group_css = array();

Now the site works with PHP 7.x

Thanks

User avatar
numinousmedia
Joomla! Ace
Joomla! Ace
Posts: 1567
Joined: Fri Dec 16, 2011 6:13 pm
Location: Barberton, OH
Contact:

Re: How to debug Error: [] operator not supported for strings

Post by numinousmedia » Fri Jun 12, 2020 3:42 pm

Thanks quiquedcode, your recommendation worked for me as well after my PHP 7.3 upgrade.
Ryan
Frontend Developer and Joomla Professional
Ethode Website Development: http://www.ethode.com
Personal Site: http://www.numinousmedia.com

User avatar
DanHouston
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Tue Oct 06, 2015 7:12 pm
Location: Houston, TX
Contact:

Re: How to debug Error: [] operator not supported for strings

Post by DanHouston » Sat Mar 06, 2021 1:42 am

quiquedcode wrote:
Wed Oct 24, 2018 12:17 am
Hi
I've solved with a forum post in rockettheme forums
The solution is to edit some code

file:
templates\rt_xxx\html\mod_roknavmenu\themes\gantry-fusion\layout.php)

Change these 3 lines from:

$wrapper_css = '';
$ul_css = '';
$group_css = '';

To:

$wrapper_css = array();
$ul_css = array();
$group_css = array();

Now the site works with PHP 7.x

Thanks
That just worked for me but the file path was templates/gantry/html/mod_roknavmenu/themes/gantry-dropdown/layout.php

THANKS SO MUCH!
Meeseeks are not born into this world fumbling for meaning! We are created to serve a singular purpose - building Joomla! sites - which we will go to any lengths to fulfill!


Post Reply

Return to “Templates for Joomla! 3.x”