We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14786
    • 57 Posts
    Currently when editing documents in the manager, under Page Settings tab:

    It appears if there is a publish date and/or un-publish date and you uncheck Published? the change is ignored after saving the page. Going back to Page Settings tab, Published? is still checked. You must delete the publish date and un-publish date then uncheck Published? for it to work. It is my opinion that unchecking Published? should override publish date and/or un-publish date no matter what their settings.
    • I agree with this Joshua.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 27376
        • 576 Posts
        This is a question for any one of the devs (probably Opengeek), why are two <input> tags used for managing the published state? For instance, this is the code I pulled from my content editor:
        <td><input name="publishedcheck" type="checkbox" class="checkbox" checked onclick="changestate(document.mutate.published);" /><input type="hidden" name="published" value="1" />
        It appears that the checkbox is modifying a hidden <input> tag which contains the actual published state. Why not just use this:
        <input type="checkbox" class="checkbox" name="published" value="1"/>
        Then in [tt]save_content.processor.php[/tt], check [tt]isset($_POST[’published’])[/tt]? The reason for the change would be to simplify the markup and remove some unnecessary javascript.

        Also, to remedy the issue brought up in this thread, we would use javascript to remove the pub_date if the published field changes:
        <script type="text/javascript">
        function check_pub_date(el) {
            value = el.checked;
            if (value == '') {
                if (confirm("Warning: Unchecking Published will remove the Publish Date! Do you want to unpublish this document?") == true) {
                    document.mutate.pub_date.value = '';
                }
            }
        }
        </script>

        As I’ve stated before, I am no JScripter, so this code is untested, but I hope it gives you all an idea of what a solution would be.