Shape 5

Joomla Free Templates => Design Control - Free => : rhart September 26, 2017, 01:19:52 AM



: Undefined variable: suffix_expand5
: rhart September 26, 2017, 01:19:52 AM
Hi,

my logs on the server are quickly filling up with the following errors:

PHP message: PHP Notice:  Undefined variable: suffix_expand5 in /home/..../domains/..../public_html/portal/templates/design_control/vertex/position_layouts.php on line 247

(replaced my domain with dots in above)

Any idea how this can be solved ?

Thanks!


: Re: Undefined variable: suffix_expand5
: mikek September 26, 2017, 03:04:03 PM
Hello,

Do you have a module with with extra spaces in the module class suffix?


: Re: Undefined variable: suffix_expand5
: rhart September 28, 2017, 12:31:03 PM
Hello,

Do you have a module with with extra spaces in the module class suffix?

Not that I'm aware off, is there a quick way to check for extra spaces ?

Actually when doing some further research it looks like it is caused by the -inset suffix. I've 3 modules on my homepage with this suffix and did get the error 3 times with every page visit. When removing the -inset from one of the modules only 2 errors are left.


: Re: Undefined variable: suffix_expand5
: rhart October 11, 2017, 05:44:00 AM
Hi,

anyone has any idea ?

Why is the -inset causing the PHP message: PHP Notice:  Undefined variable: suffix_expand5 in /home/..../domains/..../public_html/portal/templates/design_control/vertex/position_layouts.php on line 247 ?


: Re: Undefined variable: suffix_expand5
: mikek October 11, 2017, 08:17:38 AM
Hello,

I am not able to replicate this problem on any site that I am running, and I have full error reporting on with an -inset module present. Are you sure you are running Vertex 4.2?

I have also reviewed that file and I don't see any problems with it. The variable is defined at line 181:

$suffix_expand5 = $suffix_expand[5];

Also, that entire area of code will only run if you have a space in your module class. Make sure you have the module set as "-inset" with no space before or after:

if(strrpos($suffix," ") > 1) {

Finally this is just a warning message, it is not something that will effect the functionality of the site. You can turn off these messages in the Joomla global configuration under Server/Error Reporting - Set to "none".


: Re: Undefined variable: suffix_expand5
: rhart October 11, 2017, 08:32:22 AM
Hi,

Yes, I'm running Vertex 4.2

There is no space in the module class for or after.

Actually looking further at the code, $suffix_expand5 only seems to be defined when there is an space as it comes after line 174:  if(strrpos($suffix," ") > 1) {

but this if is closed on line 247 and goes into an else if

} else if (strlen($suffix) == 6 && strrpos($suffix,"-") == 0 && ctype_xdigit($suffix_expand5)) {
         $suffix_color = $suffix;
         $suffix = "";
      }

and here it goes wrong and the  $suffix_expand5 is not defined due to else if and this code is run when there is no space

So just guessing here that the } on line 247 is placed wrong and probably should be around line 251 after above code part ??


: Re: Undefined variable: suffix_expand5
: mikek October 11, 2017, 08:48:38 AM
Hello,

Ah, yes the bracket is just in the wrong location. Try the attached one.


: Re: Undefined variable: suffix_expand5
: rhart October 11, 2017, 08:58:32 AM
Yep, that solved it  8)


: Re: Undefined variable: suffix_expand5
: winstart October 13, 2017, 07:36:05 AM
download is not correct, this is the file that i download
its not the position_layout.php. Tried it several times


: Re: Undefined variable: suffix_expand5
: mikek October 13, 2017, 11:58:46 AM
Hello,

That file was just created the other day, it is correct and will fix the undefined error. If you're still having a problem please post a url.


: Re: Undefined variable: suffix_expand5
: Strozier95 July 09, 2018, 12:06:54 AM
How to fix undefined variable/index notice
Why does this happen?
How to fix "Undefined variable"?
How to fix "Undefined index"?
Output
Null coalescing operator


: Re: Undefined variable: suffix_expand5
: mikek July 09, 2018, 05:10:47 AM
Hello,

Make sure you are running the latest version of Vertex. Please also provide the exact error message you are seeing.