akeneo / magento2-connector-community

Akeneo Connector for Magento 2
Open Software License 3.0
81 stars 88 forks source link

Wrong variable type in Helper/Import/Product.php #608

Open nenes25 opened 1 year ago

nenes25 commented 1 year ago

Environment and configuration

  1. Magento 2.4.4
  2. php 8.1
  3. Akeneo connector : 103.0.6

Steps to reproduce

  1. Launch import through cli php bin/magento akeneo_connector:import --code=product

Expected result

1.The process should finish

Actual result

1.The process fail with error Argument #1 ($string) must be of type string, int given image

The variable $suffix is an int, and the function strlen expects a string In order to fix it we have modify the related line to this $product->setUrlKey(substr($product->getUrlKey(), 0, -(strlen((string)($suffix - 1)) + 1)) . '-' . $suffix);

Regards,