Closed jerclarke closed 5 years ago
Thanks for the detailed report. My quick diagnosis is that this is just a bug that hasn't been visible enough to catch my attention, and should be easy to fix.
I think geo_mashup_null_fields only has a value when something needs to be erased, the saved_name field in this case. Most of the time it is missing and causes the notice, but nothing is wrong.
As a historical note, the reason the whole null fields thing exists has to do with trac ticket #15158. Since it's been around since 2005, Geo Mashup has traces of quite a few WordPress legacies inside.
As a practical note, running Geo Mashup on a system that will blow up on a PHP notice is risky! It's been an open source hobby project from the beginning and has been useful for many people, but has never achieved the resources that would be needed to get the probability of notices down near zero.
Thanks Dylan, I hear you about the legacy hacks and the difficulties of reducing all notices.
Of course our production system doesn't blow up on notices, but even when developing, something like this that shows a notice when saving a post can get in the way.
Thanks for figuring out a fix <3
Not sure if this is something small or something big. I finally did an update after about two years and after saving a post I got this error:
The actual error is very natural, because the code in
save_posted_object_location()
does a lot of assuming that$_POST
will contain things:The last one of course causes this particular error.
So the most direct solution, the one I'm implementing in my copy for now, is to validate teh
$_POST
field before accessing it, which addresses the notice itself. Really, we should always be doing this any time we access$_POST
or$_GET
, it's annoying but a good practice because notices like this can really blow up a system that's configured with tight error handling:Or something along those lines.
The bigger question is why
geo_mashup_null_fields
is undefined for me, and if that is likely to cause problems.I can't seem to find any references to "null fields" in the settings.
Thanks for any help you can provide and for figuring out how to make this notice go away for the next version.