Skip to content

Commit

Permalink
Fixed: Fixed invalid handling when URL rewrites have been deleted (e.…
Browse files Browse the repository at this point in the history
… g. because category product relation has been removed) and re-created - Feature Release: Add functionality to remove old image + image tags when products are updated + Add configurable functionality to remove entity attributes with empty values in column names + Add configurable functionality to remove old URL rewrites that not longer exists + Add configurable functionality to remove category product relations that not longer exists in the CSV file
  • Loading branch information
wagnert committed Sep 2, 2017
1 parent 666c581 commit e49f07b
Show file tree
Hide file tree
Showing 16 changed files with 772 additions and 314 deletions.
2 changes: 1 addition & 1 deletion .semver
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
:major: 1
:minor: 0
:patch: 0
:special: 'beta.49'
:special: 'beta.50'
:metadata: ''
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Version 1.0.0-beta50

## Known Issues

* None

## Bugfixes

* Fixed invalid handling when URL rewrites have been deleted (e. g. because category product relation has been removed) and re-created

## Features

* Add functionality to remove old image + image tags when products are updated
* Add configurable functionality to remove entity attributes with empty values in column names
* Add configurable functionality to remove old URL rewrites that not longer exists
* Add configurable functionality to remove category product relations that not longer exists in the CSV file

# Version 1.0.0-beta49

## Known Issues
Expand Down
180 changes: 180 additions & 0 deletions UPGRADE-1.0.0-beta50.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Upgrade from 1.0.0-beta49 to 1.0.0-beta50

## Product Configuration

### Image Upload Functionality

The params for the image upload configuration has to be moved from the subject with the ID `import_product_media.subject.media` to the one with the ID `import_product.subject.bunch`, as the files has to be copied before the product attributes are created. Additionally the new observer with the ID `import_product.observer.file.upload` has to be added to this subject, as well as the old `import_product_media.observer.file.upload` has to be removed from the subject with the ID `import_product_media.subject.media`. This has to be configured for the `add-update` as well as the `replace` operation.

```json
{
{
...
{
"id": "import_product.subject.bunch",
"identifier": "files",
"prefix": "product-import",
"params" : [
{
"copy-images" : false
}
],
"observers": [
{
"pre-import": [
...
"import_product.observer.url.key",
"import_product.observer.file.upload"
}
}
],
...
}
}
}
```

### Remove Attribute Values when Column in CSV file is empty (only add-update operation)

The new functionality to remove product/category attribute values when the column in the CSV file is empty, can be configured by simply add the column names to the parameter `clean-up-empty-columns` to the parameters for the subject with the ID `import_product_media.subject.media`.

```json
{
{
...
{
"id": "import_product.subject.bunch",
"identifier": "files",
"prefix": "product-import",
"params" : [
{
"copy-images" : false,
"clean-up-empty-columns" : [ "base_image", "small_image", "swatch_image", "thumbnail_image" ]
}
],
"observers": [
{
"pre-import": [
...
"import_product.observer.url.key",
"import_product.observer.file.upload"
}
}
],
...
}
}
}
```

### Remove Category Relations when not longer in CSV file (only add-update operation)

The new functionality to remove product category relations when they have been removed from the CSV file, can be configured by simply add the parameter `clean-up-category-product-relations` with the value `true` to the parameters for the subject with the ID `import_product_media.subject.media`.

```json
{
{
...
{
"id": "import_product.subject.bunch",
"identifier": "files",
"prefix": "product-import",
"params" : [
{
"copy-images" : false,
"clean-up-category-product-relations" : true
}
],
"observers": [
{
"pre-import": [
...
"import_product.observer.url.key",
"import_product.observer.file.upload"
}
}
],
...
}
}
}
```

### Remove Images and Images Tags when not in CSV file (only add-update operation)

The new functionality to remove images when they have been removed from the CSV file, can be configured by simply add the parameter `clean-up-media-gallery` with the value `true`, as well as adding the new observer `import_product_media.observer.clear.media.gallery`, to the parameters for the subject with the ID `import_product_media.subject.media`

```json
{
{
...
{
"id": "import_product.subject.bunch",
"identifier": "files",
"prefix": "product-import",
"params" : [
{
"copy-images" : false,
"clean-up-media-gallery" : true
}
],
"observers": [
{
"import": [
...
"import_product_media.observer.product.media",
"import_product_media.observer.clear.media.gallery",
"import_product_link.observer.product.link"
}
}
],
...
}
}
}
```

## Category Configuration

### Image Upload Functionality

The params for the image upload configuration has to be moved from the subject with the ID `import_category.subject.media` to the one with the ID `import_category.subject.bunch`, as the files has to be copied before the category attributes are created. Additionally the observer with the ID `import_category.observer.file.upload` has to be moved to this subject as the existing observer with the ID `import_category.observer.category.image` has to be removed. IN addition, the complete subject `import_category.subject.media` has to be removed. This has to be configured for the `add-update` as well as the `replace` operation.

```json
{
{
...
{
"id": "import_category.subject.bunch",
"identifier": "files",
"prefix": "category-create",
"params" : [
{
"copy-images" : false
}
],
"observers": [
{
"pre-import": [
...
"import_category.observer.file.upload"
]
},
{
"import": [
"import_category.observer.category",
"import_category.observer.category.attribute",
"import_category.observer.url.rewrite"
]
},
{
"post-import": [
"import_category.observer.clean.up"
]
}
]
},
...
}
}
```
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@
"symfony/yaml": "~2.8.7|~3.0.7|~3.1.1|~3.2",
"symfony/expression-language": "~2.8|~3.0",
"symfony/dependency-injection": "~2.3, !=2.7.0",
"techdivision/import": "1.0.0-beta45",
"techdivision/import-ee": "1.0.0-beta6",
"techdivision/import": "1.0.0-beta47",
"techdivision/import-ee": "1.0.0-beta7",
"techdivision/import-app-simple": "1.0.0-beta10",
"techdivision/import-configuration-jms": "1.0.0-beta18",
"techdivision/import-attribute": "1.0.0-beta17",
"techdivision/import-category": "1.0.0-beta19",
"techdivision/import-category-ee": "1.0.0-beta14",
"techdivision/import-product": "1.0.0-beta32",
"techdivision/import-product-url-rewrite": "1.0.0-beta3",
"techdivision/import-category": "1.0.0-beta21",
"techdivision/import-category-ee": "1.0.0-beta16",
"techdivision/import-product": "1.0.0-beta36",
"techdivision/import-product-url-rewrite": "1.0.0-beta5",
"techdivision/import-product-link": "1.0.0-beta5",
"techdivision/import-product-media": "1.0.0-beta7",
"techdivision/import-product-media": "1.0.0-beta10",
"techdivision/import-product-bundle": "1.0.0-beta5",
"techdivision/import-product-variant": "1.0.0-beta4",
"techdivision/import-product-ee": "1.0.0-beta18",
"techdivision/import-product-ee": "1.0.0-beta20",
"techdivision/import-product-link-ee": "1.0.0-beta7",
"techdivision/import-product-media-ee": "1.0.0-beta7",
"techdivision/import-product-media-ee": "1.0.0-beta8",
"techdivision/import-product-bundle-ee": "1.0.0-beta5",
"techdivision/import-product-variant-ee": "1.0.0-beta5"
},
Expand Down
Loading

0 comments on commit e49f07b

Please sign in to comment.