Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Possible bug but not sure

    Quote Originally Posted by wsworx View Post

    I also found that when I change the attribute Option Type like I did I am getting 2 new debug log files regarding the includes/functions/functions_files.php

    Code:
    [19-Feb-2025 10:34:57 America/Boise] Request URI: //admin/index.php?cmd=orders&page=1&oID=4&action=edit, IP address: , Language id 1
    #0 //public_html//includes/functions/functions_files.php(384): zen_debug_error_handler()
    #1 //public_html//admin/orders.php(885): zen_get_uploaded_file()
    #2 //public_html//admin/index.php(16): require('//..')
    --> PHP Warning: Undefined array key 1 in /public_html//includes/functions/functions_files.php on line 384.
    Code:
    [19-Feb-2025 10:57:34 America/Boise] Request URI: //admin/index.php?cmd=orders&page=1&oID=4&action=edit, IP address: , Language id 1
    #0 [internal function]: zen_debug_error_handler()
    #1 //public_html//includes/functions/functions_files.php(385): explode()
    #2 //public_html//admin/orders.php(885): zen_get_uploaded_file()
    #3 //public_html//admin/index.php(16): require('//...')
    --> PHP Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in //public_html//includes/functions/functions_files.php on line 385.
    Those two errors are because the filename is null/blank, which is correct because no filename was stored on the order, because it wasn't a File attribute when the order was placed.

    I suppose if you're going to be in the habit of changing TEXT attributes to FILE attributes after-the-fact, then you could patch the lookup by changing line 884 of orders.php:

    PHP Code:
    if (zen_is_option_file($order->products[$i]['attributes'][$j]['option_id'])) { 
    to
    PHP Code:
    if (zen_is_option_file($order->products[$i]['attributes'][$j]['option_id']) && !empty($order->products[$i]['attributes'][$j]['value'])) { 
    .

    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.

  2. #12
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Possible bug but not sure

    Quote Originally Posted by wsworx View Post
    I created a new stock item "TEST PRODUCT FOR ATTRIBUTES"
    I created a new text attribute "SPECIAL ORDER ITEM DESCRIPTION"
    I entered the store side and created a new order for the demo customer, checked out and logged out of the store
    I accessed the invoice on the admin side as seen below:

    Attachment 20914

    I then go to "Option Value Manager" access the "SPECIAL ORDER ITEM DESCRIPTION", click edit and change the "Option Type" to File. I go back to the invoice that was created and find the attribute change is now reflected on the invoice line items that have already been committed as seen below:

    Attachment 20916

    I would expect the code that sets up the invoice interface would pull line-item data from an order database table and the option value type id would be stored against that invoice's id number, correct?
    While many attribute details are indeed stored with the order, the "type" that you're changing in this case is only stored in the catalog, not the order history.
    .

    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.

  3. #13
    Join Date
    Jun 2012
    Location
    California
    Posts
    238
    Plugin Contributions
    0

    Default Re: Possible bug but not sure

    Quote Originally Posted by DrByte View Post
    Those two errors are because the filename is null/blank, which is correct because no filename was stored on the order, because it wasn't a File attribute when the order was placed.

    I suppose if you're going to be in the habit of changing TEXT attributes to FILE attributes after-the-fact, then you could patch the lookup by changing line 884 of orders.php:

    PHP Code:
    if (zen_is_option_file($order->products[$i]['attributes'][$j]['option_id'])) { 
    to
    PHP Code:
    if (zen_is_option_file($order->products[$i]['attributes'][$j]['option_id']) && !empty($order->products[$i]['attributes'][$j]['value'])) { 
    I'm not sure which "filename you are referring" to.
    Some of the details in the debug file I deleted to keep my site secure.
    Since I did a standard order I don't know why ZC would leave a filename blank.

    I don't think it is a matter of what I would be apt to do or not do so much as it being an issue with securing the invoice to a fully committed state once saved. I would find it concerning that anyone would argue with that statement when it comes to security and consistency of one's data.

  4. #14
    Join Date
    Jun 2012
    Location
    California
    Posts
    238
    Plugin Contributions
    0

    Default Re: Possible bug but not sure

    Quote Originally Posted by DrByte View Post
    While many attribute details are indeed stored with the order, the "type" that you're changing in this case is only stored in the catalog, not the order history.
    Shouldn't it be about data consistency and security?
    You can't have full data consistency and security if details for an item like an invoice are allowed to be altered in anyway outside of a proper admin edit actions.

  5. #15
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,286
    Plugin Contributions
    125

    Default Re: Possible bug but not sure

    You really can't change a TEXT attribute to FILE attribute and expect existing orders that used the old type to work well.

    If you actually decide, gee, this thing should really be a FILE, create a new option type, delete the old option type from the product and add the new one.
    That Software Guy. My Store: Zen Cart Support
    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.

  6. #16
    Join Date
    Jun 2012
    Location
    California
    Posts
    238
    Plugin Contributions
    0

    Default Re: Possible bug but not sure

    Quote Originally Posted by swguy View Post
    You really can't change a TEXT attribute to FILE attribute and expect existing orders that used the old type to work well.

    If you actually decide, gee, this thing should really be a FILE, create a new option type, delete the old option type from the product and add the new one.
    I agree with you completely, but it is not about what someone expects.

    But In this type of data schema nothing should be able to change critical stored data.
    Only a proper edit function put in motion by an admin and then saved by that admin should be allowed to change stored data.
    Something that helps define an item tied to a specific invoice tied to a specific date and Customer id should be stored data and not be able to be changed at a whim.
    Especially since many of the people using this software do not understand the underlying workings of it so if they were to do something like this they likely wouldn't even know until later down the road when everything is a mess.
    I am in no way trying to stir up trouble.
    It's just in my mind if I was the developer of something like this, I wouldn't want this occurring anywhere on any level of my software.
    If someone brought it to my attention, then I would fix it.
    If I am wrong about the developers of this software, then so be it.
    If I knew how to do this stuff, I would just rewrite it and submit it myself, but I am a motorcycle mechanic not a programmer lol.

  7. #17
    Join Date
    Jun 2012
    Location
    California
    Posts
    238
    Plugin Contributions
    0

    Default Re: Possible bug but not sure

    Quote Originally Posted by DrByte View Post
    While many attribute details are indeed stored with the order, the "type" that you're changing in this case is only stored in the catalog, not the order history.
    From my testing that is clearly obvious.
    However, my question is why.
    Shouldn't all data attached to an invoice that defines something on that invoice be stored in a way that makes it unique to that invoice for future audit purposes?
    If the Option Type were stored with the invoice data then it can't be changed inadvertently later which is how an invoice should be once it is committed.

    I don't want to beat this to death though.
    If everyone thinks I should just drop it, then I am moving on.

    As it stands right now, I have my ZC 2.1 site live with authorizenet_merchant_seal_2.0, customer_tax_exempt_2.0.2, edit_orders-5.0.0, sitemapxml-4.0.3, usps-USPS_2024_08_25_K11l and zen_TyPackageTracker-5.0.0 all running without any more debug files, so I am happy and appreciative of everyone's hard work.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [NOT A BUG] Possible free shipping bug
    By mprough in forum Bug Reports
    Replies: 5
    Last Post: 30 Jul 2024, 05:03 PM
  2. v154 postage estimator bug or error not sure
    By mydakota in forum Addon Shipping Modules
    Replies: 5
    Last Post: 30 Mar 2016, 08:05 PM
  3. Not sure if this is a bug or operator error with EasyPopulate
    By JohnBoyCR in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 4 Nov 2009, 07:08 PM
  4. Not sure is this is possible....
    By mariuskem in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Feb 2009, 10:17 AM
  5. Possible security problem - not sure
    By Rosalie in forum General Questions
    Replies: 1
    Last Post: 11 Jun 2007, 01:22 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