Publish toggle bug in 4.4.9 and 10?

Your software
My Mautic version is: 4.4.9 and 4.4.10
My PHP version is: 7.4
My Database type and version is: MariaDB

In the list of either segments, forms or emails the toggle switch to publish is not working. It works to unpublish but not too publish. Clicking the toggle does nothing. The toggle is recognised as being clickable but no action is taken on clicking. I can publish by going into edit mode and publishing there.

I have checked with all the mautics I have, all on 4.4.9 and all have the same issue.

I upgraded one instance to 4.4.10 to check and the issue persisted.

Has any one noticed this or can you test and reply if it works for your or not before I post the bug in Github

These errors are showing in the log: Nothing in the logs

Steps I have tried to fix the problem: Deactivated plugins.

No errors in the log but if I look in the browser console as I soon as I unpublish a segment using the toggle switch I get these errors.

libraries.js?v7a993a12:1606 Uncaught TypeError: Cannot read properties of null (reading ‘off’)
at libraries.js?v7a993a12:1606:36
at HTMLDivElement.complete (libraries.js?v7a993a12:1551:11)
at HTMLDivElement.fn (libraries.js?v7a993a12:444:76)
at HTMLDivElement.handle (libraries.js?v7a993a12:1031:176)
at HTMLDivElement.dispatch (libraries.js?v7a993a12:465:447)
at elemData.handle (libraries.js?v7a993a12:451:166)
at Object.trigger (libraries.js?v7a993a12:682:227)
at HTMLDivElement. (libraries.js?v7a993a12:688:258)
at Function.each (libraries.js?v7a993a12:153:170)
at jQuery.fn.init.each (libraries.js?v7a993a12:144:192)

Chat GPT says

The error message you provided suggests that there is an issue in your JavaScript code at line 1606 of the libraries.js file. It appears that you are trying to access a property (likely a method or function called off ) on an object that is null , which is causing a “Cannot read properties of null” error.

I can partially confirm your issue.

I can switch the publish button without any issues.
But to switch it again - it does not work.

If I refresh the page, then it works.

So, after switching one time by using the Publish-Toggle-Button, do a refresh and then you can switch it back.

image

Thanks!

Can confirm the same behaviour. I will update the bug report on github.