Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Disable your ad blocker to continue using our website.
Name-based URLs Demo
Undefined index: category_tree (1.0.8.16 with Name Based UR - Name-based URLs Demo
by Omar_one » Mon Aug 22, 2022 7:35 pm
Hello Rainer,
I get errors in the error_log file (1.0.8.16 with Name Based URLs Lite)
Code: Select all
PHP Notice: Undefined index: category_tree in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 722
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/XXXX/public_html/includes/system/override/name_based_urls.php:722
Stack trace:
#0 /home/XXXX/public_html/includes/system/override/name_based_urls.php(663): name_based_urls->need_redirect()
#1 /home/XXXX/public_html/includes/system/override/name_based_urls.php(107): name_based_urls->check_redirect()
#2 /home/XXXX/public_html/includes/system/override/name_based_urls.php(125): name_based_urls->__construct()
#3 /home/XXXX/public_html/includes/system/versioned/1.0.8.1/hooks.php(170): name_based_urls::listen_hrefLink(Array)
#4 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(131): hooks->chain('hrefLink', Array)
#5 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(157): Href->link()
#6 /home/XXXX/public_html/includes/actions/buy_now.php(23): Href::redirect(Object(Href))
#7 /home/XXXX/public_html/includes/classes/actions.php(19): Phoenix\Actions\buy_now::execute()
#8 /home/XXXX/public_html/ in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 722
Code: Select all
PHP Notice: Undefined index: category_tree in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 338
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/XXXX/public_html/includes/system/override/name_based_urls.php:338
Stack trace:
#0 /home/XXXX/public_html/includes/system/override/name_based_urls.php(200): name_based_urls->get_category_name('90')
#1 /home/XXXX/public_html/includes/system/override/name_based_urls.php(160): name_based_urls->parse_parameters('index.php', Array, '?')
#2 /home/XXXX/public_html/includes/system/override/name_based_urls.php(130): name_based_urls->href_link('index.php', Array, true)
#3 /home/XXXX/public_html/includes/system/versioned/1.0.8.1/hooks.php(170): name_based_urls::listen_hrefLink(Array)
#4 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(131): hooks->chain('hrefLink', Array)
#5 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(136): Href->link()
#6 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(140): Href->__toString()
Code: Select all
PHP Notice: Undefined index: category_tree in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 338
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/XXXX/public_html/includes/system/override/name_based_urls.php:338
Stack trace:
#0 /home/XXXX/public_html/includes/system/override/name_based_urls.php(200): name_based_urls->get_category_name('1')
#1 /home/XXXX/public_html/includes/system/override/name_based_urls.php(160): name_based_urls->parse_parameters('index.php', Array, '?')
#2 /home/XXXX/public_html/includes/system/override/name_based_urls.php(130): name_based_urls->href_link('index.php', Array, true)
#3 /home/XXXX/public_html/includes/system/versioned/1.0.8.1/hooks.php(170): name_based_urls::listen_hrefLink(Array)
#4 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(131): hooks->chain('hrefLink', Array)
#5 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(136): Href->link()
#6 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(140): Href->__toString()
#7 [internal function]: Href->jsonSerialize()
#8 /home/XXXX/publi in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 338
thank you for your help
Omar
-
Omar_one
- VIP Member
- Posts: 481
- Joined: Fri Oct 25, 2019 5:06 pm
-
Contact:
by raiwa » Tue Aug 23, 2022 6:40 am
Hi Omar,
I can't reproduce this error.
It might be to some modifications in your store.
Could you please try to find out on which page (URL) you get the error.
category_tree should be always available, I think.
-
raiwa
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
-
Contact:
by Omar_one » Tue Aug 23, 2022 3:56 pm
Hello Rainer,
I got it if I am going to products listing via horizontal menu (supporters code s03e09)
Br
Omar
-
Omar_one
- VIP Member
- Posts: 481
- Joined: Fri Oct 25, 2019 5:06 pm
-
Contact:
by raiwa » Fri Sep 16, 2022 10:56 am
Hi Omar,
Can you please report what produced this error and how you fixed it.
Thank you
Rainer
-
raiwa
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
-
Contact:
by Omar_one » Fri Sep 16, 2022 4:29 pm
Hi Rainer,
I don't know what produced the error, I don't remember if I have done anything for fix it ,, I will try to check when the error appear and from what ,
before the error appear when visiting the products listing via horizontal menu.. but now the issue not shown when do that ,,
I will let you know
Omar
-
Omar_one
- VIP Member
- Posts: 481
- Joined: Fri Oct 25, 2019 5:06 pm
-
Contact:
by Omar_one » Thu Sep 29, 2022 7:52 pm
the issue it was not from your module it was my modifications to show the subcategories on horizontal menu (supporters code s03e09), and the issue because not all the categories have subcategories, and edit my modifications and the error disappears.
sorry for the inconvenience
Thank you
Omar
-
Omar_one
- VIP Member
- Posts: 481
- Joined: Fri Oct 25, 2019 5:06 pm
-
Contact:
by raiwa » Fri Sep 30, 2022 7:43 am
It would be interesting to know what exact you changed to produce this error.
-
raiwa
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
-
Contact:
by Omar_one » Fri Sep 30, 2022 10:42 am
as it's supporters code, I will send to you the modified file via Pm, I still have issue (my fix not working) last night when I checked it there was no errors, but today the error appear again
-
Omar_one
- VIP Member
- Posts: 481
- Joined: Fri Oct 25, 2019 5:06 pm
-
Contact:
by Omar_one » Fri Jan 06, 2023 8:15 pm
Hello .
we still get same kind of those error (1.0.8.16)
Code: Select all
PHP Notice: Undefined index: category_tree in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 722
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/XXXX/public_html/includes/system/override/name_based_urls.php:722
Stack trace:
#0 /home/XXXX/public_html/includes/system/override/name_based_urls.php(663): name_based_urls->need_redirect()
#1 /home/XXXX/public_html/includes/system/override/name_based_urls.php(107): name_based_urls->check_redirect()
#2 /home/XXXX/public_html/includes/system/override/name_based_urls.php(125): name_based_urls->__construct()
#3 /home/XXXX/public_html/includes/system/versioned/1.0.8.1/hooks.php(170): name_based_urls::listen_hrefLink(Array)
#4 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(131): hooks->chain('hrefLink', Array)
#5 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(178): Href->link()
#6 /home/XXXX/public_html/includes/system/segments/application/parse_actions.php(17): Href::redirect(Object(Href))
#7 /home/XXXX/public_html/includes/application_top.php(42): require('/home/XXXX/p...')
#8 /home in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 722
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 589
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 625
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 681
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 685
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 715
PHP Notice: Undefined index: category_tree in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 722
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/XXXX/public_html/includes/system/override/name_based_urls.php:722
Stack trace:
#0 /home/XXXX/public_html/includes/system/override/name_based_urls.php(663): name_based_urls->need_redirect()
#1 /home/XXXX/public_html/includes/system/override/name_based_urls.php(107): name_based_urls->check_redirect()
#2 /home/XXXX/public_html/includes/system/override/name_based_urls.php(125): name_based_urls->__construct()
#3 /home/XXXX/public_html/includes/system/versioned/1.0.8.1/hooks.php(170): name_based_urls::listen_hrefLink(Array)
#4 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(131): hooks->chain('hrefLink', Array)
#5 /home/XXXX/public_html/includes/system/versioned/1.0.8.5/href.php(178): Href->link()
#6 /home/XXXX/public_html/includes/actions/buy_now.php(23): Href::redirect(Object(Href))
#7 /home/XXXX/public_html/includes/classes/actions.php(19): Phoenix\Actions\buy_now::execute()
#8 /home/XXXX/public_html/ in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 722
PHP Notice: Undefined offset: 1 in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 829
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 589
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 625
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 681
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 685
PHP Notice: Undefined index: path in /home/XXXX/public_html/includes/system/override/name_based_urls.php on line 715
Thank you in advance
Omar
-
Omar_one
- VIP Member
- Posts: 481
- Joined: Fri Oct 25, 2019 5:06 pm
-
Contact:
by raiwa » Sat Jan 07, 2023 8:31 am
Hi Omar,
This should be fixed in the version included in Phoenix 1.0.8.20 Pro.
Please add (already added in the newest demo version):
in: includes\system\override\name_based_urls.php
at the beginning of the get_category_name method about line 333:
Code: Select all
Guarantor::ensure_global('category_tree');
so it should be:
Code: Select all
function get_category_name(&$cID) {
global $db;
$full_cPath = $this->get_full_cPath($cID, $single_cID); // full cPath needed for uniformity
Guarantor::ensure_global('category_tree');
$cName = ((MODULE_NB_URLS_USE_SEO_TITLES === 'True' && !Text::is_empty($seo_title = $GLOBALS['category_tree']->get($single_cID, 'seo_title')))
and add the same about line 716 so it should be:
Code: Select all
if (($pStop = strpos($this->uri_parsed['path'], ".html")) !== FALSE) {
Guarantor::ensure_global('category_tree');
$forceRedirect = $this->VerifyLink($pStop, $pStart); //remove things that shouldn't be there
Best wishes
Rainer
-
raiwa
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
-
Contact: