Js error when deleting a product from control panel

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
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Js error when deleting a product from control panel

Post by ahmed31916 » 25 Sep 2022, 04:25

Hello Aimeos,

I got this error when deleting product from the control panel.
I made composer up, but nothing changed!

Here is the problem: https://github.com/aimeos/ai-admin-jqad ... in.js#L895
Attachments
Screenshot 2022-09-25 072737.png
Screenshot 2022-09-25 072737.png (86.5 KiB) Viewed 204 times
Last edited by ahmed31916 on 05 Oct 2022, 10:58, edited 1 time in total.

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: Js error when deleting a product from control panel

Post by ahmed31916 » 05 Oct 2022, 10:54

Help me, please!

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

Re: Js error when deleting a product from control panel

Post by aimeos » 05 Oct 2022, 11:27

Most likely, you've overwritten the product list template with an older version.
In 2022.07+, the line in the template contains an "$event" parameter as second argument for askDelete() JS method.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: Js error when deleting a product from control panel

Post by ahmed31916 » 05 Oct 2022, 11:29

I change the askDelete and confirmDelete by this code, and it worked:

Code: Select all

			askDelete: function(id) {
				if(id) {
					this.clear(false);
					this.$set(this.items[id], 'checked', true);
				}

				this.dialog = true;
			},

			checked: function(id) {
				return this.items[id] && this.items[id].checked;
			},

			confirmDelete: function(val) {
				if(val) {
					if(this.$refs.form && this.$refs.form.dataset && this.$refs.form.dataset.deleteurl) {
						this.$refs.form.action = this.$refs.form.dataset.deleteurl;
						this.$refs.form.submit();
					} else {
						console.log('[Aimeos] Missing form reference or data-deleteurl');
					}
				}

				if(Object.keys(this.unconfirmed).length === 1) {
					this.clear(false);
				}

				this.dialog = false;
			},
Now, I got this error trace in the server: (just on the server, it worked on the local)

Code: Select all

Couldn't delete file "1.d/files/c/0/c040cf4d_DSC02742-798x466.jpg"
#0 /var/www/html/myProject/vendor/aimeos/aimeos-core/src/Controller/Common/Media/Standard.php(162): Aimeos\Base\Filesystem\Standard->rm()
#1 /var/www/html/myProject/vendor/aimeos/ai-admin-jqadm/src/Admin/JQAdm/Product/Media/Standard.php(290): Aimeos\Controller\Common\Media\Standard->delete()
#2 /var/www/html/myProject/vendor/aimeos/ai-admin-jqadm/src/Admin/JQAdm/Product/Media/Standard.php(119): Aimeos\Admin\JQAdm\Product\Media\Standard->deleteMediaItems()
#3 /var/www/html/myProject/vendor/aimeos/ai-admin-jqadm/src/Admin/JQAdm/Base.php(192): Aimeos\Admin\JQAdm\Product\Media\Standard->delete()
#4 /var/www/html/myProject/vendor/aimeos/ai-admin-jqadm/src/Admin/JQAdm/Product/Standard.php(180): Aimeos\Admin\JQAdm\Base->delete()
#5 /var/www/html/myProject/vendor/aimeos/ai-admin-jqadm/src/Admin/JQAdm/Common/Decorator/Base.php(107): Aimeos\Admin\JQAdm\Product\Standard->delete()
#6 /var/www/html/myProject/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Controller/JqadmController.php(151): Aimeos\Admin\JQAdm\Common\Decorator\Base->delete()
#7 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Aimeos\Shop\Controller\JqadmController->deleteAction()
#8 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()
#9 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/Route.php(261): Illuminate\Routing\ControllerDispatcher->dispatch()
#10 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/Route.php(204): Illuminate\Routing\Route->runController()
#11 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/Router.php(725): Illuminate\Routing\Route->run()
#12 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Routing\Router->Illuminate\Routing\closure()
#13 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#14 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\SubstituteBindings->handle()
#15 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#16 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Auth\Middleware\Authenticate->handle()
#17 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#18 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#19 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#20 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#21 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#22 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
#23 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Session\Middleware\StartSession->handle()
#24 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#25 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#26 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#27 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#28 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#29 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\Pipeline\Pipeline->then()
#30 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/Router.php(703): Illuminate\Routing\Router->runRouteWithinStack()
#31 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/Router.php(667): Illuminate\Routing\Router->runRoute()
#32 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Routing/Router.php(656): Illuminate\Routing\Router->dispatchToRoute()
#33 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch()
#34 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\closure()
#35 /var/www/html/myProject/app/Http/Middleware/SetLocale.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#36 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\SetLocale->handle()
#37 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#38 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#39 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
#40 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#41 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#42 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
#43 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#44 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
#45 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#46 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#47 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#48 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\HandleCors->handle()
#49 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#50 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\TrustProxies->handle()
#51 /var/www/html/myProject/app/Http/Middleware/TrustHosts.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#52 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\TrustHosts->handle()
#53 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\closure()
#54 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then()
#55 /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#56 /var/www/html/myProject/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle()
#57 main

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

Re: Js error when deleting a product from control panel

Post by aimeos » 05 Oct 2022, 11:34

ahmed31916 wrote: 05 Oct 2022, 11:29 I change the askDelete and confirmDelete by this code, and it worked:
May work with your old product template but is likely to fail in other list views.
ahmed31916 wrote: 05 Oct 2022, 11:29 Now, I got this error trace in the server: (just on the server, it worked on the local)

Code: Select all

Couldn't delete file "1.d/files/c/0/c040cf4d_DSC02742-798x466.jpg"
[/quote]

The referenced file in the media item is not available any.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: Js error when deleting a product from control panel

Post by ahmed31916 » 05 Oct 2022, 20:20

Thank you aimeos, the problem is gone.

Post Reply