Skip to content

Conversation

cmancone
Copy link

@cmancone cmancone commented Jan 5, 2018

… the calling sequence of

QuickBooks_QBXML_Object::asQBXML() recently changed, and a constant was moved:
QUICKBOOKS_OBJECT_XML_DROP -> QuickBooks_XML::XML_DROP. However, QuickBooks_QBXML_Object_Vendor::asQBXML
still had the old definition and referenced the old constant, which no longer existed, resulting
in an error (which would have been ignored in environments with STRICT error reporting off). Upon
further examination I realized that the asQBXML, asArray, and _cleanup methods in
QuickBooks_QBXML_Object_Vendor actually didn't do anything anyway but just deferred everything
to the parent. As a result, I fixed this by simply removing all three method from QuickBooks_QBXML_Object_Vendor.
I checked and noticed that many classes had this same problem, so I went through all of them and removed
asQBXML, asArray, and _cleanup only when I could safely do so (i.e. only when they had no functionality of their
own and were simply deferring to the parent class).

It doesn't look like you have any tests to run to make sure I didn't accidentally break anything, and
I don't have any quick ways to check all of these methods. However I went through my changes carefully,
so hopefully this commit will work without issue for you: please double check my work.

Also, I realized at push time that my editor was still configured to automatically strip extraneous whitespace from the end of lines. This is why so many lines are changed. If this is a problem I can re-apply my changes without the auto-trimming of whitespace.

…the calling sequence of

QuickBooks_QBXML_Object::asQBXML() recently changed, and a constant was moved:
QUICKBOOKS_OBJECT_XML_DROP -> QuickBooks_XML::XML_DROP.  However, QuickBooks_QBXML_Object_Vendor::asQBXML
still had the old definition and referenced the old constant, which no longer existed, resulting
in an error (which would have been ignored in environments with STRICT error reporting off).  Upon
further examination I realized that the asQBXML, asArray, and _cleanup methods in
QuickBooks_QBXML_Object_Vendor actually didn't do anything anyway but just deferred everything
to the parent.  As a result, I fixed this by simply removing all three method from QuickBooks_QBXML_Object_Vendor.
I checked and noticed that many classes had this same problem, so I went through all of them and removed
asQBXML, asArray, and _cleanup only when I could safely do so (i.e. only when they had no functionality of their
own and were simply deferring to the parent class).

It doesn't look like you have any tests to run to make sure I didn't accidentally break anything, and
I don't have any quick ways to check all of these methods.  However I went through my changes carefully,
so hopefully this commit will work without issue for you: please double check my work.
mreiden added a commit to mreiden/quickbooks-php that referenced this pull request Nov 8, 2019
@amorsent
Copy link

I have filed a very similar pull request:
Cleanup asQBXML() & some undefined constants. #321

It is a bit more narrow in scope and doesn't have the extra whitespace changes.
Mine does not address _cleanup() and _asArray() methods, only asQBXML().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants