Name-based URLs Demo

Undefined index: category_tree (1.0.8.16 with Name Based UR - Name-based URLs Demo

Re: Undefined index: category_tree (1.0.8.16 with Name Based

by Omar_one » Sun Jan 08, 2023 11:30 am

thank you Rainer, will the pro version fix the mutlilanguage shop, example some products have same name on both language? s06e02 - XML Sitemaps will work fine with mutlilanguage ?
we are still on 1.0.8.16 and as you post while ago it will work on 1.0.8.19 , so I am planning to update to 1.0.8.20 next week , and will buy the pro version ,, is those changes will added to pro/lite version?

thank you
Omar
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: Undefined index: category_tree (1.0.8.16 with Name Based

by raiwa » Sun Jan 08, 2023 12:43 pm

Yes to all
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
raiwa
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Contact:

Re: Undefined index: category_tree (1.0.8.16 with Name Based

by Omar_one » Sun Jan 08, 2023 3:22 pm

Code: Select all

PHP Notice:  Undefined offset: 1 in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 836
PHP Notice:  Undefined offset: 3 in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 816
Lines 809-820

Code: Select all

 function parse_path($path_info) {
   $tmp= [];
    $tmp = @explode('/', $path_info);
    if ( count($tmp) > 2 ) {
      $container = [];
      for ($i=0, $n=count($tmp); $i<$n; $i++) {
        $container[] = $tmp[$i] . '=' . $tmp[$i+1];
        $i++;
      }
      return @implode('&', $container);
    } else {
      return @implode('=', $tmp);
    }
  } # end function parse_path
lines 829-851

Code: Select all

  function do_redirect() {

    $p = @explode('&', $this->uri_parsed['query']);
    $params =  [];
    $tmp= [];
    foreach( $p as $index => $value ){
      $tmp = @explode('=', $value);
      $params[$tmp[0]] = $tmp[1];
    } # end foreach( $params as $var => $value )
    $url = $this->href_link($this->uri_parsed['path'], $params);

    switch(true){
      case (MODULE_NB_URLS_USE_SEO_REDIRECT == 'True'):
        header($_SERVER['SERVER_PROTOCOL'] . " 301 Moved Permanently");
        $url = str_replace('&amp;', '&', $url);
        header("Location: $url"); // redirect...bye bye
        break;
      default:
        $this->attributes['SEO_REDIRECT']['REDIRECT_URL'] = $url;
        break;
    } # end switch
  } # end function do_redirect
} # end class
both where I added

Code: Select all

 $tmp= [];
do you think

Code: Select all

$tmp= array();
would fix
"undefined variable ?
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: Undefined index: category_tree (1.0.8.16 with Name Based

by raiwa » Sun Jan 08, 2023 3:39 pm

It's not undefined variable, it's undefined offset.
$tmp= []; and $tmp= array(); is exact the same. Adding them do not fix anything.

Please wait for the update release. For now it's not critical. These are all notices, not errors.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
raiwa
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Contact:

Re: Undefined index: category_tree (1.0.8.16 with Name Based

by Omar_one » Sun Jan 08, 2023 4:21 pm

Thank you
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Contact: