Upgrade from 2021.10 to 2022.07 with custom extension

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
matteovg7
Posts: 14
Joined: 12 Dec 2019, 16:13

Upgrade from 2021.10 to 2022.07 with custom extension

Post by matteovg7 » 25 Aug 2022, 07:50

Hi,
i'm trying to upgrade Aimeos from 2021.10 to 2022.07 version.

I have a custom extensions under ext folder with some overrided classes with different names.
The 2022.07 version doesn't find the classes of the submanagers because of a wrong namespace.

This is the config/mshop.php file of the extension:

Code: Select all

<?php

return [
    'coupon' => [
        'manager' => [
            'name' => 'CouponVG7',
            'code' => [
                'name' => 'CouponCodeVG7',
                'decorators' => [
                    'local' => ['CouponCodeCustomerId']
                ],
            ]
        ]
    ],
    'customer' => [
        'manager' => [
            'name' => 'CustomerVG7',
            'decorators' => [
                'local' => ['UsersIdPrint']
            ],
            'address' => [
                'name' => 'AddressVG7'
            ]
        ]
    ],
    'media' => [
        'manager' => [
            'name' => 'MediaVG7',
            'decorators' => [
                'local' => ['MediaIdPrint']
            ],
        ]
    ],
    'order' => [
        'manager' => [
            'name' => 'OrderVG7',
            'decorators' => [
                'local' => ['OrderIdPrint']
            ],
            'base' => [
                'name' => 'OrderBaseVG7',
                'address' => [
                    'name' => 'OrderBaseAddressVG7',
                    'decorators' => [
                        'local' => ['OrderBaseAddressAddFields']
                    ],
                ],
                'product' => [
                    'name' => 'OrderBaseProductVG7',
                    'decorators' => [
                        'local' => ['OrderBaseProductIdPrint']
                    ],
                ],
                'service' => [
                    'name' => 'OrderBaseServiceVG7'
                ],
            ]
        ]
    ],
    'product' => [
        'manager' => [
            'name' => 'ProductVG7',
            'decorators' => [
                'local' => ['ProductIdPrint', 'ProductCodePrint']
            ],
        ]
    ],
    'service' => [
        'manager' => [
            'name' => 'ServiceVG7',
            'decorators' => [
                'local' => ['ServiceIdPrint']
            ],
        ]
    ],
];
For example I have this error:
Class "\Aimeos\MShop\Customer\Manager\AddressVG7" not found
but the correct namespace for this class is
\Aimeos\MShop\Customer\Manager\Address\AddressVG7
.

It is changed something in the config array?
Thanks.

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Upgrade from 2021.10 to 2022.07 with custom extension

Post by aimeos » 26 Aug 2022, 10:18

The configuration didn't change but there are no manager factories any more and all managers are created by:

Code: Select all

\Aimeos\MShop::create( $this->context(), '<domain>' );
Can you check if there's something fishy here?
https://github.com/aimeos/aimeos-core/b ... hp#L56-L88
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

matteovg7
Posts: 14
Joined: 12 Dec 2019, 16:13

Re: Upgrade from 2021.10 to 2022.07 with custom extension

Post by matteovg7 » 01 Sep 2022, 13:55

I opened a pull request: https://github.com/aimeos/aimeos-core/pull/297

I used it locally for some days and seem to be ok.

Post Reply