We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Quote from: BobRay at Jun 26, 2013, 06:06 PM

    On the properties tab when editing the ResourceWatcher plugin, if you set these properties to true, it should work on both new and updated resources:


    &resourcewatcher.new_active
    &resourcewatcher.upd_active

    Hi Bob, yeh I already have both
    &resourcewatcher.new_active
    &resourcewatcher.upd_active

    set to Yes in the system settings.

    What I meant was, when an Editor opens a published resource - they should not be able to make edits to that resource and push them straight live by hitting the save button. What I would like to happen when they hit the save button is that the Publisher gets notified that the Editor has updated a resource which needs approval - the Editors updates are stored in a staged version of the page (by using your StageCoach plugin), then the Publisher logs in following the email notification they have received and they can edit / publish the updated page.

    Bob - I am also not having much luck with StageCoach - I have it running and looks like it is working ok from the manager side of things, e.g. creating a duplicate resource and putting it into the new Staged Resources folder.... but... when I edit a published page and then set the Stage Date TV to a time in the future and hit save - my updates are made live straight away... e.g. no staging is actually happening...? Any ideas why this might be? I can drop you an admin user access via DM if you like so you can have a look... seems very odd to me!

    Bob - Could the issues with StageCoach be due to the custom hook I am using on the ResourceWatcher plugin?

    /** * * * A hook to send approval request. Only triggered upon resource update */
    $usergroup='Collab_Editors';
     
    if (! isset($scriptProperties['id'])) {
        $modx->log(MODX::LOG_LEVEL_ERROR, 'scriptProperties ID not set');
        return;
    }
     
    $resource = $modx->getObject('modResource', $scriptProperties['id']);
     
    if (! $resource) {
        $modx->log(MODX::LOG_LEVEL_ERROR, 'Could not get Resource. ID: ' . $scriptProperties['id']);
        return;
    }
     
    $editor = $resource->get('editedby');
    if (empty($editor)) {
        $editor = $resource->get('createdby');
    }
     
    if (! $editor) {
        $modx->log(MODX::LOG_LEVEL_ERROR, 'editedby is empty');
        return;
    }
    $user=$modx->getObject('modUser',array('id'=>$editor));
     
    if (!$user) {
        $modx->log(MODX::LOG_LEVEL_ERROR, 'user is empty');
        return;
    }
     
     
    $checkMembership = $user->isMember($usergroup);
    $state = $resource->getTVValue('approvalSwitch');
    if ($state=='yes' && $checkMembership==true) {
        return true;
    }
    return false;
    
    [ed. note: dubbs last edited this post 13 years, 3 months ago.]
      • 3749
      • 24,544 Posts
      I don't think the hook is affecting it, unless the hook is messing up other TV values, but you might try turning that off and seeing if StageCoach works.

      I haven't had time to test StageCoach in 2.2.8 so I'm not sure what the problem might be. I'm afraid I don't have time to look into it right now.

      BTW, I have another extra in the pipeline that I think does exactly what you want, but it won't be out any time soon.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 8168
        • 1,118 Posts
        Quote from: BobRay at Jun 27, 2013, 12:49 PM
        I don't think the hook is affecting it, unless the hook is messing up other TV values, but you might try turning that off and seeing if StageCoach works.

        I haven't had time to test StageCoach in 2.2.8 so I'm not sure what the problem might be. I'm afraid I don't have time to look into it right now.

        BTW, I have another extra in the pipeline that I think does exactly what you want, but it won't be out any time soon.

        OK thanks Bob - Maybe it's a 2.2.8 thing... I will have a play around and see If I can resolve it...

        The new extra sounds interesting... any ideas on ETA and what it will include?
          • 8168
          • 1,118 Posts
          Quote from: BobRay at Jun 27, 2013, 12:49 PM
          I don't think the hook is affecting it, unless the hook is messing up other TV values, but you might try turning that off and seeing if StageCoach works.

          I haven't had time to test StageCoach in 2.2.8 so I'm not sure what the problem might be. I'm afraid I don't have time to look into it right now.

          BTW, I have another extra in the pipeline that I think does exactly what you want, but it won't be out any time soon.

          Bob - with re: StageCoach - does it matter if a resource is published or not when using StageCoach? e.g. does StageCoach only publish unpublished resources at the Staged time?
            • 8168
            • 1,118 Posts
            Quote from: BobRay at Jun 27, 2013, 12:49 PM
            I don't think the hook is affecting it, unless the hook is messing up other TV values, but you might try turning that off and seeing if StageCoach works.

            I haven't had time to test StageCoach in 2.2.8 so I'm not sure what the problem might be. I'm afraid I don't have time to look into it right now.

            BTW, I have another extra in the pipeline that I think does exactly what you want, but it won't be out any time soon.

            Bob - just installed 2.2.7 fresh with nothing other than StageCoach and TinyMCE and it is still not working. I added some new content to the home resource, set the StageCoach to release it live in 10mins time, hit save and viewed the resource and the content update was already in view... It seems not to work? Does it only work on resources that are not published? e.g. just it just work to publish a resource at a set time in the future so long as the resource is not already published?
              • 3749
              • 24,544 Posts
              No, it should definitely stage updates to already published resources (unless my memory is failing me again).

              Just to make sure, you do have StageCoach Version 1.1.0-pl, right?

              And you are setting the StageDate TV for the original resource, not the pub date, not the StageDate of the staged resource?
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 8168
                • 1,118 Posts
                Quote from: BobRay at Jun 28, 2013, 10:55 PM
                No, it should definitely stage updates to already published resources (unless my memory is failing me again).

                Just to make sure, you do have StageCoach Version 1.1.0-pl, right?

                And you are setting the StageDate TV for the original resource, not the pub date, not the StageDate of the staged resource?

                Yep, StageCoach Version 1.1.0-pl on Modx 2.2.7pl with nothing else but tinyMCE installed??? No publish date set, unpublished resource set to StageDate publish in the future, hit save and it never publishes....

                On a resource that is already published, select future date for StageDate, hit save and it ignores the StageDate data and publishes straight away...?
                  • 3749
                  • 24,544 Posts
                  I last tested it on an earlier version (maybe 2.2.6 or even 2.2.4). I don't use StageCoach myself, but I'll have to find time to do some testing.

                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 8168
                    • 1,118 Posts
                    Quote from: BobRay at Jun 29, 2013, 11:20 PM
                    I last tested it on an earlier version (maybe 2.2.6 or even 2.2.4). I don't use StageCoach myself, but I'll have to find time to do some testing.


                    OK thanks - please let me know how you get on. Also please let me know re: the other plugin you mentioned you were working on - very keen to try and get MODx working with a true CMS worfklow ASAP for a client job!
                      • 3749
                      • 24,544 Posts
                      The other plugin is one of about 60 extras on a list of things I plan to create. It's not very high on the list and, TBH, I'll have forgotten about this thread by the time I get to it. wink

                      I will try to get to StageCoach, but I'm in the middle of three critical projects right now that I will have to finish first (if I don't forget about StageCoach too). wink


                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting