We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24935
    • 160 Posts
    I upgraded from 2.0.8-pl to 2.1.1-pl (Traditional) and when saving Resources, the page would hang endlessly.

    I tracked a line in a plugin (using the ’OnDocFormSave’ event):
    $resource->setContent(strtr($resource->getContent(), $replacements));


    So I replaced getContent with get(’content’)

    $resource->setContent(strtr($resource->get('content'), $replacements));


    And it solved the problem. But why is this causing a problem? It was working before, and the documentation says getContent is correct. Did this accidentally get depreciated?
      • 22303 MODX Staff
      • 10,725 Posts
      Definitely not deprecated and AFAIK it should work either way, unless you are working with Static Resources. Perhaps there is another error occurring? What is the actual response from the AJAX request to save the Resource?
        • 24935
        • 160 Posts
        Ah, yes, I was working with static resources, and, come to think of it, my client mentioned having some trouble saving, so it probably did affect 2.0.8.

        I added a class_key check since I only wanted modDocument content modified anyway. Thanks for pointing out my error.