Order admin detail page is blank

I have just updated to 3.0.0.7 on my multisite installation in the live environment. When I go in to the admin page for orders I can not see a full list of past orders. When I click on the order id to edit the status, add notes, see the details etc. – The page goes blank – white screen. Not good!

Please help me fix this so that my stores can see their orders to process them.

  • Jude
    • DEV MAN

    Hey @duffy_betterton

    Are you getting any errors on the console ?

    https://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Error

    Also can you turn on WP_DEBUG and post any error messages you get here ?

    https://codex.wordpress.org/Debugging_in_WordPress

    Also if you urgently need to restore the site for the busy weekend you can simply switch to the previous version temporarily. Visit this page click on change log and download the previous version and then install via FTP.

    https://premium.wpmudev.org/project/e-commerce/

    Cheers

    Jude

  • duffy_betterton
    • Site Builder, Child of Zeus

    I turned on wp_debug and went back to orders and found this

    Fatal error: Call to a member function is_download_only() on a non-object in /nas/content/live/webonmission/wp-content/plugins/marketpress/includes/admin/class-mp-orders-admin.php on line 1078

    now what?

  • duffy_betterton
    • Site Builder, Child of Zeus

    Hello? Jude?

    Any thoughts? I really do not want to revert unless I have to but I do have promotions going out tomorrow. It seems like this should be a pretty quick fix. I’ve looked at the files on staging server that is still running marketpress 2.6… but the files are not in the same place.

    help!

  • Jude
    • DEV MAN

    Hi again @duffy_betterton

    Here is a quick fix that should get you back on your feet.

    Replace this block around lines 1075 in this file

    /nas/content/live/webonmission/wp-content/plugins/marketpress/includes/admin/class-mp-orders-admin.php

    Find this block and

    case 'mp_orders_shipping' :
    $cart = $order->get_meta( 'mp_cart_info' );

    if ( $cart->is_download_only() ) {
    $html .= '—';
    } else {
    $shipping = get_post_meta( $post_id, 'mp_shipping_total', true );
    $html .= mp_format_currency( '', $shipping );
    }

    break;

    replace with this

    case 'mp_orders_shipping' :
    if ( $cart instanceof Object && $cart ):
    $cart = $order->get_meta( 'mp_cart_info' );

    if ( $cart->is_download_only() ) {
    $html .= '—';
    } else {
    $shipping = get_post_meta( $post_id, 'mp_shipping_total', true );
    $html .= mp_format_currency( '', $shipping );
    }
    endif;
    break;

    Cheers

    Jude

  • duffy_betterton
    • Site Builder, Child of Zeus

    still errors

    Notice: Undefined variable: cart in /nas/content/live/webonmission/wp-content/plugins/marketpress/includes/admin/class-mp-orders-admin.php on line 1076

    and on detail page

    Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /nas/content/live/webonmission/wp-includes/functions.php on line 3411

    Fatal error: Call to a member function is_download_only() on a non-object in /nas/content/live/webonmission/wp-content/plugins/marketpress/includes/admin/class-mp-orders-admin.php on line 307

  • Michael Bissett
    • Recruit

    Hey @duffy_betterton, my apologies for the delay here!

    I’d like to have a deeper look at your Multisite for this one, and troubleshoot this further, could you please send in the following via our secure contact form:

    – Mark to my attention, the subject line should contain only: ATTN: Michael Bissett

    – Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.

    – Link back to this thread

    – Include WordPress network admin access details (login address, username & password)

    – Include FTP log-in details (hostname, username & password)

    – Include any relevant URLs for your site

    IMPORTANT: Please make sure you select “I have a different question” for your topic, so it doesn’t go back to the forums – this and the subject line ensure that it gets assigned to me.

    https://premium.wpmudev.org/contact/

    Thanks a bunch! :slight_smile:

    Kind Regards,

    Michael

  • lori_sawaya7
    • Flash Drive

    I’m having the same issue. Here’s my unresolved ticket: https://premium.wpmudev.org/forums/topic/ever-since-the-update-after-2962-my-product-pages-would?replies=10#post-996117

    Clearly the new version of MarketPress has issues that need fixed at a developer level.

    What I’ve discovered so far is the new version changed all the permalinks to my products pages which broke a lot of stuff including links. The data base of past orders is still there but the code is messed up that displays it in a proper table format at Store > Orders.

    Reverting to an older version would suck because I just fixed a bunch of permalinks that the new version broke.

  • Jose
    • Bruno Diaz

    Hello @duffy_betterton,

    Hope you are doing great, and thanks for your patience here.

    There is an issue with orders created in MP versions previous to 3.0.

    A fix will be released soon. In the meantime, you can solve this by changing the line 1076 in

    wp-content/plugins/marketpress/includes/admin/class-mp-orders-admin.php

    from this:

    $cart = $order->get_meta( 'mp_cart_info' );

    to this:

    $cart = $order->get_cart();

    (you should roll back the changes suggested above by my colleague Jude)

    Please let us know if you need help implementing this change.

    Cheers,

    José

  • duffy_betterton
    • Site Builder, Child of Zeus

    Thank you for working on this issue. It is much better but not completely fixed. There is no longer a blank screen – Hooray! However, some order details are there but some details are missing.

    For instance

    on the Smoky Mountain Resort Ministries site an older order is missing part but not all of the customer address.

    on Grounds 2 Give the product info and contact information is missing from old orders

    other sites seem to repeat one of these two problems

  • Tony
    • Site Builder, Child of Zeus

    Sorry to chime in here, but mine was patched as well and I thought fixed. However, when I look at back orders and open them things like name and other information is missing like @duffy_betterton. Not sure if wpmudev want a ticket for that, but I would think it would be important for you to know. I can live with it for now if it will be fixed in a subsequent update. Thanks (and thanks @duffy_betterton for calling it to my attention.

  • Michael Bissett
    • Recruit

    Hey @duffy_betterton,

    You’re right, we will want to continue here, I do believe that @jose‘s looking into this sort of issue as well. I’ll notify him of this instance, so that he can look into it as well.

    Just so the information’s available, when you say:

    on the Smoky Mountain Resort Ministries site an older order is missing part but not all of the customer address.

    And:

    on Grounds 2 Give the product info and contact information is missing from old orders

    Could you please mention the exact orders in question? It’d help him to debug this for you if he could track down the exact orders. :slight_smile:

    Kind Regards,

    Michael

  • Jose
    • Bruno Diaz

    Hi @duffy_betterton and @tony,

    In deed there is a problem with legacy orders submitted by guest users. According to my tests, it works fine for orders tied to a logged in user.

    I made a fix that I’m attaching here. You only need to replace the filw in the following location:

    ../wp-content/plugins/marketpress/includes/admin/class-mp-orders-admin.php

    This fix will populate the billing information. In some cases, it is different from the shipping information, that’s why I’m not synchronizing both. You can do it manually by clicking in “Copy billing address to shipping address”.

    @tony, the fix is already applied in your site since I used it to double check after testing on my own environment :slight_smile:

    Please let me know if it works as expected.

    This fix will be included in the next release. I’m also working through the list of issues that you reported.

    Thanks again for your cooperation.

    Cheers,

    José

  • Jose
    • Bruno Diaz

    @duffy_betterton,

    My colleague Michael just applied the new patch in your site.

    While the customer address issue is solved, this fix is nt making any effect in the site Grounds 2 Give.

    I was doing some further debug directly in your site and couldn’t find a final answer. I suspect that those old orders included products that were deleted from the site, is this possible?

    New orders are working fine though.

    If you want me to try to get to the bottom, I would need a DB backup previous to the MP upgrade. I see that you are running your site in WPEngine, so you should be able to get the backup from them.

    Thanks in advance,

    José

  • Myles
    • Design Lord, Child of Thor

    I have installed this hotfix on my system and now the orders page DOES now show the orders.

    If I click a persons name link I get a modal showing their name and addres. If I click on the order ID link, it gives a Function error.

    Fatal error: Call to a member function is_download_only() on a non-object in /home/content/94/4175194/html/rcr/cms/wp-content/plugins/marketpress/includes/admin/class-mp-orders-admin.php on line 307

  • duffy_betterton
    • Site Builder, Child of Zeus

    Thank you for working on this issue of past orders. The last patch applied did help with addresses in orders on some sites but not all. Smoky Moutain Resort Ministries is one of the only ones that is showing correctly. I still have errors on the following sites

    Dance Dress Consignment

    Grounds 2 Give

    Binski Studio

    Barre88

    Mostly these are still address errors however on Grounds 2 Give I had to create a new product with the Marketpress update to 3.0.0.6 due to the variables for the previous products not being editable. The old products is still there just not active. But shouldn’t the basic product information still be available even if the product was deleted?

  • Michael Bissett
    • Recruit

    Hey @duffy_betterton,

    But shouldn’t the basic product information still be available even if the product was deleted?

    I’m not certain from a code perspective, but I would reckon the answer would be no, as if the product couldn’t be found, the information for it couldn’t be referenced.

    So no products related to orders were deleted during the 3.0.0.6 update? Your comment about the product not being deleted was only referencing the Grounds 2 Give site, just wanted to verify that there weren’t any others (that you know of, of course).

    On this:

    I still have errors on the following sites

    Dance Dress Consignment

    Grounds 2 Give

    Binski Studio

    Barre88

    Mostly these are still address errors…

    I didn’t see an order on your Dance Dress Consignment site with an error (and had only seen one order), but I trust that the following orders:

    – Order ID #62bc57eefc46 – Grounds 2 Give (missing product info & customer info)

    – Order ID #7e6075db1b3c – Binski’s Studio (Order Details is blank, only first & last name, and email are available for customer)

    – Order ID #c9e239f58588 – Barre 88 (missing product info & customer info)

    Would be examples of orders that do have issues?

    Also, since my colleague Jose mentioned this:

    If you want me to try to get to the bottom, I would need a DB backup previous to the MP upgrade. I see that you are running your site in WPEngine, so you should be able to get the backup from them.

    Would you happen to have such a backup from WP Engine? If you do, then could you please send it in by the same means you sent in the access details before (when I requested them via our contact form)? You could upload it to Dropbox to make the sharing of it easier. :slight_smile:

    Please advise,

    Michael

  • duffy_betterton
    • Site Builder, Child of Zeus

    Michael and Jose

    Thank you for working on this problem.

    1. One of my websites – Binski Studios – makes custom products. Each time these products are made and sold a new product will be created on the website. After that product has been sold it will be moved to inactive but still needs to be accessible in the order history information. Are you saying that if the product is not longer active or even existing that the data in the order will show up blank?

    2. The closed order for Dance Dress Consignment has most of the data. Only the name on the shipping address is missing. The errors on orders on the other sites that you listed above are correct.

    I do have a zip backup from before the move to 3.0.0.6 or .7 that I can share with you if you want to dig into these problems. At this point, my stores are willing to move on and not worry about this data since it is a small amount of orders. However, I want to be sure that this will not be an issue in the future with updates. If you think it is best to find the root of the problem so that it doesn’t happen again, I am happy to share the files via dropbox.

  • Michael Bissett
    • Recruit

    Hey @duffy_betterton, Michael here! :slight_smile:

    #1:

    Each time these products are made and sold a new product will be created on the website. After that product has been sold it will be moved to inactive but still needs to be accessible in the order history information. Are you saying that if the product is not longer active or even existing that the data in the order will show up blank?

    That’s going to vary, depending on a couple details.

    From further investigation, if the product was created in 2.9.6.2, and the order was made prior to the upgrade to 3.0.0.6, if the product gets deleted, then the product information will disappear.

    That would explain these two orders I mentioned earlier:

    – Order ID #62bc57eefc46 – Grounds 2 Give (missing product info & customer info)

    – Order ID #c9e239f58588 – Barre 88 (missing product info & customer info)

    However, if the product was created in 3.x series install (e.g. 3.0.0.7), and the product gets deleted after an order is made, the product information will still be available, even after the original product was deleted.

    So going forwards, you should be fine here. :slight_smile:

    #2: Okay then, I should note with Jose’s earlier fixes, he did have this to say regarding the billing information:

    In some cases, it is different from the shipping information, that’s why I’m not synchronizing both. You can do it manually by clicking in “Copy billing address to shipping address”.

    So for that particular order, you’d want to click that button, that’d sort out the information there.

    Now, that leaves us this order:

    – Order ID #7e6075db1b3c – Binski’s Studio (Order Details is blank, only first & last name, and email are available for customer)

    In this case, it looks like the product was deleted too (the Order Details being blank like this being indicative of that), yet some of the customer details have made it over. I do find that curious, but due to the situations I laid out in response #1, it seems like the product was deleted before the upgrade to the 3.x series.

    It seems like the remaining issues (that aren’t like the one in Binski’s Studio) are related to orders with deleted products, and it’s not looking like we can do anything further for those orders. As mentioned earlier, though, future orders should be okay from here. :slight_smile:

    Kind Regards,

    Michael

  • Lionel
    • Design Lord, Child of Thor

    Hello,

    I’ve replaced the file but still not working.

    Still have the same fatal error :

    Fatal error: Call to a member function is_download_only() on a non-object in /homepages/39/d115215463/htdocs/boutique_v3/vod/wp-content/plugins/marketpress/includes/admin/class-mp-orders-admin.php on line 307

    Thanks for your future help.

    Lionel

  • Michael Bissett
    • Recruit

    Seeing as this one is wrapped up, I’ll be closing up this thread here.

    For anyone reading this later, please bear the following post in mind when it comes to posting on another’s thread:

    https://premium.wpmudev.org/forums/topic/upgrading-to-the-latest-dashboard-gives-project-auto-upgrade-errors#post-1030729

    There’s a definite reason why we ask folks to open their own threads for issues. :slight_smile:

    Kind Regards,

    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.