Claudia Posted September 1 Share Posted September 1 I keep getting this [01-Sep-2024 02:00:41 America/Louisville] PHP Warning: Undefined array key "cat_parse" in /home/cambarga/public_html/classes/catalogue.class.php on line 281 What to do if anything .... Thanks Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 1 Share Posted September 1 Please use an external database utility to examine the database table CubeCart_category. The latest versions of CubeCart will have put a new column in this table named 'cat_parse'. (TINYINT, unsigned, default 0) Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 1 Author Share Posted September 1 It's there but the type is int(10) Should I change it? Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 1 Share Posted September 1 I think that would not be necessary. But now we need to find out why that column and its value is not becoming available at line 281. In /classes/catalogue.class.php, near line 757, find: if (($result = $GLOBALS['db']->select('CubeCart_category', false, array('cat_id' => $category_id, 'status' => 1))) !== false) { Please determine if this statement is exactly as is shown above. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 1 Author Share Posted September 1 Here's my code: if (isset($catData) && is_array($catData)) { if($catData['cat_parse']=='1') { $catData['cat_desc'] = $GLOBALS['smarty']->fetch('string:'.$catData['cat_desc']); } $vars['category'] = $catData; Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 1 Share Posted September 1 In /classes/catalogue.class.php, near line 757, find: if (($result = $GLOBALS['db']->select('CubeCart_category', false, array('cat_id' => $category_id, 'status' => 1))) !== false) { Please determine if this statement is exactly as is shown above. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 1 Author Share Posted September 1 yes it is I just reuploaded the file with the stock file for 6.5.6 - and I'll see if I get any warnings. In the admin error log it says category discount table doesn't exist, but I see it has been addressed in GitHub I'll go ahead and add it Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 1 Share Posted September 1 Please enable CubeCart's debug mode, if not already. In the file /classes/catalogue.class.php, near line 273: Find: $catData = $this->_categoryData; Change to: $catData = $this->_categoryData; $GLOBALS['debug']->debugMessage('<pre>'.print_r($catData,true).'</pre>'); View a category page. CubeCart's Debug Console will popup(*). Scroll to the bottom to see the Debug Messages section. Verify that [cat_parse] is an element of the array. * If not having given permission before, the browser may complain about a page wanting to display a popup window. Let it do so. You may need to close the popup window and reload the category page. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 2 Author Share Posted September 2 It's there: Debug Messages: [0] Array ( [cat_id] => 22 [cat_name] => Beer and Liquor [cat_desc] => [cat_parent_id] => 0 [cat_image] => 502 [per_ship] => 0.00 [item_ship] => 0.00 [item_int_ship] => 0.00 [per_int_ship] => 0.00 [hide] => 0 [seo_meta_title] => Beer and Liquor Collectibles - CamBargainStore [seo_meta_description] => Buy all your vintage beer and liquor collectibles here. Great products at low prices. More to come! [seo_meta_keywords] => [priority] => 12 [status] => 1 [cat_hier_position] => 0 [cat_parse] => 0 ) Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 2 Share Posted September 2 So, if $catData at line 273 has an array element 'cat_parse', but the $catData at line 281 does not, the only thing between them is a hook. As an experiment, at line 279 (should be a blank line), add the debugMessage statement that was added to line 273. If 'cat_parse' does not show up in the second showing in CubeCart's Debug Console, Debug Messages section, then we know that the hook is causing interference. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 2 Author Share Posted September 2 It's there too: Array ( [cat_id] => 67 [cat_name] => Banks and Bells [cat_desc] => [cat_parent_id] => 0 [cat_image] => 860 [per_ship] => 0.00 [item_ship] => 0.00 [item_int_ship] => 0.00 [per_int_ship] => 0.00 [hide] => 0 [seo_meta_title] => Banks and Bells [seo_meta_description] => Buy your vintage and collectible banks and bells at low prices with fast shipping [seo_meta_keywords] => [priority] => 11 [status] => 1 [cat_hier_position] => 0 [cat_parse] => 0 ) This is my cPanel error log [01-Sep-2024 19:22:02 America/Louisville] PHP Warning: Invalid Security Token in /home/xx/public_html/classes/sanitize.class.php on line 162 [01-Sep-2024 19:22:02 America/Louisville] PHP Warning: Undefined global variable $_GET in /home/xx/public_html/includes/functions.inc.php on line 218 [01-Sep-2024 19:22:03 America/Louisville] PHP Warning: Invalid Security Token in /home/xx/public_html/classes/sanitize.class.php on line 162 [01-Sep-2024 19:22:03 America/Louisville] PHP Warning: Undefined global variable $_GET in /home/xx/public_html/includes/functions.inc.php on line 218 [01-Sep-2024 22:00:16 America/Louisville] PHP Warning: Undefined array key "cat_parse" in /home/xx/public_html/classes/catalogue.class.php on line 281 [01-Sep-2024 23:49:38 America/Louisville] PHP Warning: Undefined array key "cat_parse" in /home/xx/public_html/classes/catalogue.class.php on line 281 [02-Sep-2024 00:29:08 America/Louisville] PHP Warning: Undefined array key "product_id" in /home/xx/public_html/modules/plugins/Product_Appearances/hooks/admin.product.tabs.php on line 5 [02-Sep-2024 02:07:34 America/Louisville] PHP Warning: Undefined array key "cat_parse" in /home/xx/public_html/classes/catalogue.class.php on line 281 [02-Sep-2024 03:06:09 America/Louisville] PHP Warning: Undefined array key "cat_parse" in /home/xx/public_html/classes/catalogue.class.php on line 281 [02-Sep-2024 04:30:28 America/Louisville] PHP Warning: Undefined array key "cat_parse" in /home/xx/public_html/classes/catalogue.class.php on line 281 [02-Sep-2024 05:32:26 America/Louisville] PHP Warning: Undefined array key "cat_parse" in /home/xx/public_html/classes/catalogue.class.php on line 281 [02-Sep-2024 05:34:56 America/Louisville] PHP Warning: Security Warning: Illegal array key "@zdi/Powershell" was detected and was removed. in /home/xxx/public_html/classes/sanitize.class.php on line 121 [02-Sep-2024 12:58:32 America/Louisville] PHP Warning: Undefined array key "cart_order_id" in /home/xxx/public_html/classes/cubecart.class.php on line 2796 Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 2 Share Posted September 2 So, you added the debugMessage statement at line 279? Then two lines of code later it's gone? That inconceivable! Unless your "cPanel Error Log" is collecting errors from an installation of CubeCart that is other than what you are editing. The first two pair of errors have been reported (see issue #3572). The Product Appearances was discussed via PM. As for the last error, line 2796 of cubecart.class.php must be different than stock in your set of files. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 2 Author Share Posted September 2 "So, you added the debugMessage statement at line 279? Then two lines of code later it's gone? " These errors were before I did the debug? The Product Appearances was discussed via PM. I got this error after I made the edit. I checked. The edit is there I'll check my cubecart.class file Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 2 Author Share Posted September 2 cubecart.class Line 2197 Red box with x: syntax error, unexpected "=" The only difference between stock and mine is this edit I made many versions ago starting at line 2644: $delivery = array( 'url' => $url, 'method' => $order['ship_method'], 'product' => $order['ship_product'], 'tracking' => $order['ship_tracking'], 'all_ship_date' => $order['all_ship_date'], 'venue_ship_product' => $order['venue_ship_product'], 'all_shipping_used' => $order['all_shipping_used'], 'date' => (!empty($order['ship_date']) && $order['ship_date']!=='0000-00-00') ? formatDispatchDate($order['ship_date']) : '' ); } unset($ship_class); } else { $delivery = array( 'url' => filter_var($order['ship_tracking'], FILTER_VALIDATE_URL) ? $order['ship_tracking'] : '', 'method' => $order['ship_method'], 'product' => $order['ship_product'], 'tracking' => $order['ship_tracking'], 'all_ship_date' => $order['all_ship_date'], 'venue_ship_product' => $order['venue_ship_product'], 'all_shipping_used' => $order['all_shipping_used'], 'date' => (!empty($order['ship_date']) && $order['ship_date']!=='0000-00-00') ? formatDispatchDate($order['ship_date']) : '' ); } Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 2 Share Posted September 2 Having made the edits to synchronize lines of code to your file, line 2796 is: $cart_order_id = Order::validOrderId(trim($_GET['cart_order_id'])) ? trim($_GET['cart_order_id']) : ''; A few lines of code just above it, the statements are using $_REQUEST. So, maybe try this edit: $cart_order_id = Order::validOrderId(trim($_REQUEST['cart_order_id'])) ? trim($_REQUEST['cart_order_id']) : ''; We had discussed line 2197 earlier. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 2 Author Share Posted September 2 We had discussed line 2197 earlier. -- We did? You have a better memory than me LOL I'll try the edit above Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 2 Share Posted September 2 (edited) In: https://forums.cubecart.com/topic/59315-syntax-error-in-classescubecartclassphp/ Looking at (your edited file's) line 2796 more closely, this happens when a non-logged-in customer wants to check on the status of an order. When first presented with the Order Lookup form, the Order Number is taken from the web address given to the customer in their email, "/index.php?_a=vieworder&cart_order_id=xxxx". If a visitor just happens to want to visit "/index.php?_a=vieworder" without providing the cart_order_id part, that will generate this error. How often will that happen? Can you list the steps needed to get this error on demand -- without actually munging the web address? So, changing $_GET to $_REQUEST won't help. Try this edit: $cart_order_id = Order::validOrderId(trim($_GET['cart_order_id'] ?? '')) ? trim($_GET['cart_order_id'] ?? '') : ''; Edited September 2 by bsmither Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.