You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
c-prompt opened this issue
Dec 28, 2016
· 5 comments
Labels
answeredFor when a question was asked and we referred to forum or answered it.BugFor errors / faults / flaws / inconsistencies etc.duplicateFor issues that already existed in our issue tracker and were reported previously.
In order to be able to unserialize() an object, the class of that object needs to be defined. That is, if you have an object of class A and serialize this, you'll get a string that refers to class A and contains all values of variables contained in it. If you want to be able to unserialize this in another file, an object of class A, the definition of class A must be present in that file first.
It appears Piwik 3 Live.getVisitorProfile API command (i.e., index.php?module=API&method=Live.getVisitorProfile) is now returning serialized objects (in this case lastVisits). For example, here is a sample unserialized response:
As you can see, the problem is a __PHP_Incomplete_Class is returned (with an associated warning in the error log that Class __PHP_Incomplete_Class has no unserializer) because the class isn't defined. Although I can define the class, I'd rather not as the lastVisits object isn't important to the information I was retrieving. Is there any chance the response of this API call will be put back to the way it was (or changed to remove or transmute the object) because, otherwise, anyone who has been using this API call will now have to modify their own code to define the object? Thanks.
The text was updated successfully, but these errors were encountered:
I'm going to close this and just change my code to retrieve the API call results via JSON instead of PHP (i.e., index.php?module=API&method=Live.getVisitorProfile&format=JSON&token_auth=xxx), thus eliminating the need to unserialize and create the class. However, wanted to leave it out there in case anyone else is looking to understand why they're getting __PHP_Incomplete_Class errors.
@c-prompt i'd leave it open as it seems to me a bug that we return incomplete classes. We likely won't fix it for now, but worth to keep this open as a bug
mattab
changed the title
3.0.0 API returning serialized objects
Reporting API with format=php returning unknown objects __PHP_Incomplete_Class __PHP_Incomplete_Class_Name
Jan 3, 2017
mattab
added
the
Bug
For errors / faults / flaws / inconsistencies etc.
label
Jan 3, 2017
mattab
added
answered
For when a question was asked and we referred to forum or answered it.
duplicate
For issues that already existed in our issue tracker and were reported previously.
labels
Jun 19, 2017
answeredFor when a question was asked and we referred to forum or answered it.BugFor errors / faults / flaws / inconsistencies etc.duplicateFor issues that already existed in our issue tracker and were reported previously.
According to Serializing objects - objects in sessions:
It appears Piwik 3 Live.getVisitorProfile API command (i.e., index.php?module=API&method=Live.getVisitorProfile) is now returning serialized objects (in this case lastVisits). For example, here is a sample unserialized response:
As you can see, the problem is a __PHP_Incomplete_Class is returned (with an associated warning in the error log that Class __PHP_Incomplete_Class has no unserializer) because the class isn't defined. Although I can define the class, I'd rather not as the lastVisits object isn't important to the information I was retrieving. Is there any chance the response of this API call will be put back to the way it was (or changed to remove or transmute the object) because, otherwise, anyone who has been using this API call will now have to modify their own code to define the object? Thanks.
The text was updated successfully, but these errors were encountered: