Home › Forums › Ticket Products › Event Tickets Plus › Order Table doesn't work for a single event
- This topic has 7 replies, 4 voices, and was last updated 9 years, 7 months ago by
Roger Klein.
-
AuthorPosts
-
August 25, 2016 at 4:18 am #1155723
Roger Klein
ParticipantHello
The Order-table for one event is not working anymore. However it’s working for all the other events. I receive the following error:
Fatal error: Cannot use object of type WP_Error as array in …/wp-content/plugins/event-tickets-plus/src/Tribe/Commerce/WooCommerce/Orders/Table.php on line 405
Are you aware of that problem? I think it has something to do with the event itself (or at least the orders or ticket numbers for this event).
I tried updating everything – with no luck. I also deactivated all other plugins and switched to the default twentysixteen theme but the problem remains.
Thanks for your help
RogerAugust 25, 2016 at 1:53 pm #1156049Brook
ParticipantHowdy Roger,
I would love to help you with this.
I am a bit puzzled by that error message. Line 405 of the plugin should be an empty line, it’s just there for whitespace. It should not be generating an error.
Have you modified the plugins any? Would you mind doing a “Manual Update” for Event Tickets Plus? Even if you are technically on the latest version, still try deleting the plugin and reinstalling per that tutorial. Does the error message go away, or does it perhaps change line numbers? If you still get the error message would you mind uploading a copy of that file /wp-content/plugins/event-tickets-plus/src/Tribe/Commerce/WooCommerce/Orders/Table.php somewhere, perhaps copy/paste it’s content into a pastebin? Then send me a link. I’d like to learn more about it.
Cheers!
– Brook
August 25, 2016 at 11:53 pm #1156220Roger Klein
ParticipantHi Brook
Thanks for your help!
Yes you’re right. I modified the file by generating some additional columns for this table. However it’s also not working with the original file. I uploaded the original plugin file and now I’m receiving the error on line 389.
I removed the event tickets and event tickets plus plugins completely and manually updated them with no luck.
August 28, 2016 at 10:06 pm #1156933Brook
ParticipantWell that would make more sense.
The error is very possibly related to your past modifications. It seems quite possible the modification stored something in the database that was unexpected, and is now causing the $order variable to be an error rather than the expected result from the DB. I only say that because I have never heard of this on a stock install.
But that’s no worries, with yet another modification you could probably work around it. 389 should look like this:
$orders[ $order_id ] = $order['order'];
I would replace it with this:
if( is_array( $order ) && isset( $order['order'] ) ) { $orders[ $order_id ] = $order['order']; }Did that cause the error to go away? Does the order screen show any data, or is it perhaps blank?
Cheers!
– Brook
September 4, 2016 at 11:49 pm #1159895Roger Klein
Participanthi Brook.
Thank you very much for your help.
I did the change, but still have this error:
Fatal error: Cannot use object of type WP_Error as array in /home/www/web150/html/herbsthelferei/wp-content/plugins/event-tickets-plus/src/Tribe/Commerce/WooCommerce/Orders/Table.php on line 423did you have a idea where in the database the error can be?
Best regards
September 7, 2016 at 8:37 pm #1161357Brook
ParticipantI see, that is going to make things more complicated.
The error is not in the database per se, the error appears to happen when code like this runs:
$order = WC()->api->WC_API_Orders->get_order( $order_id )When it tries to retrieve the order a WP_Error is thrown, and WooCommerce returns that instead.
I am not familiar with your code and modifications, so I honestly can not even guess as to what the error is. At this point you or your developer will need to debug this. If you are familiar with debugging PHP then we have a good place to start. Throw a breakpoint on line 423, the one mentioned in the error, and inspect the variables. It seems likely that $order will be a WP_Error, so you will be able to glean a lot more information when you find out what error. From there you can hopefully trace it back to the source. It’s likely that there is something in your database stored in a format that it’s not meant to be stored in, and so when Woo tries to retrieve the order it errors out. The fix will likely be altering your database and whatever code was written that caused things to go awry in the first place
I really wish I could be of more help here. Unfortunately we have strayed too far from the base code for me to make anything but wild guesses as to what’s happening.
Cheers!
– Brook
September 29, 2016 at 9:35 am #1170528Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Order Table doesn't work for a single event’ is closed to new replies.
