We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5430
    • 247 Posts
    Great snippet, so glad to have something like this for revo. Serious thanks.

    I’ve been using it successfully until 2.1.0rc4. Now, setting &initrte=`1` throws a fatal error:

    "Fatal error: Call to undefined method modX::isFrontend() in /home/mysite/public_html/core/components/newspublisher/classes/newspublisher.class.php on line 423"


    Any thoughts? Besides updating from 2.0.8, I made no changes, and it appears TinyMCE is the same version. Didn’t trust that I wasn’t screwing something up so I figured I’d ask here before posting this as an issue on git.
      • 3749
      • 24,544 Posts
      No, you’re not doing anything wrong. The isFrontend() method was deprecated and has been removed -- I need to fix that. In the meantime, I think you can just add this to the snippet tag:

      &forfrontend=`1`


      If that doesn’t work, replace line 423 of core/components/newspublisher/classes/newspublisher.class.php:

      if (isset($this->props['forfrontend']) || $this->modx->isFrontend()) {



      with this:

      if (isset($this->props['forfrontend']) || $this->modx->context->get('key') != 'mgr') {
        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
        • 5430
        • 247 Posts
        Thanks for such a quick reply! Both fix the error. You’re the man.

        One more quick question. I hadn’t noticed this before, but it appears that it’s impossible to access the resource browser from TinyMCE when logged in on the front end without an active mgr session, is this correct? It appears I don’t even need to be logged in to both contexts as the same user, just as long as I’ve got an active mgr session the resource browser works on the front end. This is a bummer if true. Is there any way to access the browser without a manager session (for placing images, etc.), or with a single front-end login?
          • 3749
          • 24,544 Posts
          I haven’t tried it, but I suspect that you’re right. I think the fix would require changes to the TinyMCE code. I’m pretty sure there’s nothing I can do about it from the NewsPublisher end, though I could be wrong.

          What, exactly is happening when it won’t work for you?
            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
            • 5430
            • 247 Posts
            As an example, if I try to place an image using TinyMCE, I’ll get the image dialogue box as expected, but when I click on the browser icon (next to the image URL field) I get a new window just like I would if the resource browser was working, but instead of the browser appearing I get the mgr login screen. Really hoping this is fixable, but I wouldn’t have a clue where to start. Let me know what you think.
              • 3749
              • 24,544 Posts
              Try creating an Image TV and showing it in your NewsPublisher form. I use TinyMCE to handle that and it definitely works for me. If that doesn’t work for you, there’s probably something wrong with your TinyMCE configuration or possibly the filemanager_path System Setting (or something similar). I’m afraid I wouldn’t know where else to look.
                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