Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2009
    Posts
    45
    Plugin Contributions
    0

    Default v156a Delete Product From Category Error

    Since upgrading to v156a, when I try to delete a product from a category (when the product is present in multiple categories), the list of categories with tick boxes on the right side has an error. The first category in the list, is displayed again next to the second category, like so:

    Italian Murano Glass > Murano Sommerso
    Italian Murano Glass > Murano SommersoItalian Murano Glass > Murano Faceted

    Where it should be:

    Italian Murano Glass > Murano Sommerso
    Italian Murano Glass > Murano Faceted

    When I open the file: admin/category_product_listing.php I am told it has a syntax error on line 155. This file has not been edited and is not affected by any plugins. The area of code is as follows:

    154 $cascaded_prod_id_for_delete = $category_product['products_id'];
    155 $cascaded_prod_cat_for_delete = [];
    156 $cascaded_prod_cat_for_delete[] = $categories[$i]['id'];


    I am using php version 7.3. Changing the version back to 7.0 seems to have no effect on the error.
    20th Century Glass - Antique & Collectable Glass Store

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: v156a Delete Product From Category Error

    Can't repro in PHP 7.2.13. Please try changing line 155 from

    $cascaded_prod_cat_for_delete = [];

    to

    $cascaded_prod_cat_for_delete = array();
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

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

    Default Re: v156a Delete Product From Category Error

    I had seen this issue, but hadn't documented the occurrence so couldn't exactly remember how to replicate but yes there was a display issue associated with linked product and selecting one of the actions where normally expected to place a check mark for the one(s) to keep or delete depending on the action.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: v156a Delete Product From Category Error

    Looking again I see the display issue now (but not the error).

    PR: https://github.com/zencart/zencart/pull/2109
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Aug 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: v156a Delete Product From Category Error

    Quote Originally Posted by swguy View Post
    Can't repro in PHP 7.2.13. Please try changing line 155 from

    $cascaded_prod_cat_for_delete = [];

    to

    $cascaded_prod_cat_for_delete = array();
    Tried this, doesn't seem to have made any difference, apart from the syntax error warning went away, but I got another instead for line 1019:

    1018 <?php
    1019 $heading = [];
    1020 $contents = [];
    20th Century Glass - Antique & Collectable Glass Store

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: v156a Delete Product From Category Error

    Quote Originally Posted by WayneStephens View Post
    Tried this, doesn't seem to have made any difference, apart from the syntax error warning went away, but I got another instead for line 1019:

    1018 <?php
    1019 $heading = [];
    1020 $contents = [];
    Yes, this is the same issue.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  7. #7
    Join Date
    Aug 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: v156a Delete Product From Category Error

    Thanks for fix on GitHub, working fine now
    20th Century Glass - Antique & Collectable Glass Store

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: v156a Delete Product From Category Error

    @WayneStephens,

    I think that the syntax-error warnings you're getting in your code-editor application are a result of your code editor not being set to expect newer PHP version syntax.
    Those lines you quoted would indeed be bad for PHP 5.2, but are fine for newer PHP versions (and indeed expected).
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: v156a Delete Product From Category Error

    LOL that didn't even occur to me. I was wondering why I couldn't find a switch to disable short array syntax.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  10. #10
    Join Date
    Aug 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: v156a Delete Product From Category Error

    Quote Originally Posted by DrByte View Post
    @WayneStephens,

    I think that the syntax-error warnings you're getting in your code-editor application are a result of your code editor not being set to expect newer PHP version syntax.
    Those lines you quoted would indeed be bad for PHP 5.2, but are fine for newer PHP versions (and indeed expected).
    Ah sorry I should have thought of that, makes sense, the program is a couple of years old, thanks!
    20th Century Glass - Antique & Collectable Glass Store

 

 

Similar Threads

  1. Replies: 4
    Last Post: 3 Jan 2019, 11:32 PM
  2. Replies: 0
    Last Post: 15 Dec 2018, 02:31 PM
  3. Replies: 6
    Last Post: 22 Dec 2016, 05:49 AM
  4. MySQL error: DELETE FROM zen_uti_attributes WHERE ...
    By shotgun in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 29 Nov 2009, 08:39 PM
  5. Delete Sub category image from product page
    By pb4 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Mar 2009, 05:02 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