Page 348 of 356 FirstFirst ... 248298338346347348349350 ... LastLast
Results 3,471 to 3,480 of 3558
  1. #3471
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by frumious View Post
    Is SBA still compatible with the latest ZC 1.5.8 ??
    So far. Has there been an issue when tested on your development site?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #3472
    Join Date
    Nov 2005
    Location
    France
    Posts
    582
    Plugin Contributions
    8

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    I've encountered an issue when testing the github version on a new installation of Zen Cart 1.5.8

    If i go to the admin page Catalog>Products with Attributes Stock (aka SBA)I get an SQL error warning.

    Error log shows

    Code:
    PHP Fatal error: 1060:Duplicate column name 'products_model' :: SELECT count(*) as totalttt FROM (SELECT DISTINCT pa.products_id, pd.products_name, p.products_quantity, p.products_model, p.products_image, p.products_type, p.master_categories_id, p.products_model FROM zen_products_attributes pa, zen_products_description pd, zen_products p WHERE pd.language_id=1 AND pa.products_id = pd.products_id AND pa.products_id = p.products_id  ORDER BY p.products_model ) countresults ==> (as called by) /Users/dev/Sites/localhost/sbatest/SBAAdin/includes/classes/split_page_results.php on line 220 <== in /Users/dev/Sites/localhost/sbatest/includes/classes/db/mysql/query_factory.php on line 667.
    The count query seems to be built using
    Code:
    private function numberRows(string $sql)
    in admin/includes/classes/split_page_results.php
    where the content of $sql is
    Code:
    SELECT DISTINCT pa.products_id, pd.products_name, p.products_quantity, p.products_model, p.products_image, p.products_type, p.master_categories_id, p.products_model FROM zen_products_attributes pa, zen_products_description pd, zen_products p WHERE pd.language_id=1 AND pa.products_id = pd.products_id AND pa.products_id = p.products_id ORDER BY p.products_model
    and yet the sql query built in admin/includes/classes/products_with_attributes_stock.php at line 348 is
    Code:
    $query_products =    "SELECT DISTINCT pa.products_id, pd.products_name, p.products_quantity, p.products_model, p.products_image, p.products_type, p.master_categories_id, " . $search_order_by . " FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p WHERE pd.language_id=" . (int)$language_id . " AND pa.products_id = pd.products_id AND pa.products_id = p.products_id " . $w . " ORDER BY " . $search_order_by . " " . $SearchRange;
    It seems that it is adding the order by content back into the main query.

    It's not the first time I have seen this since beginning testing on 1.5.8 as I had an instance on the front end last week where adding p.products_model to a query (can't recall which one at the moment) resulted in the same error being logged on the store side. I discovered that it was writing the sort by fields to the query used for count.
    This may be a bug in ZC core as I can't see any need to add additional fields other than what already existed in a query.

    Peerhaps some form of check is required so that it doesn't lead to duplicate fields being used in the count query that gets built.
    Managing Director of https://jsweb.uk

    Zen Cart developer since 2009

  3. #3473
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by strelitzia View Post
    I've encountered an issue when testing the github version on a new installation of Zen Cart 1.5.8

    If i go to the admin page Catalog>Products with Attributes Stock (aka SBA)I get an SQL error warning.

    Error log shows

    Code:
    PHP Fatal error: 1060:Duplicate column name 'products_model' :: SELECT count(*) as totalttt FROM (SELECT DISTINCT pa.products_id, pd.products_name, p.products_quantity, p.products_model, p.products_image, p.products_type, p.master_categories_id, p.products_model FROM zen_products_attributes pa, zen_products_description pd, zen_products p WHERE pd.language_id=1 AND pa.products_id = pd.products_id AND pa.products_id = p.products_id  ORDER BY p.products_model ) countresults ==> (as called by) /Users/dev/Sites/localhost/sbatest/SBAAdin/includes/classes/split_page_results.php on line 220 <== in /Users/dev/Sites/localhost/sbatest/includes/classes/db/mysql/query_factory.php on line 667.
    The count query seems to be built using
    Code:
    private function numberRows(string $sql)
    in admin/includes/classes/split_page_results.php
    where the content of $sql is
    Code:
    SELECT DISTINCT pa.products_id, pd.products_name, p.products_quantity, p.products_model, p.products_image, p.products_type, p.master_categories_id, p.products_model FROM zen_products_attributes pa, zen_products_description pd, zen_products p WHERE pd.language_id=1 AND pa.products_id = pd.products_id AND pa.products_id = p.products_id ORDER BY p.products_model
    and yet the sql query built in admin/includes/classes/products_with_attributes_stock.php at line 348 is
    Code:
    $query_products =    "SELECT DISTINCT pa.products_id, pd.products_name, p.products_quantity, p.products_model, p.products_image, p.products_type, p.master_categories_id, " . $search_order_by . " FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p WHERE pd.language_id=" . (int)$language_id . " AND pa.products_id = pd.products_id AND pa.products_id = p.products_id " . $w . " ORDER BY " . $search_order_by . " " . $SearchRange;
    It seems that it is adding the order by content back into the main query.

    It's not the first time I have seen this since beginning testing on 1.5.8 as I had an instance on the front end last week where adding p.products_model to a query (can't recall which one at the moment) resulted in the same error being logged on the store side. I discovered that it was writing the sort by fields to the query used for count.
    This may be a bug in ZC core as I can't see any need to add additional fields other than what already existed in a query.

    Peerhaps some form of check is required so that it doesn't lead to duplicate fields being used in the count query that gets built.
    I have a fix for this. Doing some final testing as iwhen the same fix was applied against the possibility of remnant entries in the sba table might exist, the response was not as expected or desired. I'm trying to determine a test case to force the expected response.

    The solution though to the above is not exactly what I would like to have to include, but it accomplished a few things. One it ensures that the query results include the field(s) necessary to support more stringent mysql server requirements, that the results are in the same sequence as they have been in the past (other than possibly having a duplicate of a necessary field, and it generally prevents creating a query that doesn't return any values, though it looks like someone would have to modify the code to create that condition.

    I expect to have the solution to the identified issue along with a fix to a minor issue within a few hours as I have something else to address. In the mean time.

    Thank you for identifying this issue that had not existed in previous Zen Cart versions.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #3474
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Several hours ago I pushed a commit to the master branch to address this issue. The operation of the split page code has been modified away from what has historically been suggested which now requires the associated query to be "right". Historically, the double up of result fields was not a problem; however, now it causes an issue to be raised. This may be why the other discussed query/page had an issue.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #3475
    Join Date
    Nov 2005
    Location
    France
    Posts
    582
    Plugin Contributions
    8

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    I've noticed that the 1_5_6 admin directory has modifications to attributes_controller.php, invoice.php, orders.php and packing slip.php and yet the 1_5_7 and 1_5_8 directories only modify packing slip.php.

    Are the modifications no longer required on 1.5.7 and 1.5.8, or were they inadvertently omitted from the relevant module directories?
    Managing Director of https://jsweb.uk

    Zen Cart developer since 2009

  6. #3476
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by strelitzia View Post
    I've noticed that the 1_5_6 admin directory has modifications to attributes_controller.php, invoice.php, orders.php and packing slip.php and yet the 1_5_7 and 1_5_8 directories only modify packing slip.php.

    Are the modifications no longer required on 1.5.7 and 1.5.8, or were they inadvertently omitted from the relevant module directories?
    The addition of notifiers in those more recent versions negated the need to incorporate modifications directly to those files. The associated actions are addressed in the observer(s).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #3477
    Join Date
    Nov 2005
    Location
    France
    Posts
    582
    Plugin Contributions
    8

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    I'm getting the following error logged when trying to add to cart

    Code:
    [18-Jan-2023 00:10:40 Europe/Paris] PHP Fatal error:  Uncaught Error: Cannot access protected property shoppingCart::$display_debug_messages in /Users/steph/Sites/localhost/tudorrose/includes/extra_cart_actions/stock_by_attributes.php:364
    Stack trace:
    #0 /Users/steph/Sites/localhost/tudorrose/includes/main_cart_actions.php(30): include()
    #1 /Users/steph/Sites/localhost/tudorrose/includes/init_includes/init_cart_handler.php(42): require('/Users/steph/Si...')
    #2 /Users/steph/Sites/localhost/tudorrose/includes/autoload_func.php(40): require_once('/Users/steph/Si...')
    #3 /Users/steph/Sites/localhost/tudorrose/includes/application_top.php(237): require('/Users/steph/Si...')
    #4 /Users/steph/Sites/localhost/tudorrose/index.php(25): require('/Users/steph/Si...')
    #5 {main}
      thrown in /Users/steph/Sites/localhost/tudorrose/includes/extra_cart_actions/stock_by_attributes.php on line 364
    
    [18-Jan-2023 00:10:40 Europe/Paris] Request URI: /index.php?main_page=product_info&cPath=1_2254_2255&products_id=12239&number_of_uploads=0&action=add_product, IP address: ::1
    --> PHP Fatal error: Uncaught Error: Cannot access protected property shoppingCart::$display_debug_messages in /Users/steph/Sites/localhost/tudorrose/includes/extra_cart_actions/stock_by_attributes.php:364
    Stack trace:
    #0 /Users/steph/Sites/localhost/tudorrose/includes/main_cart_actions.php(30): include()
    #1 /Users/steph/Sites/localhost/tudorrose/includes/init_includes/init_cart_handler.php(42): require('/Users/steph/Si...')
    #2 /Users/steph/Sites/localhost/tudorrose/includes/autoload_func.php(40): require_once('/Users/steph/Si...')
    #3 /Users/steph/Sites/localhost/tudorrose/includes/application_top.php(237): require('/Users/steph/Si...')
    #4 /Users/steph/Sites/localhost/tudorrose/index.php(25): require('/Users/steph/Si...')
    #5 {main}
      thrown in /Users/steph/Sites/localhost/tudorrose/includes/extra_cart_actions/stock_by_attributes.php on line 364.
    Any suggestions?
    Managing Director of https://jsweb.uk

    Zen Cart developer since 2009

  8. #3478
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by strelitzia View Post
    I'm getting the following error logged when trying to add to cart

    Code:
    [18-Jan-2023 00:10:40 Europe/Paris] PHP Fatal error:  Uncaught Error: Cannot access protected property shoppingCart::$display_debug_messages in /Users/steph/Sites/localhost/tudorrose/includes/extra_cart_actions/stock_by_attributes.php:364
    Stack trace:
    #0 /Users/steph/Sites/localhost/tudorrose/includes/main_cart_actions.php(30): include()
    #1 /Users/steph/Sites/localhost/tudorrose/includes/init_includes/init_cart_handler.php(42): require('/Users/steph/Si...')
    #2 /Users/steph/Sites/localhost/tudorrose/includes/autoload_func.php(40): require_once('/Users/steph/Si...')
    #3 /Users/steph/Sites/localhost/tudorrose/includes/application_top.php(237): require('/Users/steph/Si...')
    #4 /Users/steph/Sites/localhost/tudorrose/index.php(25): require('/Users/steph/Si...')
    #5 {main}
      thrown in /Users/steph/Sites/localhost/tudorrose/includes/extra_cart_actions/stock_by_attributes.php on line 364
    
    [18-Jan-2023 00:10:40 Europe/Paris] Request URI: /index.php?main_page=product_info&cPath=1_2254_2255&products_id=12239&number_of_uploads=0&action=add_product, IP address: ::1
    --> PHP Fatal error: Uncaught Error: Cannot access protected property shoppingCart::$display_debug_messages in /Users/steph/Sites/localhost/tudorrose/includes/extra_cart_actions/stock_by_attributes.php:364
    Stack trace:
    #0 /Users/steph/Sites/localhost/tudorrose/includes/main_cart_actions.php(30): include()
    #1 /Users/steph/Sites/localhost/tudorrose/includes/init_includes/init_cart_handler.php(42): require('/Users/steph/Si...')
    #2 /Users/steph/Sites/localhost/tudorrose/includes/autoload_func.php(40): require_once('/Users/steph/Si...')
    #3 /Users/steph/Sites/localhost/tudorrose/includes/application_top.php(237): require('/Users/steph/Si...')
    #4 /Users/steph/Sites/localhost/tudorrose/index.php(25): require('/Users/steph/Si...')
    #5 {main}
      thrown in /Users/steph/Sites/localhost/tudorrose/includes/extra_cart_actions/stock_by_attributes.php on line 364.
    Any suggestions?
    Not in love with my solution, but it works. Will post that shortly. While reviewing logs, also identified some other minor issues that got logged in my testing yesterday. That will be a separate correction if not multiple separate ones.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #3479
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by mc12345678 View Post
    Not in love with my solution, but it works. Will post that shortly. While reviewing logs, also identified some other minor issues that got logged in my testing yesterday. That will be a separate correction if not multiple separate ones.
    First commit pushed. Able to add product to the cart.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #3480
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    my apologies if you've already addressed this but it's so basic. After uploading files, the catalog still works but the admin is showing a 500 error. Now granted this server is driving me crazy and this might not be typical but there is no error log to track this. v1.5.8, php 8.1
    The full-time Zen Cart Guru. WizTech4ZC.com

 

 

Similar Threads

  1. Problems with addon: Dynamic Drop Downs for Stock By Attribute
    By Dunk in forum All Other Contributions/Addons
    Replies: 56
    Last Post: 30 Apr 2014, 07:55 PM
  2. MySQL Problem with Product with Attribute Stock addon
    By rtwingfield in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Sep 2011, 03:35 PM
  3. Hide Zero Quantity Attributes with attribute-stock addon
    By leevil123 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Feb 2010, 05:06 PM
  4. Replies: 4
    Last Post: 22 Jan 2010, 10:43 PM
  5. Price Products in the grid by 'Stock by Attribute' addon?
    By Salixia in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Oct 2009, 06:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR