# Publish toggle bug in 4.4.9 and 10?

**URL:** <https://forum.mautic.org/t/publish-toggle-bug-in-4-4-9-and-10/29278>\
**Category:** Product Support\
**Created:** [September 13, 2023, 7:34pm UTC](https://forum.mautic.org/t/publish-toggle-bug-in-4-4-9-and-10/29278 "2023-09-13T19:34:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [September 13, 2023, 7:34pm UTC](https://forum.mautic.org/t/publish-toggle-bug-in-4-4-9-and-10/29278/1 "2023-09-13T19:34:16Z")

</div>

**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.

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [September 14, 2023, 8:28am UTC](https://forum.mautic.org/t/publish-toggle-bug-in-4-4-9-and-10/29278/2 "2023-09-14T08:28:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![IonutOjicaDe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ionutojicade/32/7383_2.png) [@IonutOjicaDe](https://forum.mautic.org/u/IonutOjicaDe)\
**Post date:** [September 14, 2023, 7:59pm UTC](https://forum.mautic.org/t/publish-toggle-bug-in-4-4-9-and-10/29278/3 "2023-09-14T19:59:39Z")

</div>

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](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/1/108ecb835d55a558a3dfb8506002692a6f1d3ae6.png)

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [September 15, 2023, 6:48am UTC](https://forum.mautic.org/t/publish-toggle-bug-in-4-4-9-and-10/29278/4 "2023-09-15T06:48:10Z")

</div>

Thanks!

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

> <https://github.com/mautic/mautic/issues/12718>
>
> \### Mautic Version
> 
> 4.4.x series
> 
> \### PHP version
> 
> 7.4
> 
> \### What browsers are yo…u seeing the problem on?
> 
> Chrome
> 
> \### What happened?
> 
> On the list screen for either emails, segments or forms, the toggle switch to publish an item that is not published in not functioning. I am able to publish items from their individual edit screens. 
> 
> I have tested on several Mautics (4.4.9) of my own and all have this issue . I upgraded one instance to 4.4.10 and the issue persisted. 
> 
> I have posted in the forum to ask if others have this issue or if this might be unique to my set up. I had not response so I cannot be sure this is indeed a bug or not. 
> 
> Docker install on a linux VPS
> 
> \### How can we reproduce this issue?
> 
> Step 1: Create an email, segment, form or email and publish it via the edit screen. 
> Step 2: Return to the view where you can see a list of either all the emails, forms or segments.
> Step 3: Unpublish an item by using the toggle switch. 
> Step4: Publishing the item via the toggle switch is not possible. 
> 
> \### Relevant log output
> 
> \`\`\`shell
> Nothing in the logs
> \`\`\`
> 
> 
> \### Code of Conduct
> 
> \- \[X\] I confirm that I have read and agree to follow this project's Code of Conduct
