OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
869 stars 436 forks source link

SOAP Api Warnings - PHP8.1 #3166

Closed m-overlund closed 1 year ago

m-overlund commented 1 year ago

I'm getting multiple errors from SOAP Api on OpenMage 19.4.23 / PHP 8.1 (with selected php 8.1/8.2 patches).

Not sure if others are experiencing the same issues. Glad to open multiple issues if it's issues that OpenMage should handle.

Klaviyo ESP

Return type of Varien_Data_Tree_Node_Collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice from SOAP: urn:Mage_Api_Model_Server_V2_HandlerAction (Klaviyo ESP) lib/Varien/Data/Tree/Node/Collection.php L29

class Varien_Data_Tree_Node_Collection implements ArrayAccess, IteratorAggregate, Countable

WMS - add tracking to shipment

substr(): Passing null to parameter #1 ($string) of type string is deprecated lib/phpseclib/Crypt/Base.php From SOAP: urn:Mage_Api_Model_Server_V2_HandlerAction

Request:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:salesOrderShipmentAddTrack><sessionId xsi:type="xsd:string">xxxxxxxxxxxxxxxxxxxxx</sessionId><shipmentIncrementId xsi:type="xsd:string">[ORDERNUMBER REMOVED]</shipmentIncrementId><carrier xsi:type="xsd:string">custom</carrier><title xsi:type="xsd:string">Tracking</title><trackNumber xsi:type="xsd:string">[TRACKING NUMBER REMOVED]</trackNumber><weight xsi:nil="true"/></ns1:salesOrderShipmentAddTrack></SOAP-ENV:Body></SOAP-ENV:Envelope>

image

SOAP - Pricing robot API Warning

strlen(): Passing null to parameter #1 ($string) of type string is deprecated /lib/Unserialize/Reader/Str.php

(Stack trace includes Amasty/Magpleasure Tierprice module) SOAP: urn:Action

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><q1:catalogProductInfo xmlns:q1="urn:Magento"><sessionId xsi:type="xsd:string">xxxxxxxxxxxxxxxxxxxxx</sessionId><productId xsi:type="xsd:string">[PRODUCT SKU REDACTED]</productId><storeView xsi:type="xsd:string">[STORE ID REDACTED]</storeView><attributes href="#id1"/><identifierType xsi:type="xsd:string">sku</identifierType></q1:catalogProductInfo><q2:catalogProductRequestAttributes id="id1" xsi:type="q2:catalogProductRequestAttributes" xmlns:q2="urn:Magento"><additional_attributes href="#id2"/></q2:catalogProductRequestAttributes><q3:Array id="id2" q3:arrayType="xsd:string[1]" xmlns:q3="http://schemas.xmlsoap.org/soap/encoding/"><Item>price_position</Item></q3:Array></s:Body></s:Envelope>

image

Klaviyo Cart API

Array to string conversion /lib/Zend/Soap/Server.php

Soap Action: urn:Mage_Api_Model_Server_V2_HandlerAction

Soap Call:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://www.w3.org/2001/XMLSchema" xmlns:ns3="urn:Magento" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header/><ns1:Body><ns3:shoppingCartInfo><sessionId xsi:type="ns2:string">xxxxxxxxxxxxxxxxxxxx</sessionId><quoteId xsi:type="ns2:int">[QUOTE ID REDACTED]</quoteId><storeId xsi:type="ns2:string">[STORE ID REDACTED]</storeId></ns3:shoppingCartInfo></ns1:Body></SOAP-ENV:Envelope>
kiatng commented 1 year ago

Ver 19.4.23 does not seem to get PR #2802. Try merging it to your instance. May be also PR #2856.

[edit] For the other errors, I think it's best to update to the latest v19.

m-overlund commented 1 year ago

Thanks a lot - will try the patches. You mean v19.5.0 RC2?

v19.4.23 should be newest v19 release?

kiatng commented 1 year ago

I defer to @fballiano on the right version.

fballiano commented 1 year ago

https://github.com/OpenMage/magento-lts/pull/2802 was merged in https://github.com/OpenMage/magento-lts/releases/tag/v19.5.0-rc1 ;-)

addison74 commented 1 year ago

@m-overlund - Did the recommendations that were made to you solve the issue? If yes, then we can close this ticket.

m-overlund commented 1 year ago

@ADDISON74 kiang's recommandations only partially solves this issue. Waiting to confirm if rc1 or rc3 solved the last issues.

I can close and reopen, if that serves the project better :)

addison74 commented 1 year ago

@m-overlund - Let's close it when you consider the problem solved.