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