Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2008
    Posts
    150
    Plugin Contributions
    0

    Default Error when clicking link in Product Stock Report

    I received the following error when clicking one of the item links in the Product Stock Report.
    #1 require() called at [/home/.../public_html/my shop/my admin/product_music.php:12]
    #2 require(/home/.../public_html/my shop/my admin/product_music.php) called at [/home/.../public_html/my shop/my admin/index.php:11]
    --> PHP Warning: require(includes/modules/prod_cat_header_code.php): failed to open stream: No such file or directory in /home/.../public_html/my shop/my admin/product_music.php on line 12.

    [02-Jun-2021 22:06:37 America/New_York] PHP Fatal error: require(): Failed opening required 'includes/modules/prod_cat_header_code.php' (include_path='.:/opt/alt/php71/usr/share/pear') in /home/.../public_html/my shop/my admin/product_music.php on line 12
    Apparently prod_cat_header_code.php has been a deleted file in ZC since v1.5.5f, and is not present in my v1.5.7c. Admin/product_music.php has also since been deleted, but I have it present in my admin directory (not sure why or if it's necessary at all).
    If I remove
    Code:
      require(DIR_WS_MODULES . 'prod_cat_header_code.php');
    from the file, then it will correctly direct me to the edit item form, but all of the defined field label names are stripped out.
    Removing the admin/product_music.php file completely stops the blank page and associated error, but the link takes me back to my admin home page, not the edit product page. The Most-Viewed Products report links are also behaving the same.
    Do I need the admin/product_music.php file? If not, and I delete it, how can I get the report links to take me to the edit product page? Thank you.

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

    Default Re: Error when clicking link in Product Stock Report

    Try replacing your copy of admin/stats_products_lowstock.php with one from a fresh download - sounds like you may have an old copy.
    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
    Apr 2008
    Posts
    150
    Plugin Contributions
    0

    Default Re: Error when clicking link in Product Stock Report

    Quote Originally Posted by swguy View Post
    Try replacing your copy of admin/stats_products_lowstock.php with one from a fresh download - sounds like you may have an old copy.
    Thank you. Unfortunately a fresh copy of stats_products_lowstock.php wasn't the problem. I removed the admin/product_music.php file completely, and installed the most recent stat files, but all the report links still return me to the admin home page.

  4. #4
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Error when clicking link in Product Stock Report

    Quote Originally Posted by Joseph M View Post
    Removing the admin/product_music.php file completely stops the blank page and associated error, but the link takes me back to my admin home page, not the edit product page. The Most-Viewed Products report links are also behaving the same.
    Do I need the admin/product_music.php file? If not, and I delete it, how can I get the report links to take me to the edit product page? Thank you.
    Although I don't use the low stock report I thought I would check this out. On a site upgraded to ZCv1.57c, in Product Stock Report


    for a product with document type 1 (product_general) the link is:

    index.php?cmd=product&product_type=1&cPath=32_26&pID=253&action=new_product

    and clicking it takes me to the correct product edit page.


    for a product with document type 4 (document_product) the link is:

    index.php?cmd=document_product&product_type=4&cPath=36_39&pID=362&action=new_pro duct

    and clicking it takes me to the admin home page - no error logs.


    Edit: not sure why there's a space in 'new_product' it wasn't there when I created this post


    BTW, I think Admin > Reports > Products Low Stock should be renamed to reflect the actual title of the page i.e. Product Stock Report
    Simon

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Error when clicking link in Product Stock Report

    I see that this has been addressed for ZCv1.58, I'll try it when I have time.

    https://github.com/zencart/zencart/c...7af601943107fa

    I should have checked GitHub before posting.
    Simon

  6. #6
    Join Date
    Apr 2008
    Posts
    150
    Plugin Contributions
    0

    Default Re: Error when clicking link in Product Stock Report

    Quote Originally Posted by simon1066 View Post
    Although I don't use the low stock report I thought I would check this out. On a site upgraded to ZCv1.57c, in Product Stock Report


    for a product with document type 1 (product_general) the link is:

    index.php?cmd=product&product_type=1&cPath=32_26&pID=253&action=new_product

    and clicking it takes me to the correct product edit page.


    for a product with document type 4 (document_product) the link is:

    index.php?cmd=document_product&product_type=4&cPath=36_39&pID=362&action=new_pro duct

    and clicking it takes me to the admin home page - no error logs.


    Edit: not sure why there's a space in 'new_product' it wasn't there when I created this post


    BTW, I think Admin > Reports > Products Low Stock should be renamed to reflect the actual title of the page i.e. Product Stock Report
    I'm using the music product, type 2, almost exclusively. But after reading your post, I tried to click through the Gift Certificate product, type 1, and it went to the editing form. Neither link produces an error log after deleting admin/product_music.php (which appears unnecessary and requires an includes/modules/prod_cat_header_code.php file, both officially removed in v1.5.5f).

  7. #7
    Join Date
    Apr 2008
    Posts
    150
    Plugin Contributions
    0

    Default Re: Error when clicking link in Product Stock Report

    Quote Originally Posted by simon1066 View Post
    I see that this has been addressed for ZCv1.58, I'll try it when I have time.

    https://github.com/zencart/zencart/c...7af601943107fa

    I should have checked GitHub before posting.
    Thank you, Simon. That worked great. I applied the fixes to the stock, items viewed, and items ordered reports.
    In the files handling those stats, all instances of
    Code:
    $type_handler, '&product_type
    change to
    Code:
    FILENAME_PRODUCT, '&product_type

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

    Default Re: Error when clicking link in Product Stock Report

    Quote Originally Posted by Joseph M View Post
    I'm using the music product, type 2, almost exclusively. But after reading your post, I tried to click through the Gift Certificate product, type 1, and it went to the editing form. Neither link produces an error log after deleting admin/product_music.php (which appears unnecessary and requires an includes/modules/prod_cat_header_code.php file, both officially removed in v1.5.5f).
    These discrepancies are because a process used to upgrade the site wasn't followed. As discovered, moving from one version to another sometimes involves changing the content of a file, adding a file, and also now discovered removing a file.

    While some of the earlier upgrade process instructions are not blatantly clear about the need to remove files from older versions, the direction is in there. Note that a file that remains may impact operation. Sure the issue described in this thread has a published correction, but coming to that solution was through two different error paths when trying the same operation.

    Anyways, the presence of admin/product_music.php is not specifically a problem, but consider what files that end with the php extension are still in catalog and/or admin folders such as includes/extra_configures, includes/extra_datafiles, includes/functions/extra_functions, (catalog only) includes/modules/pages, etc...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Product Stock Report stock number not id
    By taodesigns in forum Basic Configuration
    Replies: 2
    Last Post: 28 Sep 2011, 03:31 PM
  2. Can't get products to show when clicking category link
    By tharring in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 8 Nov 2010, 02:06 AM
  3. error message when clicking 'admin/product types'
    By feolindo in forum Customization from the Admin
    Replies: 2
    Last Post: 24 Aug 2008, 07:50 AM
  4. Grey dotted border when clicking link
    By magicpants in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 7 Sep 2006, 05:39 AM

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