wpks
Forum Replies Created
-
Is it? There’s no change in regard of this issue since yesterday afternoon.
Still arbitrary checks.. or rather not.
Is it checked in yet? I fail to find any change in the file.
Even if there were, that obligatorily had to be handled in code, by all means and measures.
This must not, under any circumstances — the least for a user config reason –, happen, ever ever ever. No, never.
Enjoy the feast.
cheers
Yeah. Surely my fault for using your code and being a single user in the whole world having this particular issue. Std. WP install, your code. Simple as that. Over the last couple of years same issue exists, vanishes and reappears. Makes you wonder?
Problem is: your code isn’t catching the non-existing array when it should, because clearly your assumption is at fault (as the error *is* showing up in the server logs).
I’m with you on the part that something must be wrong, indeed.
Happy holidays.
cheers
@grola thank you for your feedback.
Well, I don’t like the way this is implemented.
Three lines earlier you explicitely check
if ( ! is_array( $shipping_method_order ) )but then don’t for$shipping_methodbut opt instead for a blunt if-not array-then-create-empty-array in a getter. If nothing else, it might be marginally faster on a veeery large scale.OTOH, this point of code has proven fragile in the past when it had been “fixed” but got bugged back in^W^W^W but regressed nevertheless. You mind unittesting this?
Let’s hope this cropped up the last time.
Thank you.
May you have happy holidays and stay safe.
cheers
- This reply was modified 5 years, 5 months ago by wpks.
I cannot detect a change regarding this issue:
The relevant code is
foreach ( $shipping_methods as $shipping_method ) { if ( !isset( $ret[$shipping_method['id']] ) ) {$ret[$shipping_method['id']] = $shipping_method;} }and it is *yet* unaltered and *unprotected*.
Wrap it *at least* up in a
if ( is_array( $shipping_methods ) and !empty( $shipping_methods )) { foreach ( $shipping_methods as $shipping_method ) { if ( !isset( $ret[$shipping_method['id']] ) ) {$ret[$shipping_method['id']] = $shipping_method;} } }or similar.
cheers
Well, it sucks to tell you, but it it still does happen.
As it does for *years* now! IIRC, for a short period of time, it was gone. Only to reappear shortly after! Regression? QC?
I even wrote a patch and since then I’m trying to have it merged. No luck so far. You guys don’t want external devs to submit PRs?
cheers
Been there, done that.
Result: no feedback whatsoever!
Thank you. I see those messages daily. I could easily fix them if you preferred. By that I mean catching it via is_empty(). I did this once. Until the next update made my changes obsolete, of course. So I’d rather prefer an upstream solution.
cheers