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

    Revo 2.0.3 pl
    TinyMCE 4.1.0 rc1

    Problem:
    TinyMCE adds [tt]/assets/components/tinymce/[/tt] to every link I add using the TinyMCS "add link" function.
    When changing the tiny.path_options setting the path changes but still contains the above fragment - e.g. [tt]http://www.mydomain.com/assets/components/tinymce/PATH-I-WANT[/tt]

    This (wrong) replacing occurs before saving the page using modx. I.e. after adding a link [tt][[~17]][/tt] and clicking insert, then editing the link again without saving tinyMCE already transformed the link to: [tt]/assets/components/tinymce/[[~17]][/tt].

    The information I could find regarding path problems with modx and tinyMCE all seemed to relate to the friendly_alias setting and the friendly relative url being a problem, not the addition of the tinyMCE folder path to every link as in this case.

    Sorry if I am making a silly mistake here.
    Thank you,
    Hinnerk
      • 12181
      • 12 Posts
      Hmm - this issue only appears when using modx links ( [[~XYZ]] ) inside the create-link popup in tinyMCE.
      So maybe its a system setting within modx after all?
        • 12181
        • 12 Posts
        I am aware the is surely one of the dirtiest bandaids possible within modx but after 2 hours trying to understand and follow tinyMCE appflow in firebug as a non-javascript-developer I gave up.

        Plugin bound to the OnBeforeDocFormSave event:

        <?php
        
        if ($modx->event->name == 'OnBeforeDocFormSave')
        {
            // get current content
            $content = $resource->get('content');
            // sanitize
            $content = str_replace('/assets/components/tinymce/', '', $content);
            // set again
            $resource->set('content', $content);
        }
        ?>
          • 15566
          • 73 Posts
          I have exactly the same problem here, but I can’t find a good solution to this.

          I have just installed the latest update 2.0.4 pl2 with the latest tinmce 4.1.1 and it’s still the same.

          Normally i’d leave Path Options empty and rely on <base> in the html but I want to use anchors and I can’t have both.

          Any ideas anyone?
            • 28215
            • 4,149 Posts
            You dont happen to have a custom filemanager_path or filemanager_url setting, do you?
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 15566
              • 73 Posts
              No, mine are both empty. I tried setting them to / but that didn’t help.
                • 13642
                • 1 Posts
                First off. Thank you ModX for bring such a nice tool to the world for free. smiley

                Now, has there been any traction on this thread? I am experiencing the same issue. I have tried the 3 different Path Option settings for tiny MCE. I have spent the better part of a day trying to troubleshoot.

                It makes the whole tool unusable when the editor overwrites content and there’s absolutely no way around it that I can find.

                If I use an anchor, then there’s no prepend - but that’s the only time. Otherwise on any link (not not image) it rewrites the path after I have set it.

                There must be a setting for this!!
                  • 5160
                  • 118 Posts
                  I had a similar issue with TinyMCE prepending links with: /assets/components/tinymce/

                  From my notes the following settings work for me on two MODx Revolution 2.0.4-pl2 installs.

                  System > System Settings: Search for ’path’

                  Area: File System - Set ’File Manager Path’ to ’assets/components/tinymce/uploads/’

                  Area: tinymce - Set ’Path Options’ to ’rootrelative’

                  System > System Settings: Search for ’filemanager_url’

                  Area: File System - Set ’File Manager URL’ = ’/uploads/’

                  Files are then uploaded to: /assets/components/tinymce/uploads/

                  You need to create ’uploads’ directory manually via FTP or similar. I’m on a Windows box so don’t need to worry about setting permissions on the new directory. I chose this directory for TinyMCE uploads as I didn’t want clients having access to the site root either with TinyMCE or via the Files Tab in the Manager.

                  You probably also need to make sure the following tag is in the head of the site template:
                  <base href="[[++site_url]]" />
                    • 17548
                    • 74 Posts
                    Interestingly, I am having this problem on a new install of Revo 2.0.6pl traditional but NOT on an almost identical install of 2.0.5pl traditional.

                    I have checked the File System Settings side-by-side in two browser windows and the tinymce settings as well.

                    They’re both identical, as are the directory structures. (both sites are part of a shared hosting account that allows multiple independent website configurations)

                    If I set the problem site TinyMCE to docrelative links, it doesn’t prepend inserted links to filesystem items (like PDFs).

                    If I set it to rootrelative or fullurl then it inserts the /components/tinymce bit.

                    I have both sites configured with /assets/ as the file manager default. I wonder if there’s something to do with leading or trailing / chars that are in the guts of the apache config? The default values for all of the filesystem paths are blank (my site root).



                      • 5160
                      • 118 Posts
                      @lowelife

                      Looking back to my notes I have updated them with:

                      Area: File System - Set ’File Manager URL’ = ’/uploads/’ - update v2.0.5-pl appears to want ’uploads/’

                      All of my installs are on the same web server running IIS7 with identical web.config files so I guess in my case that rules out server config as having an influence.