Search…

X3 Photo Gallery Support Forums

Search…
 
geektech
Topic Author
Posts: 8
Joined: 06 May 2015, 08:01

0.18 - Errors

12 Aug 2016, 09:33

but there is some errors 

[09-Aug-2016 23:33:23 UTC] PHP Notice:  Undefined variable: hide in /x3/app/menu.inc.php on line 96
[09-Aug-2016 23:33:23 UTC] PHP Notice:  Undefined variable: hide in /x3/app/menu.inc.php on line 96

Stack trace:
#0 /x3/app/parsers/template-parser.inc.php(14): TemplateParser::find_template('./templates/pag...')
#1 /x3/app/asset-types/page.inc.php(61): TemplateParser::parse(Array, './templates/pag...')
#2 /x3/app/cache.inc.php(199): Page->parse_template()
#3 /x3/app/stacey.inc.php(103): Cache->create('custom/404', './content/custo...', true)
#4 /x3/app/stacey.inc.php(209): Stacey->render('./content/custo...', './templates/pag...')
#5 /x3/app/stacey.inc.php(368): Stacey->create_page('./content/custo...')
#6 /x3/app/stacey.inc.php(343): Stacey->not_found()
#7 /x3/index.php(28): Stacey->__construct(Array)
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: 0.18 - Errors

12 Aug 2016, 12:47

This is a local server? Although I am not sure why you see this notice, it is just a notice and not an error. Notices can be suppressed. If it is not a local server, please provide a link ...

Any chance you have upgraded at some point, or done some X2 -> X3 upgrade? The notice is not logical. I need to see your PHP version and server, to try to understand why you get the notice in the first place.
Technical Details

menu.inc.php:
Code
# line 7, self::$hide gets defined in the class
static $hide = false;

# From line 77, $hide var clearly will get assigned, even if to an empty value:
if(self::$hide === false){
  global $x3_config;
    $hide = $x3_config['settings']['hide_images'];
    if($hide === 'double') {
    self::$hide = '(?!__)';
    } else if($hide === 'single'){
    self::$hide = '(?!_)';
    } else {
    self::$hide = '';
    }
  }
  $hide = self::$hide;

# $hide var used in same function (scope) on line 96:
return preg_match('/^' . $hide . '(?:[^.\n]*\.)*(?<!^preview\.|^thumb\.)(?:jpe?g|png|gif)$/i', basename($val));
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: 0.18 - Errors  Topic is solved

07 Sep 2016, 13:44

geektech wrote:[09-Aug-2016 23:33:23 UTC] PHP Notice:  Undefined variable: hide in /x3/app/menu.inc.php on line 96
This "Notice" has now been fixed as of X3 Release [0.19].