Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #28 from flagbit/akeneo4
Browse files Browse the repository at this point in the history
Compatibility to Akeneo 4.0
  • Loading branch information
hackwell authored Apr 8, 2020
2 parents b28cc48 + 868220c commit 2ed8df5
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 26 deletions.
13 changes: 13 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
build:
nodes:
analysis:
environment:
apt_packages:
- libmagickwand-dev
- libmagickcore-dev
php:
version: 7.3
pecl_extensions:
- apcu
- imagick
- zip
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ cache:

matrix:
include:
- php: 7.2
- php: 7.3

before_install:
Expand All @@ -22,6 +21,9 @@ before_install:
# disable default memory limit
- export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo memory_limit = -1 >> $INI
# enable apcu
- echo "extension=apcu.so" >> $INI
- yes '' | pecl install imagick

install:
- travis_retry composer install $COMPOSER_OPTS
Expand Down
31 changes: 9 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,39 @@ This bundle is aimed to offer product clone functionality within Akeneo PIM.


## Installation ##
You can simply install the package with the following command.
You can install the package with the following command.

``` bash
composer require flagbit/product-cloner-bundle
```

### Enable the bundle ####

Enable the bundle in the kernel:
Add the bundle to the `config/bundles.php` file:

``` php
<?php

// app/AppKernel.php

protected function registerProjectBundles()
{
return [
// ...
new Flagbit\Bundle\ProductClonerBundle\FlagbitProductClonerBundle(),
// ...
];
}
return [
\Flagbit\Bundle\ProductClonerBundle\FlagbitProductClonerBundle::class => ['all' => true],
// ...
];
```

#### Import the routing ####
Now that you have activated and configured the bundle, all that is left to do is import the FlagbitProductClonerBundle
routing files.

``` yaml
# app/config/routing.yml
# config/routes/product_cloner.yml
flagbit_product_cloner:
resource: "@FlagbitProductClonerBundle/Resources/config/routing.yml"

```

Clear the cache:

``` bash
php bin/console cache:clear --env=prod
```
Build and install the new front-end dependencies (new translations, etc.)
``` bash
php bin/console pim:installer:assets --symlink --clean --env=prod
yarn run webpack
make cache assets css javascript-prod
```

## How to use it ##
Expand Down Expand Up @@ -95,6 +81,7 @@ This extension supports the latest Akeneo PIM CE/EE stable versions:
* 2.3 (LTS)
* 3.0 (LTS)
* 3.2 (LTS)
* 4.0

## License ##

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
],
"require": {
"akeneo/pim-community-dev": "^3.0",
"akeneo/pim-community-dev": "^4.0",
"ext-json": "*"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function __construct(
ConverterInterface $productValueConverter,
NormalizerInterface $constraintViolationNormalizer,
ProductBuilderInterface $variantProductBuilder,
array $attributeCodeBlacklist = []
array $attributeCodeBlacklist
) {

$this->productRepository = $productRepository;
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ProductModelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct(
SaverInterface $productModelSaver,
ValidatorInterface $validator,
NormalizerInterface $violationNormalizer,
array $attributeCodeBlacklist = []
array $attributeCodeBlacklist
) {
$this->productModelRepository = $productModelRepository;
$this->normalizer = $normalizer;
Expand Down
3 changes: 3 additions & 0 deletions src/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
- '@pim_catalog.validator.product'
- '@pim_enrich.normalizer.violation'
- '%flagbit_product_cloner.attribute_blacklist%'
tags: ['controller.service_arguments']

flagbit_product_cloner.controller.product:
class: Flagbit\Bundle\ProductClonerBundle\Controller\ProductController
arguments:
Expand All @@ -28,3 +30,4 @@ services:
- '@pim_enrich.normalizer.product_violation'
- '@pim_catalog.builder.product'
- '%flagbit_product_cloner.attribute_blacklist%'
tags: ['controller.service_arguments']

0 comments on commit 2ed8df5

Please sign in to comment.