We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24068
    • 4 Posts
    I’m searching for an event that gives me the saved resource, something like OnDocSaved.

    I’m asking because (as far as i know) if i create a new Resource and save it, $scriptProperties[’resource’] in a plugin executed by OnDocFormSave contains a unsaved resource (resp. $scriptProperties[’id’] is empty)
      • 28215
      • 4,149 Posts
      OnDocFormSave should work. Try:

      $scriptProperties['resource']->get('id');
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 24068
        • 4 Posts
        Cool, both do work on OnDocFormSave, $scriptProperties[’id’] and $scriptProperties[’resource’]->get(’id’)

        Thank you smiley
          • 3749
          • 24,544 Posts
          Quote from: pureppl at Jun 06, 2011, 03:08 PM

          Cool, both do work on OnDocFormSave, $scriptProperties[’id’] and $scriptProperties[’resource’]->get(’id’)

          Thank you smiley

          I’m curious, did you test both of those with new (rather than existing) docs in OnDocFormSave?
            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
            • 24068
            • 4 Posts
            Quote from: BobRay at Jun 06, 2011, 05:32 PM

            Quote from: pureppl at Jun 06, 2011, 03:08 PM

            Cool, both do work on OnDocFormSave, $scriptProperties[’id’] and $scriptProperties[’resource’]->get(’id’)

            Thank you smiley

            I’m curious, did you test both of those with new (rather than existing) docs in OnDocFormSave?

            Yes, fully tested with 2.1.0-pl. If i remember correctly, it did not work 2.0.8-pl, thus my initial post about that. I guess its also working in 2.1.1-pl, but that i didn’t test. But i thought about writing test-cases... lipsrsealed