Creating a copy of a product based on a previous copy is not saved

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
РоманАндрейчук
Posts: 18
Joined: 13 Jan 2022, 15:08

Creating a copy of a product based on a previous copy is not saved

Post by РоманАндрейчук » 06 Jul 2022, 07:31

Environment
Version (e.g. 2021.10)
Integration (Laravel)
System (Linux, Mac)

Hello!
I have a problem with creating new products. Creating a copy of a product based on a previous copy is not saved.
The logs show the following error:
Couldn't copy file from "1.d/files/4/9/49381151_1-d-files-1-8-1820bf6f_1-d-files-3-7-37efe3a7_1-d-files-2-b-2b6bfefb_1-d-files-c-0-c00e8e37_1-d-files-1-5-15233870_1-d-files-c-b-cb126af9_1-d-files-e-d-ed0388bf_1-d-files-c-7-c75e5b55_1-d-files-9-9-9922243e_2022-07-04_20-36-01.jpg" to "1.d/files/4/b/4ba47f99_1-d-files-4-9-49381151_1-d-files-1-8-1820bf6f_1-d-files-3-7-37efe3a7_1-d-files-2-b-2b6bfefb_1-d-files-c-0-c00e8e37_1-d-files-1-5-15233870_1-d-files-c-b-cb126af9_1-d-files-e-d-ed0388bf_1-d-files-c-7-c75e5b55_1-d-files-9-9-9922243e_2022-07-04_20-36-01.jpg"

It looks like the problem is with the long filename. How to change the pattern of the new image filename when copying a product?

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

Re: Creating a copy of a product based on a previous copy is not saved

Post by aimeos » 06 Jul 2022, 08:23

We've changed the code and remove the first parts now before copying the file. The change is available if you execute:

Code: Select all

composer req aimeos/aimeos-core:2021.10.x-dev
Can you test and confirm that it works now?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star


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

Re: Creating a copy of a product based on a previous copy is not saved

Post by aimeos » 14 Jul 2022, 10:41

The new code does NOT remove existing prefixes added in previous copy actions. Please test with a product that doesn't already have long image URLs and check that copying that product recursively does only add nine characters of a hash and the total length of the URL doesn't grow after the second copy action any more.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
РоманАндрейчук
Posts: 18
Joined: 13 Jan 2022, 15:08

Re: Creating a copy of a product based on a previous copy is not saved

Post by РоманАндрейчук » 22 Aug 2022, 09:18

Hello.
This example was made based on a new product in a dev release

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

Re: Creating a copy of a product based on a previous copy is not saved

Post by aimeos » 22 Aug 2022, 12:01

Unable to reproduce the issue when using aimeos/ai-admin-jqadm 2021.10.18+ or dev-master
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply