aimeos / ai-cms-grapesjs

GrapesJS CMS integration into Aimeos
GNU Lesser General Public License v2.1
25 stars 20 forks source link

Cannot save media #26

Closed Tantacula closed 1 year ago

Tantacula commented 1 year ago

I'm trying to create page with media with filled option (option: type, value: example) in "advanced" section, but an error appears:

Aimeos\MShop\Common\Item\Lists\Standard::setPosition(): Argument #1 ($pos) must be of type int, string given, called in /var/www/vendor/aimeos/ai-cms-grapesjs/src/Admin/JQAdm/Cms/Media/Standard.php on line 373

PHP 8.1.12 Laravel 9.40.1

aimeos commented 1 year ago

Can't reproduce that issue but there was a JS error when you add a second list type for media. Can you please install the new version and tell us if it works now:

composer req aimeos/ai-cms-grapesjs:2022.10.x-dev
Tantacula commented 1 year ago

Can't reproduce that issue but there was a JS error when you add a second list type for media. Can you please install the new version and tell us if it works now:

composer req aimeos/ai-cms-grapesjs:2022.10.x-dev

the problem still here, media with options causes error during page saving

aimeos commented 1 year ago

Can you add a var_dump( $idx ) before this line and post the output (should be "string ..."): https://github.com/aimeos/ai-cms-grapesjs/blob/master/src/Admin/JQAdm/Cms/Media/Standard.php#L373

Tantacula commented 1 year ago

I found that input names in admin panel like "media[idx][config][0][key]" and "media[idx][config][0][val]" should be replaced by "media[0]" for correct working

aimeos commented 1 year ago

Thanks, that helped! We've fixed the problem, can you execute this command and test again?

composer req aimeos/ai-cms-grapesjs:2022.10.x-dev
Tantacula commented 1 year ago

Problem is solved now, thank you)