quickbooks-php icon indicating copy to clipboard operation
quickbooks-php copied to clipboard

Missing file called CustomerCommunicationEmailAddr.php

Open rstoeber opened this issue 2 years ago • 14 comments

We've been using quickbooks-php for years and never had this problem. Today we suddenly started getting errors saying:

require_once(/var/www/workglue/qbo/quickbooks-php/QuickBooks/IPP/Object/CustomerCommunicationEmailAddr.php): failed to open stream: No such file or directory in /var/www/workglue/qbo/quickbooks-php/QuickBooks/Loader.php on line 56

There is no file with that name, and it looks like there never was (I don't see it in this GitHub repository). However, there is a file called CustomerCommunicationAddr.php

I was desperate and trying anything so I simply copied that file and made a small change to the content like this and the error went away:

rstoeber avatar Apr 05 '22 17:04 rstoeber

It might be a case sensitivity issue, compare the full paths.

Did you upgrade PHP? I saw it happen when I upgraded previously.

ve7tcc avatar Apr 05 '22 18:04 ve7tcc

It's definitely not a case problem. As I said, the file called CustomerCommunicationEmailAddr.php does not exist, and it looks like it never did.

No recent PHP updates that I'm aware of. We are running PHP 7.4.23 on Ubuntu 20.04


Robert Stoeber @.*** 707.786.3237

Schedule Zoom meeting

On Apr 5, 2022, 12:20 PM -0600, Duncan @.***>, wrote:

It might be a case sensitivity issue, compare the full paths. Did you upgrade PHP? I saw it happen when I upgraded previously. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

rstoeber avatar Apr 05 '22 18:04 rstoeber

I got the exact same error today, before that everything was working fine for a few years.

I'm also copied CustomerCommunicationAddr file and made a small changes, but this leads to new errors.

stevemcquinn avatar Apr 05 '22 19:04 stevemcquinn

The case sensitivity might be on a directory name, not a file.

ve7tcc avatar Apr 05 '22 19:04 ve7tcc

Nothing was renamed, and the problem is not case sensitivity. For some reason that I don't understand at all, a file is trying to be loaded, but that file does not exist. Look for yourself, it's not here in the official repository.

After some very quick testing it seems I was able to fix the problem, for myself at least. Not getting any other errors right now and my QuickBooks Online interaction is working again.

In case this helps anyone, I added a file called CustomerCommunicationEmailAddr.php with this content:

QuickBooks_Loader::load('/QuickBooks/IPP/Object.php');

class QuickBooks_IPP_Object_CustomerCommunicationEmailAddr extends QuickBooks_IPP_Object {

}

rstoeber avatar Apr 05 '22 19:04 rstoeber

Thanks, this actually fixed this issue. I agree that this file does not exist and has never been in this repository...

stevemcquinn avatar Apr 05 '22 19:04 stevemcquinn

I wish I could explain what happened, but so far I have not figure out what triggered this change. If that php file never existed in the first place, why did the code suddenly try to load it this morning after years of not using it?

rstoeber avatar Apr 05 '22 22:04 rstoeber

Just found this. Thanks so much for the fix. I'm guessing something changed on the QuickBooks API that triggered this extra include.

jerry-knight avatar Apr 06 '22 16:04 jerry-knight

The same happened to me - and my fix was the same. I also think it was a back end change on the API side that broke things - since my code never changed, and that file was never part of this Repo...

carlbobtx avatar Apr 11 '22 18:04 carlbobtx

We have had the same result. For us, the timing perfectly aligned with issues with our product key from the Application questionnaire. This fix also worked of us. Thank you.

zaden1 avatar Apr 25 '22 16:04 zaden1

Yes, the same fix worked for me...

This is a little scary, because I thought once I downloaded the package, the code wouldn't change... I haven't changed any code or downloaded any updates for over a year.

Then, out of nowhere, I get an unresolved reference... Thats not good. Where is the stability? Jim.

On Mon, Apr 25, 2022 at 12:22 PM zaden1 @.***> wrote:

We have had the same result. For us, the timing perfectly aligned with issues with our product key from the Application questionnaire. This fix also worked of us. Thank you.

— Reply to this email directly, view it on GitHub https://github.com/consolibyte/quickbooks-php/issues/310#issuecomment-1108782216, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCICGXD5VFNJCRRF7VHUVLVG3BCNANCNFSM5STRJQVQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

tangofour avatar Apr 28 '22 19:04 tangofour

I've created PR #313.

It started to fail because QuickBooks response to the CompanyInfo API call now contains an undocumented CustomerCommunicationEmailAddr XML node. Internally this library is creating a class for every XML node, that has child nodes. That's why you've got an error about the missing PHP file.

aik099 avatar May 09 '22 14:05 aik099

@aik099 Shouldn't the fix be to only auto-create classes where there are objects defined in the library already? That way if the API changes, existing code won't break with random errors.

galapogos01 avatar May 30 '22 12:05 galapogos01

@aik099 Shouldn't the fix be to only auto-create classes where there are objects defined in the library already? That way if the API changes, existing code won't break with random errors.

@galapogos01 , that sounds logical.

Since some (if not most of them) classes for XML parsing are in fact identical (just a blank sub-class of the QuickBooks_IPP_Object class), except for their name, then in class instantiation place (wherever that is) we can create return instance of that QuickBooks_IPP_Object class for cases, when a more specific class is absent.

aik099 avatar May 30 '22 12:05 aik099