Giter Site home page Giter Site logo

synolia / syliusakeneoplugin Goto Github PK

View Code? Open in Web Editor NEW
21.0 13.0 21.0 2.5 MB

This Sylius plugin allows you to import data from Akeneo PIM

License: European Union Public License 1.2

JavaScript 0.36% PHP 96.87% SCSS 0.13% Twig 2.32% Makefile 0.32%
sylius-plugin akeneo-pim sylius

syliusakeneoplugin's People

Contributors

adrienlucas avatar baiiko avatar dependabot[bot] avatar galloisluca avatar geolim4 avatar jibbarth avatar maxperei avatar oallain avatar thegrimmchester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

syliusakeneoplugin's Issues

[Bug] FamilyVariationAxeProcessor doesn't remove old axes from variationAxes

Describe the bug
When the variationAxes of a family are modified in Akeneo, the plugin only adds new axes in akeneo_product_group. Old axes are never purged from the variationAxes array.

To Reproduce
Steps to reproduce the behavior:

  1. Sync families : bin/console akeneo:import:families
  2. In database, pick any entry in akeneo_product_group and set a fake variationAxes value (ex : a:1:{i:0;s:10:"dummy_axis";}
  3. Sync families again : bin/console akeneo:import:families
  4. Check your entry in akeneo_product_group : variationAxes now has the correct axes and dummy_axis remains.

Expected behavior
When an attribute is no longer used as a variation axis, it should be purged from akeneo_product_group when families are imported.

[Bug] Import product failure?

Describe the bug
Hello,

During product import, it looks like some steps are missing.
No product were imported but the temporary table contains the products I need from the akeneo API.

I don't know if something is missing, maybe you can help with some things to check ?

Expected behavior
Products are imported

Screenshots

$ bin/console akeneo:import:products -vvv
11:43:50 NOTICE    [akeneo] akeneo:import:products
11:43:50 DEBUG     [akeneo] Synolia\SyliusAkeneoPlugin\Task\Product\ProcessProductsTask
11:43:50 NOTICE    [akeneo] Retrieve Product from Akeneo API
11:43:52 NOTICE    [akeneo] End of : akeneo:import:products

Additional context
PHP 8
Sylius 1.11.7

[Bug] Category import broken on Sylius 1.10.4 and PHP 8.0

Describe the bug
Only root category is imported. Sub categories are not imported.

it seems that it is caused by re-assigning parent and root categories after saving taxon without parent in Synolia\SyliusAkeneoPlugin\Task\Category\CreateUpdateEntityTask

It is also reflected in logs:

11:35:09 INFO      [akeneo] Category "motorsensen_freischneider" will be created
11:35:09 WARNING   [akeneo] Root cannot be changed manually, change parent instead

To Reproduce
Steps to reproduce the behavior:

  1. Run php bin/console akeneo:import:categories -vvv
  2. Check taxons in admin (should be missing)

Expected behavior
Sub-categories are imported correctly

Additional context
Sylius 10.0.4, PHP 8.0

[Feature] Upgrade akeneo/api-php-client-ee SDK

Hello,

First of all, thank you for this plugin !

Is there any chance you could consider upgrading to (at least) v5.0.0 for the akeneo/api-php-client-ee SDK in order to have access to the "AssetManager" APIs ?

Thanks !

Issue importing attributes of type akeneo_reference_entity

Hi,

We're having problems importing products which references to an akeneo_reference_entity. In order to do this, firstly we need to import attributes in sylius_product_option table and their values in sylius_product_option_value with the akeneo:import:attributes command.

The previous command retrieves attributes and when it does import them as options, this line unfortunatly ignores everything which is not pim_catalog_simpleselect / select (SelectAttributeTypeMatcher) or pim_catalog_multiselect / multiselect (MultiSelectAttributeTypeMatcher) :
https://github.com/synolia/SyliusAkeneoPlugin/blob/v2.1.0/src/Task/AttributeOption/RetrieveOptionsTask.php#L55
Therefore my resource with type akeneo_reference_entity (ReferenceEntityAttributeTypeMatcher) is skipped and values in sylius_product_option_value are not created.

Do you have any information why this is not imported ?

Best regards.

This is part of my https://*****.cloud.akeneo.com/api/rest/v1/attributes call :

// ...
      {
        "_links": {
          "self": {
            "href": "https:\/\/*****.cloud.akeneo.com\/api\/rest\/v1\/attributes\/gce_color_variant"
          }
        },
        "code": "gce_color_variant",
        "type": "akeneo_reference_entity",
        "group": "axe_declinaison",
        "unique": false,
        "useable_as_grid_filter": false,
        "allowed_extensions": [],
        "metric_family": null,
        "default_metric_unit": null,
        "reference_data_name": "coloris_gce",
        "available_locales": [],
        "max_characters": null,
        "validation_rule": null,
        "validation_regexp": null,
        "wysiwyg_enabled": null,
        "number_min": null,
        "number_max": null,
        "decimals_allowed": null,
        "negative_allowed": null,
        "date_min": null,
        "date_max": null,
        "max_file_size": null,
        "minimum_input_length": null,
        "sort_order": 0,
        "localizable": false,
        "scopable": false,
        "labels": {
          "fr_FR": "Coloris"
        },
        "guidelines": {},
        "auto_option_sorting": null,
        "is_read_only": false,
        "default_value": null,
        "group_labels": {
          "fr_FR": "Axe déclinaison"
        }
      },
// ...

And call to https://*****.cloud.akeneo.com/api/rest/v1/reference-entities/coloris_gce/records :

// ...
      {
        "_links": {
          "self": {
            "href": "https:\/\/*****.cloud.akeneo.com\/api\/rest\/v1\/reference-entities\/coloris_gce\/records\/t01_1002_bordeau"
          }
        },
        "code": "t01_1002_bordeau",
        "values": {
          "label": [
            {
              "locale": "fr_FR",
              "channel": null,
              "data": "Bordeaux"
            }
          ],
          "image": [
            {
              // ...
            }
          ],
          "gce_supplier_name": [
            {
              "locale": null,
              "channel": null,
              "data": "John Doe"
            }
          ],
          "gce_supplier_internal_fabric_reference": [
            {
              "locale": null,
              "channel": null,
              "data": "Tissu bonnie"
            }
          ],
          "pim_main_color": [
            {
              "locale": null,
              "channel": null,
              "data": [
                "rouge"
              ]
            }
          ]
        }
      },
// ...

[Feature] Allow mapping for locales between Akeneo and Sylius

Is your feature request related to a problem? Please describe.
We are using languages as locales in Sylius (en, de, ...) instead of en_US, de_DE, ... as Akeneo requires.
Right now I did not find a possibility to configure a mapping between these. Unless I missed something?

Describe the solution you'd like
I need to somehow be allowed to map the locales between both systems. We discussed this class in Slack yesterday: https://github.com/synolia/SyliusAkeneoPlugin/blob/master/src/Provider/SyliusAkeneoLocaleCodeProvider.php but as far as I see it, it's impossible to override/circumvent as it's final and hardcoded into several other class constructors as a type hint. If it were implementing an Interface which is used as type hint everywhere, I could replace the class with my own logic via decorator.

Describe alternatives you've considered
Not sure that I found any so far.

[Bug] PHPStan error on badly declared entity repository

Describe the bug
Entities with repository declared like so : @ORM\Entity(repositoryClass="CategoryConfigurationRepository") mess with the Doctrine PHPStan extension https://github.com/phpstan/phpstan-doctrine.

The classname should be complete in the repositoryClass param.

To Reproduce
Steps to reproduce the behavior:

  1. Install https://github.com/phpstan/phpstan
  2. Install https://github.com/phpstan/phpstan-doctrine
  3. Configure PHPStan to use the doctrine extension
  4. Use code like :
$respository = $entityManager->getRepository(CategoryConfiguration::class);
$data = $respository->findAll();

Expected behavior
No PHPStan error.

Error

Call` to method findAll() on an unknown class Synolia\SyliusAkeneoPlugin\Entity\CategoryConfigurationRepository.

It seems the Doctrine extension based the class resolving of the repositoy on the repositoryClass param, and it is not a fully declared namespace so the detected namespace is not the right one.

[Bug] /admin/akeneo/attributes throws error due missing table (v2.3.0)

Describe the bug
Attributes configuration page in admin is not available due the missing table error

it seems it is caused by calling RetrieveAttributesTask without prior SetupAttributeTask (which creates temp table) in Synolia\SyliusAkeneoPlugin\Form\Type\AttributeCodeChoiceType

To Reproduce
Steps to reproduce the behavior:

  1. I click Akeneo -> Attributes menu item '/admin/akeneo/attributes'
  2. I see error SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.tmp_akeneo_attributes' doesn't exist

Expected behavior
I can configure attributes mapping

Additional context
I am concerned with race condition when someone clicks akeneo->attributes menu item in admin during attribute import. I think it may lead to unexpected behaviors (or processing incomplete data)

[Bug] Refresh token expire

Describe the bug
The connection to Akeneo may be interrupted during an import and the refresh token may no longer be valid, which produces a fatal error.

To Reproduce
I don't have a scenario to reproduce this issue, it's quite random.

Expected behavior
Catch error and auto login to akeneo.

Screenshots

17:25:37 NOTICE    [akeneo] akeneo:import:attributes
17:25:38 DEBUG     [akeneo] Synolia\SyliusAkeneoPlugin\Task\Attribute\RetrieveAttributesTask
17:25:38 NOTICE    [akeneo] Retrieve Attribute from Akeneo API

In HttpExceptionHandler.php line 58:
                                                                           
  [Akeneo\Pim\ApiClient\Exception\UnprocessableEntityHttpException (422)]  
  Refresh token is invalid or has expired                                  
                                                                           

Exception trace:
  at /app/vendor/akeneo/api-php-client/src/Client/HttpExceptionHandler.php:58
 Akeneo\Pim\ApiClient\Client\HttpExceptionHandler->transformResponseToException() at /app/vendor/akeneo/api-php-client/src/Client/HttpClient.php:47
 Akeneo\Pim\ApiClient\Client\HttpClient->sendRequest() at /app/vendor/akeneo/api-php-client/src/Api/AuthenticationApi.php:80
 Akeneo\Pim\ApiClient\Api\AuthenticationApi->authenticate() at /app/vendor/akeneo/api-php-client/src/Api/AuthenticationApi.php:59
 Akeneo\Pim\ApiClient\Api\AuthenticationApi->authenticateByRefreshToken() at /app/vendor/akeneo/api-php-client/src/Client/AuthenticatedHttpClient.php:68
 Akeneo\Pim\ApiClient\Client\AuthenticatedHttpClient->sendRequest() at /app/vendor/akeneo/api-php-client/src/Client/ResourceClient.php:54
 Akeneo\Pim\ApiClient\Client\ResourceClient->getResource() at /app/vendor/akeneo/api-php-client/src/Client/ResourceClient.php:85
 Akeneo\Pim\ApiClient\Client\ResourceClient->getResources() at /app/vendor/akeneo/api-php-client/src/Api/AttributeApi.php:61
 Akeneo\Pim\ApiClient\Api\AttributeApi->listPerPage() at /app/vendor/akeneo/api-php-client/src/Api/AttributeApi.php:71
 Akeneo\Pim\ApiClient\Api\AttributeApi->all() at /app/vendor/synolia/sylius-akeneo-plugin/src/Task/Attribute/RetrieveAttributesTask.php:36
 Synolia\SyliusAkeneoPlugin\Task\Attribute\RetrieveAttributesTask->__invoke() at /app/vendor/synolia/sylius-akeneo-plugin/src/Pipeline/Processor.php:31
 Synolia\SyliusAkeneoPlugin\Pipeline\Processor->process() at /app/vendor/league/pipeline/src/Pipeline.php:34
 League\Pipeline\Pipeline->process() at /app/vendor/synolia/sylius-akeneo-plugin/src/Command/ImportAttributesCommand.php:77
 Synolia\SyliusAkeneoPlugin\Command\ImportAttributesCommand->execute() at /app/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /app/vendor/symfony/console/Application.php:1023
 Symfony\Component\Console\Application->doRunCommand() at /app/vendor/symfony/framework-bundle/Console/Application.php:97
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /app/vendor/symfony/console/Application.php:271
 Symfony\Component\Console\Application->doRun() at /app/vendor/symfony/framework-bundle/Console/Application.php:83
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /app/vendor/symfony/console/Application.php:147
 Symfony\Component\Console\Application->run() at /app/bin/console:38

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.