area17 / twill

Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
https://twillcms.com
Apache License 2.0
3.78k stars 575 forks source link

Cannot edit a link in wysiwyg field #1694

Closed pvdbroek closed 1 year ago

pvdbroek commented 2 years ago

Description

When I use a custom @formField for a wysiwyg form, I cannot alter a link after it has been made. I can click on a link, edit it, but then the old link url not altered.

Steps to reproduce

This is my definition:

@twillBlockTitle('Text')
@twillBlockIcon('text')

@formField('wysiwyg', [
'name' => 'html',
'label' => 'Content',
'toolbarOptions' => [ [ 'header' => [false, 1, 2, 3, 4] ], 'bold', 'italic', 'underline', 'strike', 'link', ['align' => ''], ['align' => 'center'], ['align' => 'right'], 'list-ordered', 'list-unordered', [ 'indent' => '-1'], [ 'indent' => '+1' ] ],
'placeholder' => '',
'translated' => true
])

Expected result

The old link url should be altered into the new one

Actual result

The old link url is still there

Versions

Twill version: 2.8.7 Laravel version: 8.83 PHP version: 8

Screenshots:

afbeelding

afbeelding

afbeelding

When I use the original text block from twill, it is is working, but I want to use another wysiwyg toolbar. Is this a bug in the code or am I doing something wrong?

kallefrombosnia commented 2 years ago

Can you please check the browser developer console to see if there are any errors/warnings?

pvdbroek commented 2 years ago

Thanks for your response, there is no error or warning in the console.

kallefrombosnia commented 2 years ago

Which Laravel version do you use and what Twill version? I will try to debug it locally.

pvdbroek commented 2 years ago

Ah, I see that the versions where in comments. I've updated the ticket, and here are the versions as well:

Twill version: 2.8.7 Laravel version: 8.83 PHP version: 8

haringsrob commented 2 years ago

Hey @pvdbroek,

I am trying to reproduce the issue but it seems all correct on my end.

Can you try to run php artisan twill:update as your assets might be behind? Also try clearing all browser caches.

Screen Recording 2022-06-20 at 09 12 05

pvdbroek commented 2 years ago

Hi @haringsrob , thanks for your check and suggestion, php artisan twill:update did the trick!

Many thanks again, my colleagues will be thrilled to hear that the bug has been fixed! ;)

pvdbroek commented 2 years ago

I'm having one related issue. After I've ran php artisan twill:update, there seems to be a "Collapse / Expand all" bug:

When I want to view/edit an entry, the option that is shown first is "Collapse all", however, all fields are already collapsed:

afbeelding

After I've clicked on the "Collapse all", the right option occurs:

afbeelding

When I click on the "Expand all", all fields are expanded correct.

There is no error or warning in the dev console. Twill version is 2.8.8.

Does this bug occur with other people as well or is it just me? Any idea's how to fix it?

ifox commented 1 year ago

This should be fixed. Feel free to reopen if you are still experiencing this issue.