akeneo / magento2-connector-community Goto Github PK
View Code? Open in Web Editor NEWAkeneo Connector for Magento 2
License: Open Software License 3.0
Akeneo Connector for Magento 2
License: Open Software License 3.0
Hi,
Thanks for writing this module, it's a real improvement over the old Pimgento module!
I have one suggestion, I see that the Magento FPC and block_html caches are cleared after processing the new entities from Akeneo. Here for example: \Akeneo\Connector\Job\Product::cleanCache
. In the product example, this means that all of the pages are purged from the FPC after a Akeneo import. It would be more elegant I think to use the build in clean_cache_by_tags
event, so we will partically clean the FPC and only the updated records will be purged.
Magento also does this a lot in the core modules, for example in the module-catalog-inventory. Check \Magento\CatalogInventory\Model\Indexer\Stock\CacheCleaner::clean
$productIds = $this->getProductIdsForCacheClean($productStatusesBefore, $productStatusesAfter);
if ($productIds) {
$this->cacheContext->registerEntities(Product::CACHE_TAG, array_unique($productIds));
$this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]);
}
Would this be something you'd consider for this module?
in magento's root directory run the following commands:
Module should be update successfully and magento should work properly.
2. Logs during composer update:
After this update none of the magento's commands are working in terminal.
Magento's frontend and backend are stuck on loading.
Not sure why this issue arise. But I have been importing products with respect to attribute set, because we have 400K products in akeneo, so I am importing in chunks. in configuration of connector on magento's admin page I am selecting about 10 to 15 attribute sets to be imported, import the products and then I select other 10 to 15 attribute sets in config.
After several successful imports of products I have came accross this issue once for some attribute sets.
[13:55:38] SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '-3.html-3' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID', query was: UPDATE url_rewrite
SET request_path
= ?, metadata
= ? WHERE (url_rewrite_id = '513121')
Magento 2.3.2 Enterprise
Akeneo 2.3.53
In the Magento control panel I am attempting to import products from Akeneo into Magento 2. I am successfully able to import all entity types (categories, families, attributes, etc.) except for product entities.
Additionally, I checked the API configuration and I seem to have all permissions applied for the configured user. I checked the PIM server apache access logs and I see the Guzzle request for an API token, but no subsequent call is ever made. All of the other entity types hit the api no problem after that.
For further testing, I went ahead and manually tested the API using the same credentials I have saved in Magento. I am able to make rest calls via curl without a problem.
I would expect the products to import like the rest of the entities.
I receive the following error:
[17:47:14] Start import
[17:47:14] Import ID : 5d5d83a204368
[17:47:14] Create temporary table
[17:47:14] Forbidden```
Any help would be appreciated.
Hello,
I Installed the connector this afternoon.
At the beginning it was working well and I could access the Akeneo Connector Menu in the Catalog of the Configuration.
Then, each time I accessed it, the query was getting longer and longer (was longer to reach it).
Until when finally, I couldn't reach it anymore (Gateway Timeout).
Now it's no longer possible to access the Akeneo Connector from M2.
The rest of M2 menus are working well and are instantly accessible.
Also, I haven't performed any change neither on M2, nor on my Server.
I suspect a problem with the Cron, but maybe I am wrong.
What do you think can be done to recover the access ?
Thanks for your advice.
Magento 2.3.4 EE
Akeneo 3.2
Latest Connector
PHP 7.2
After importing all products from Akeneo to Magento, I noticed that there were attribute values assigned to products for attributes that are not in the products family.
There should only be attribute values assigned to products for attributes that are within the product family.
For example, I have an entity_id (row_id in EE) of 3117. There are ~100 attributes assigned to this attribute set/family in Akeneo.
However, there are over 230 entries for just this entity in the magento catalog_product_entity_varchar table. A majority of them are null, because these attributes are not assigned to the products.
I have been able to clean it up with a series of SQL queries, but the problem will happen the next time that product is imported. This is causing issues with other extensions.
CREATE TABLE catalog_product_entity_int_old LIKE catalog_product_entity_int;
INSERT INTO catalog_product_entity_int_old SELECT * FROM catalog_product_entity_int;
DELETE FROM catalog_product_entity_int
WHERE value_id IN
(SELECT cpei.value_id
FROM catalog_product_entity_int_old cpei
WHERE cpei.attribute_id NOT IN
(SELECT eea.attribute_id
FROM eav_entity_attribute eea
JOIN catalog_product_entity cpe ON eea.attribute_set_id = cpe.attribute_set_id
WHERE cpe.row_id = cpei.row_id)
ORDER BY cpei.row_id);
DROP TABLE catalog_product_entity_int_old;
CREATE TABLE catalog_product_entity_varchar_old LIKE catalog_product_entity_varchar;
INSERT INTO catalog_product_entity_varchar_old SELECT * FROM catalog_product_entity_varchar;
DELETE FROM catalog_product_entity_varchar
WHERE value_id IN
(SELECT cpei.value_id
FROM catalog_product_entity_varchar_old cpei
WHERE cpei.attribute_id NOT IN
(SELECT eea.attribute_id
FROM eav_entity_attribute eea
JOIN catalog_product_entity cpe ON eea.attribute_set_id = cpe.attribute_set_id
WHERE cpe.row_id = cpei.row_id)
ORDER BY cpei.row_id);
DROP TABLE catalog_product_entity_varchar_old;
CREATE TABLE catalog_product_entity_text_old LIKE catalog_product_entity_text;
INSERT INTO catalog_product_entity_text_old SELECT * FROM catalog_product_entity_text;
DELETE FROM catalog_product_entity_text
WHERE value_id IN
(SELECT cpei.value_id
FROM catalog_product_entity_text_old cpei
WHERE cpei.attribute_id NOT IN
(SELECT eea.attribute_id
FROM eav_entity_attribute eea
JOIN catalog_product_entity cpe ON eea.attribute_set_id = cpe.attribute_set_id
WHERE cpe.row_id = cpei.row_id)
ORDER BY cpei.row_id);
DROP TABLE catalog_product_entity_text_old;
CREATE TABLE catalog_product_entity_decimal_old LIKE catalog_product_entity_decimal;
INSERT INTO catalog_product_entity_decimal_old SELECT * FROM catalog_product_entity_decimal;
DELETE FROM catalog_product_entity_decimal
WHERE value_id IN
(SELECT cpei.value_id
FROM catalog_product_entity_decimal_old cpei
WHERE cpei.attribute_id NOT IN
(SELECT eea.attribute_id
FROM eav_entity_attribute eea
JOIN catalog_product_entity cpe ON eea.attribute_set_id = cpe.attribute_set_id
WHERE cpe.row_id = cpei.row_id)
ORDER BY cpei.row_id);
DROP TABLE catalog_product_entity_decimal_old;
Nothing to reproduce.
magento2-connector-community/Job/Import.php
Line 441 in 9edbe8f
I have some Attributes Groups and Families in Akeneo. After sync attribute and family from Magento all attributes were created under "Akeneo" group only to all family. Is any solution or suggestion for this ?
No mapping defined for url_key field
An url_key attribute is created in akeneo with Value per locale, BUT NOT Value per channel
Import products
The url_rewrite in magento should be created/updated with the value of the url_key attribute in Akeneo
The url_rewrite in magento should be created/updated with the value of the identifier
The Found error is an exception thrown in api-php client which is used by Connector. This happens when the next page content is getting imported. The http url of the next page is redirected to https which is causing the RedirectionException and printing the HTTP response for code 302 which is "Found"
This issue is related to my other issue in the Akeneo PHP API client : akeneo/api-php-client#171
This is a Feature request
When the url_key attribute in akeneo is modified, and if magento is configured to create permanent redirect for URLs if URL key is changed (https://docs.magento.com/m2/ce/user_guide/marketing/url-redirect-product-automatic.html) , the redirect urlrewrite should be created in magento database.
Think the connector should mimic Magento\CatalogUrlRewrite\Observer\AfterImportDataObserver behaviour
Attribute mapping in Stores -> Configuration -> Catalog -> Akeneo Connector -> Products -> Attribute Mapping
I am trying to get the first image from a variant product and set it as the image of product model on magento.
Configurable
Attribute Type Value
+-------------------------------------
model_name Mapping name
image_default First Variant
Result:
Both simples and configurables have images but for configurables it is not associated with all four types of images. Swacher is
Configurable, when looking at images on edit product page I can see all the four tags are associated to the imported image (base, swatcher, thumb, small).
Here is the image for simple product which is the variant.
Here is the result for image import for configurable product:
config.xml
or in setup script, so without any configuration url key, as crucial magento attribute, should work out of a boxMagento 2.3.2
Akeneo Magento 2 Connector 100.1.1
PHP 7.2
MySQL 5.6
When I run Akeneo connector import from the command line, I receive the following error:
$ bin/magento akeneo_connector:import --code=family
In Developer.php line 55:
Circular dependency: Magento\Logging\Model\Handler\Controllers depends on Magento\Logging\Model\Handler\Controllers and vice versa.
akeneo_connector:import [--code CODE]
Please note that I can run all of these jobs from the web interface without any problems. I have tried all of the different code types as well (product, family, category, etc.)
It should run an import as it does from the web interface.
$ bin/magento akeneo_connector:import --code=family
In Developer.php line 55:
Circular dependency: Magento\Logging\Model\Handler\Controllers depends on Magento\Logging\Model\Handler\Controllers and vice versa.
akeneo_connector:import [--code CODE]
Any help would be appreciated! Thank you!
Hi
Any idea how to triage this:
php bin/magento akeneo_connector:import --code=product_model
[12:31:19] Start import
[12:31:19] Import ID : 5db19997c535f
[12:31:19] Create temporary table
[12:31:20] completed
[12:31:20] Fill temporary table
[12:31:24] Internal Server Error
I have looked for some log information but didn't find anything.
Thanks
Martin
While debugging, I found that in the following code, the associationName for up-sell and related were not present and it only had cross-sell.
So, the existing associations were deleted and while creating the new ones, the related and up-sell associations were intact but the cross-sell association was deleted. It created cross-sell associations ONLY for products that were imported from PIM.
Hello,
I am unable to save or Test my API Configuration of the Connector.
It was impossible to identify the root cause of the issue, and a way to replicate it.
I fill in all the required credentials properly (PIM URL, Akeneo user & its Password, Client ID, Client Secret), but the Test Button remains Grey and the Save Config gives an error "Gateway error".
Despite the TEST button remains Grey (=inactive), We pointed that the gateway error is caused when we try to save the Client Secret. After this error is reached, it's no longer possible to access the config page of the connector. We have to purge manually the Client secret, through phpMyAdmin, in the field "akeneo_connector/akeneo_api/client_secret". Then purge the cache at Magento level, in order to regain access to the Config Page.
Hence, in conclusion, for me it's even impossible to try the connector.
All the credentials are true and accurate.
Hence, would you have an idea to unbug this problem ? (at least to ungrey the TEST button, if possible).
Thanks in advance,
Best regards,
Akeneo Select Type Attribute saved as Text Field Type in Magento, Also attribute options do not import.
{"0":"The \"formElement\" configuration parameter is required for the \"camera_type\" field.",
Hi,
we're formatting / customizing some attributes after the import and are using the event akeneo_connector_import_step_finish
for this.
However, when I call $observer->getImport()->setAdditionalMessage("my message")
in my observer, the message never shows up.
I assume this is due to the response getting generated before the event:
https://github.com/akeneo/magento2-connector-community/blob/master/Job/Import.php#L447
Can we
This way, I can tell the user what has been done, and also show exception messages if an error occured.
I'd be happy to submit a PR if you accept this feature.
Thanks
Simon
The issue is with creating a url_key in magento for configurable products. The urk_key is the url value that Magento automatically creates for every product, based on the product name.
In the connector configuration you are required for both simple and configurable products to map an Akeneo attribute to the Magento url_key attribute.
The simple configuration works fine. I have mapped the Akeneo name attribute to Magento url_key. A product with the name "Some Product Name" gets a Magento url_key populated correctly "some-product-name".
The configurable product import does not work correctly. Instead of creating the configurable product url_key as "some-product-name" it creates it as "Some Product Name"
A second related connector configurable error
I have had to change how I setup configurable variants in Akeneo by making a products name configurable at a variant level. For example Tshirt available in different colours. In theory this should be set up as Name being a common attribute and colour used to differentiate each variation. Instead I have had to create a unique name for each variation, e.g. Red Tshirt, Blue tshirt etc...
I have had to do this because when trying to import these products into Magento I was getting SQL duplicate entry error messages because the connector was trying to create url_keys for the different variations, but I think it was not including the colour variation when trying to create a url_key for each variation.
Hello there,
I'm using the Akeneo Magento 2 Community Connector on Magento 2.3.3 and running into an issue when I try to import the categories from Akeneo
When I start the import in Magento following error comes up:
[15:30:24] Start import
[15:30:24] Import ID : 5dfa46103b7e0
[15:30:24] Create temporary table
[15:30:25] completed
[15:30:26] Fill temporary table
[15:30:26] 2 line(s) found.
[15:30:27] Match code with Magento ID
[15:30:27] completed
[15:30:27] Create structure
[15:30:27] completed
[15:30:28] Create URL key
[15:30:28] Notice: Undefined index: parent_id in
httpdocs/vendor/akeneo/module-magento2-connector-community/Job/Category.php on line 296
Any one knows the reason?
Cheers
Ramin
I have mapped two attributes from Akeneo to Magento. Upon importing, these values are both set as blank within Magento. It appears that all other data for custom attributes is mapped.
Attributes Mapped in Magento Admin:
Snippets from the Akeneo rest API:
For the title attribute
"title": [
{
"locale": "en_US",
"scope": null,
"data": "Test Product Name"
}
],
For the shipping_weight attribute:
"shipping_weight": [
{
"locale": null,
"scope": null,
"data": {
"amount": "31.0000",
"unit": "POUND"
}
}
],
The data should be mapped
Both fields come up empty in Catalog -> Products. All other fields including description, short_description and custom attributes appear to be fine.
Hi
I've connected M2 to my Akeneo v3.1 install and the product model import fails due to an empty $product on line 179 of Helper/Import/Product.php. I've added a line to prevent this from failing - no idea why my $product array should be empty here :o(
`
foreach ($types as $key => $products) {
if (empty($products)) continue; /* ADDED LINE */
/** @var string $name */
$name = $group . '-' . $key;
$associations[$name] = implode(',', $products);
}
`
Hi,
I notice that the mapping of file type attributes does not work well.
A file attribute in Akeneo is transform as input in Magento and when import Akeneo attributes values in Magento, the file is not downloaded in Magento media folder.
Is there a solution for that ?
Edit: as explain on https://help.akeneo.com/magento2-connector/v100/articles/what-data.html
"As Magento 2 doesn't support the import of binary files other than images, the connector only import the relative PIM path for this attribute."
So there is no solution to import files fields between Akeneo - Magento ?
Bonjour,
Lorsque nous avons des codes d'attributs avec une majuscule coté Akénéo, ceux-ci ne sont pas importés dans la fonction setValues() dans Job/Product.php car dans Magento les codes d'attributs sont en minuscule.
Cordialement
Alexis
Receiving the following error while importing data in my Magento2.3 instance using the latest version of the Akeneo Connector:
[21:46:43] SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (magento2.eav_attribute_group, CONSTRAINT EAV_ATTR_GROUP_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID FOREIGN KEY (attribute_set_id) REFERENCES eav_attribute_set (attribute_set_id) ON DELE), query was: INSERT INTO eav_attribute_set (attribute_set_id, entity_type_id, attribute_set_name, sort_order) SELECT tmp_akeneo_connector_entities_family._entity_id AS attribute_set_id, 4 AS entity_type_id, CONCAT("Pim", " ", labels-en_US) AS attribute_set_name, 1 AS sort_order FROM tmp_akeneo_connector_entities_family ON DUPLICATE KEY UPDATE attribute_set_id = VALUES(attribute_set_id), entity_type_id = VALUES(entity_type_id), attribute_set_name = VALUES(attribute_set_name), sort_order = VALUES(sort_order)
What values need to be cleared out of the database before performing another import?
By the way if someone can tell what is best configuration of this filter to get only products 100% complete on each channel and locales, please let me know or writ it here.
I am not sure if this is a bug, a feature request, or just something I am missing. Is there a way to map images on variant products using the connector?
When I change to the variant option in Magento (in this case, changing the color), it does not change the image in Magento. I can still see the red version of the product in the gallery, but it doesn't automatically change.
Is there a way to configure the connector to do this? I have tried numerous Akeneo connector configuration options, but I am unable to get it to work as expected.
Any help is greatly appreciated.
It turned out that my installation of akeneo was broken, sth with database. However before discovering the issue with pim, I have already imported attributes, options and families. Connector didn't detected that my attribute data in pim is broken, so all custom imported attributes had backend type static (what means they require custom column in catalog_product_entity), and frontend_input was null (what broke product edit form). I doesn't really matter what was broken in pim instance, but the thing is that connector doesn't validate incoming data, what in production env can cause serious disaster.
The total number of sku's in Akeneo is around 150000. But am trying to to import 25000 products only from the whole based on category selection. But each and every product import step takes too much of time to finish. So the importing will not be completed.
What is the server capacity needed to done this ?
What other settings needed to done this ?
Is any other way to get this done ?
Has followed the documentation for setting the product name as the URL, but still, it uses the SKU as the URL.
Add Akeneo attribute mapping that points to the field «url_key»:
• Go to Store > Configuration > Catalog > Akeneo Connector
• Add attribute mapping
• Set Akeneo to «akeneo_product_name_field»
• Set Magento to «url_key»
• Save
Product name as the URL
SKU as URL
We have fixed the issue by changing the code in \app\code\Akeneo\Connector\Job\Option.php; Methods: createTable() and insertData(). Following are the changes that we did.
We have passed the paginationSize value to the $this->akeneoClient->getAttributeApi()->all() method. Please do fix this for us on Akeneo module.
Hi,
we're having an issue with URL rewrite generation.
I assume the root cause is:
On a first glance, this seems to happen in Job/Category.php
, lines 610ff.
Before generating a URL rewrite, the import should check if $category
(line 613) exists unter the root-category that $store
(defined in line 588) uses; this could be done by loading the store, and checking the first element of explode('/', $category->getPath())
, for example.
Is this correct, or do we have a misconfiguration somewhere?
Bonjour,
La traduction des labels d'attributs ne s'importent pas correctement pour certaines langues avec des codes langue avec 2 "_" (zh_Hans_CN, zh_Hant_HK, zh_Hant_TW, etc).
Dans la fonction insertData() les colonnes sont créés avec le code Akénéo : labels-zh_CN
ce qui ne match pas avec Magento. Quand on change la colonne par labels-zh_Hans_CN ca fonctionne bien.
Pareil pour les tables des options d'attributs, product model et product.
Cordialement
Alexis
irrelevant.
Actually this problem doesn't cause (it seems so) any problem with product import, because when we delete option in akeneo is deleted througouht product base, so we import products without this option. But we have other options in magento, and different set in akeneo.
While importing options some sort of compare should be performed, and options not existing in akeneo, should be deleted (but not with raw sql, because then we end up with products having not exisitng options)
It seems akeneo api has some limitations - it allows you to filter by completeness only in a scope of channel, so you fetch products complete on one channel and incomplete on another. So there a few things that can be done:
It is hard to notice it in admin panel as both null values and not exisitng values for specific store views causes just empty input for option label.
After second family import attributes are assigned to proper attribute groups in given attribute set.
On attribute set edit page, attributes are present, but not assigned to related attribute group.
It turns out that it is necessary, to import attributes again (even if they do not change, or there is no new one) to assign them to related groups in attribute sets.
I think it is not a bug, but very unintuitive behaviour. Family import should update all related data or at least give a hint to take some more steps (like import attributes again).
When I import a family from Akeneo it creates an Attribute Set with only a few attributes (sku, ean, title, and primary image). And is missing some pretty crucial attributes from the default attributeset (including price, description, etc).
How can I make it so, that when the connector imports and creates the attribute sets from Akeneo into Magento, it will base the new attribute set on the default Magento attribute set?
Thanks!
It is quite edge case, but it sometimes occurs. While having attribute in magento with source model bound, and corresponding one with options in akeneo, we stilll got these options imported as eav options. It occurs for example if we create tax_class_id
. Its options from akeneo are inserted into eav_attribute_option_*
tables. There is no validation that attribute has source model. On the other hand it doesn't seem to break anything, but it is confusing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.