Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on save "Attributes" Composer Since Version 9 #339

Open
6tematik opened this issue Jun 13, 2024 · 1 comment
Open

Error on save "Attributes" Composer Since Version 9 #339

6tematik opened this issue Jun 13, 2024 · 1 comment

Comments

@6tematik
Copy link

Hello,

We are experiencing an issue with all our sites since version 9 of Concrete. When modifying a page attribute, the save action sometimes occurs twice.

Upon investigation, we noticed that the click event on the "save" button was bound twice in the "Attributes" composer.

Looking more closely, we observed that the "loadPanelDetailActions" function that binds the event is executed four times on the page. Twice when clicking on "Page Design, Location, Attributes and Settings" and twice when clicking on "Attributes".

On a fresh Concrete installation, the double bind issue is hard to reproduce, but not impossible. After repeatedly clicking on these two buttons, we eventually encounter it.

However, on a well-populated Concrete site, we face this issue almost every time.

By adding a .off("click") before the bind, we managed to fix the problem. We believe it would be best to avoid these four calls, but we do not know the code well enough to understand why these four calls occur. Do you have any other solutions?

The fix we implemented is as follows:

bedrock/assets/cms/js/panels.js

328    this.loadPanelDetailActions = function ($content) {
...
336    $('button[data-panel-detail-action=submit]').off('click').on('click', function () {
337        $('[data-panel-detail-form]').submit()
338    })

Can you integrate this fix or an equivalent one?

@aembler
Copy link
Member

aembler commented Aug 1, 2024

I can't reproduce this - can we get instructions on how to reproduce with a stock atomik install?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants