-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-21300: Addressed notices due to unexpected NULL from Joomla DB object. #11135
CRM-21300: Addressed notices due to unexpected NULL from Joomla DB object. #11135
Conversation
@totten, I haven't actually run this code, but it should address the warnings/notices you reported, all of which seem to follow on the original unexpected return type. Could you please validate? |
@mattwire can you take a look at this and see if this would change anything on your joomla site? |
@GinkgoFJG can you put this against 4.7.27rc- as a recent regression this should go in the rc |
Also the calling function looks like
so we shouldn't return an array if null unless we also return an array if successful (which is probably the cleanest - ie. pass TRUE as the second param to json_decode |
We are not returning an array in the case of a failed query; we are returning an object with no properties. The
|
366f8bf
to
76d556c
Compare
@eileenmcnaughton: I've rebased against 4.7.27-rc and changed the base of the PR. |
@GinkgoFJG @seamuslee001 I'll try out later on a Joomla 3.8.1 site. Haven't seen any warnings/notices though so I guess I'm just looking for "it still seems to work"! |
Ok no adverse affects - seems ok to me! |
test this please |
This looks good to me. Code looks safe, this has passed Jenkins and has been tested by Matt on a Joomla install with no errors showing up. I think this is good to merge. Note i haven't personally tested the code but it make sense to me and agree with Franks's comments re the stdObject |
Nice, @GinkgoFJG ! There are multiple supportive comments. Also, I can confirm that this resolves the warnings on my workstation when installing from an extracted Merging. |
Overview
Prevent notices described in CRM-21300 from being raised.
Before
See CRM-21300.
After
No more notices or warnings (needs validation).
Technical Details
The Joomla DB object returns NULL in some cases, which was not immediately obvious from the documentation. This PR ensures that the DBO-wrapping method always has a consistent return type.