Delete doesn't work

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
peter69
Posts: 97
Joined: 09 Jun 2022, 19:31

Delete doesn't work

Post by peter69 » 13 Jul 2022, 05:49

Hi!

When I click on the icon to delete (in any of the tables in the administrative part), it does not delete the resource.

In the browser console you can see the following error:

TypeError: Cannot read properties of undefined (reading 'target')
at Vue.askDelete (js?locale=en:5431:25)



I am using the latest version of Laravel Aimeos (2022.07.2).

Regards,

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

Re: Delete doesn't work

Post by aimeos » 13 Jul 2022, 06:46

We can't reproduce that. Can you please post a screenshot?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
peter69
Posts: 97
Joined: 09 Jun 2022, 19:31

Re: Delete doesn't work

Post by peter69 » 14 Jul 2022, 05:43

Hi,

Sure, I share a screenshot with you. When I click on the icon to delete, it does not work and shows that error in the console.

Regards,
Attachments
delete errror.PNG
delete errror.PNG (65.39 KiB) Viewed 1733 times

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

Re: Delete doesn't work

Post by aimeos » 14 Jul 2022, 08:49

Thanks, this has been fixed in the latest release. Please run "composer up" to get the latest version.

The languages will be added again by "artisan aimeos:setup" so you should disable them instead if you don't need them.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
peter69
Posts: 97
Joined: 09 Jun 2022, 19:31

Re: Delete doesn't work

Post by peter69 » 15 Jul 2022, 05:47

Hello Sir,

I have run composer up, then cleared all caches and the issue persists

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

Re: Delete doesn't work

Post by aimeos » 17 Jul 2022, 06:53

We need a bit help now.

Can you verify that this line is exactly the same in your ./vendor/aimeos/ai-admin-jqadm/templates/admin/jqadm/locale/language/list.php file?
https://github.com/aimeos/ai-admin-jqad ... t.php#L266

Furthermore, please add this:

Code: Select all

console.log(ev);
Here: https://github.com/aimeos/ai-admin-jqad ... in.js#L897
Then, post the output from the browser console.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
peter69
Posts: 97
Joined: 09 Jun 2022, 19:31

Re: Delete doesn't work

Post by peter69 » 21 Jul 2022, 04:44

Hello Sir,

Thank you very much for your prompt response,

The line of code is different in packages/my-theme/templates/admin/jqadm/locale/language/list.php

It is as follows:

Code: Select all

<a class="btn act-delete fa" tabindex="1" href="#"
      v-on:click.prevent.stop="askDelete(`<?= $enc->js( $id ) ?>`)"
      title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry' ) ) ?>"
      aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ) ?>">
</a>
Added the console.log(ev) to vendor/aimeos/ai-admin-jqadm/js/admin.js

Attached screenshot.

Best regards,
Attachments
console-admin-js.PNG
console-admin-js.PNG (20.65 KiB) Viewed 1667 times

User avatar
peter69
Posts: 97
Joined: 09 Jun 2022, 19:31

Re: Delete doesn't work

Post by peter69 » 21 Jul 2022, 04:58

I added $event to the line of code:

Code: Select all

<a
     class="btn act-delete fa"
     tabindex="1"
     v-on:click.prevent.stop="askDelete(`<?= $enc->js( $id ) ?>`, $event)"
     href="#"
     title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry' ) ) ?>"
     aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ) ?>"
>
</a>

Now when I press the delete icon the confirmation modal to delete appears, however when I click delete the page reloads and the resource I tried to delete is still there, it is not deleting.

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

Re: Delete doesn't work

Post by aimeos » 21 Jul 2022, 06:02

That's because your href value is wrong and it needs to be like in the original template:
https://github.com/aimeos/ai-admin-jqad ... t.php#L267
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
peter69
Posts: 97
Joined: 09 Jun 2022, 19:31

Re: Delete doesn't work

Post by peter69 » 26 Jul 2022, 16:02

I started the theme by downloading the base files from the aimeos online tool.

I have modified the href anyway so that the resources can be removed.

Now it works fine!

Thank you very much for your help!

Post Reply