• I am testing out on my dev site having the HPOS option enabled for woocommerce to see what all is not working correctly in my own custom plugins

    In the sidebar of an order – the age gate meta box is showing an error

    Warning: Attempt to read property "ID" on null in [pathpathpathpath]/wp-content/plugins/age-gate/src/Admin/Post/Edit.php on line 127

    This is with wordpress 6.4.2, woocommerce 8.5.2

    most likely because of the way that it’s based on an order ID now instead of post ID. See https://github.com/woocommerce/woocommerce/wiki/High-Performance-Order-Storage-Upgrade-Recipe-Book

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter dunkoh

    (@dunkoh)

    I’m no longer getting this error – it is likely that another action or filter was clobbering the object before it got to your code. This is no longer an issue at this time.

    Thread Starter dunkoh

    (@dunkoh)

    Actually I’m still seeing this in the error log.

    Plugin Author Phil

    (@philsbury)

    Hi @dunkoh,

    There’s two issues here I think:

    1. HPOS doesn’t use a post anymore so it passes an instance of Order into the metabox which is a little unexpected. I can fix this, but;
    2. In reality, that metabox probably shouldn’t even be on an order, would anyone ever need to age restrict an order itself? I can’t imagine they would

    Will look into getting one or both or those options into a release.

    Thanks
    Phil

    Thread Starter dunkoh

    (@dunkoh)

    I was thinking the same thing – probably doesn’t need to be there. Thanks!

    Plugin Author Phil

    (@philsbury)

    This should be fixed in the latest version. It wasn’t actually there prior to HPOS, but was reliant on orders being a post type!

    Thanks
    Phil

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘error in order sidebar meta box with HPOS enabled’ is closed to new replies.