We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34617
    • 1 Posts
    Hi everyone,

    I hope this is going to be an easy one. I use $resource->setContent($updatedContent); within OnDocFormSave plugin and after the animated progress bar disappears, the old content remains in the textarea. I want the updated content to appear in the textarea. Any attempt to redirect/refresh from within the plugin results in never ending progress bar animation. Is there any way/tip how to solve this?

    Any help would be really appreciated. Thank you guys.
      • 3749
      • 24,544 Posts
      That can happen if there is a syntax error in the plugin. Also, if you are refreshing the request to save the page, the plugin will execute over and over.

      You might try setting a $_SESSION variable at the end of the plugin and, at the beginning, check that and return without taking action if it’s set (after clearing it).

      BTW, you are forwarding with $modx->sendRedirect(), right? If you’re just refreshing the page, it will try to save again.
        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
        • 37905
        • 13 Posts
        Has anyone found a solution to this problem?

        Can you give some more details about your specific problem? I suggested a solution above to the problem of redirecting to the same page in a plugin. Does that not work for you, or do you have a different problem.



        [ed. note: BobRay last edited this post 12 years, 3 months ago.]