• TinyMCE file broser PHP error [Solved]#

  • mschroeder3 Reply #1, 5 months ago

    Reply
    Hi all,

    I'm trying to migrate from an old 0.9.6.3 install to the new revo 2.1.5-pl. Installed TinyMCE 4.3.1-pl. I'm getting a blank screen when I go to add a link to a file. I click the link button, then the browse button, and am presented with a blank window instead of the file browser. Same thing happens with browsing for an image file. The following is in my apache error log file:

    PHP Fatal error:  Call to a member function addHtml() on a non-object in /srv/www/vhosts/neenah/core/cache/includes/elements/modplugin/1.include.cache.php on line 55, referer: http://new.ci.neenah.wi.us/assets/components/tinymce/jscripts/tiny_mce/plugins/modxlink/link.php?v=215pl
    

    I check the file it's referencing, which is the TinyMCE plugin, and it's erroring on the following line under the OnRichTextBrowserInit case:

    $modx->controller->addHtml('<script type="text/javascript">var inRevo20 = '.($inRevo20 ? 1 : 0).';MODx.source = "'.$source.'";</script>');
    


    To me, that means the controller object is null. Am I missing something in my TinyMCE config, or php.ini perhaps? Everything else in TinyMCE seems to be working fine. I tried removing, and re-installing TinyMCE, but am still getting the same thing. Not sure what to try next.

    Thanks
    - Matt


  • mschroeder3 Reply #2, 4 months, 2 weeks ago

    Reply
    For those that may stumble upon this, I solved my issue. I setup a fresh install of modx, and installed tinymce from the package manager. All was working. I noticed the version there was 4.3.0, not 4.3.1. After some work getting 4.3.1 removed form my other install, I downloaded and installed 4.3.0, and now everything is working. Thanks for your help AMDbuilder.

    - Matt


  • AMDbuilder Reply #3, 5 months ago

    Reply
    Hello,

    There isn't a direct migration path between Evolution and Revolution. You need to upgrade the site manually, or have someone do the manual upgrade for you.

    My suggestion would be restore your Evo backup from before attempting the upgrade (if you have one).


  • mschroeder3 Reply #4, 5 months ago

    Reply
    Thanks, however I am manually migrating. This is a fresh install of both revo 2.1.5 and TinyMCE 4.3.1. I have been migrating page-by-page and snippet-by-snippet. Sorry for the confusion, but I was just stating that as this is a show-stopper for my migration. Thus my confusion as to why on a fresh install this wouldn't work....

    Thanks.
    - Matt


  • AMDbuilder Reply #5, 5 months ago

    Reply
    Did you install TinyMCE from the Package Manager or are you attempting to copy it over from the Evolution site?


  • mschroeder3 Reply #6, 4 months, 4 weeks ago

    Reply
    I installed through package manager. I also tried removing, re-downloading and re-installing, and am still getting the error. I just upgraded to php 5.3.8 from 5.2.6 , but that didn't help.

    Looking at the error again, I noticed the referrer was the following file: assets/components/tinymce/jscripts/tiny_mce/plugins/modxlink/link.php. I checked that file out, and here's the code:

    <?php
    /**
     * Launch the modx-customized link dialog
     */
    require_once dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))))).'/config.core.php';
    require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php';
    require_once MODX_CONNECTORS_PATH.'index.php';
    
    $tinyCorePath = $modx->getOption('tiny.core_path',null,$modx->getOption('core_path').'components/tinymce/');
    require_once $tinyCorePath.'tinymce.class.php';
    
    
    $o = file_get_contents(dirname(__FILE__).'/link.htm');
    
    $managerUrl = $modx->getOption('manager_url',null,MODX_MANAGER_URL);
    $placeholders = array(
        'manager_url' => $managerUrl,
        'ext_url' => $managerUrl.'assets/ext3/',
        'modext_url' => $managerUrl.'assets/modext/',
        'connectors_url' => $modx->getOption('connectors_url',null,MODX_CONNECTORS_URL),
        'css_url' => $managerUrl.'templates/'.$modx->getOption('manager_theme',null,'default').'/css/',
    );
    
    $chunk = $modx->newObject('modChunk');
    $chunk->setContent($o);
    $o = $chunk->process($placeholders);
    
    
    echo $o;
    die();
    


    I looked, and I don't have the system settings 'tiny.core_path' or just 'core_path'. I searched the file system, and I also don't have any file named 'tinymce.class.php'. Can you check on your system and see if you have those?

    Thanks.
    - Matt


  • pipemma1 Reply #7, 1 month, 2 weeks ago

    Reply
    I'm having the same problem with the browse button in TinyMCE on Revo 2.1.5 and TinyMCE 4.3.1. I see 4.3.2 has been released but only works on Revo 2.2.x so that's no good to me and I can't find anywhere to download 4.3.0 - can anyone help? Or is there another fix for this?


  • mschroeder3 Reply #8, 1 month, 2 weeks ago

    Reply
    Hi pipemma1,

    I don't remember exactly what solved my issue. I can tell you I'm running 2.2.0-pl2, and tiny 4.3.1 and no longer have the issue. I remember having something configured wrong on my nic (default gateway maybe?) and that was why I was having issues originally installing through package manager. I also remember playing with the settings on my media sources quite a bit, but I think those were introduced in 2.2.0, so you probably don't have those in 2.1.5.

    I would double check your nic settings (if you can) and your system settings. If everything looks right there, maybe try removing tiny, running the install process again (iirc, that shouldn't negatively affect anything), and install the latest tiny through package management.

    Sorry I can't give you a clearer answer, I honestly don't remember exactly what I did to fix it.

    Good luck,
    - Matt


  • pipemma1 Reply #9, 1 month, 2 weeks ago

    Reply
    I saw on another site (Bob's Guide?) that 4.3.1 also only works with 2.2.x so I'm guessing there's an incompatibility there. I really don't want to have to upgrade the entire site just to put some file links in which should be a 5-min job. I've been playing with Wordpress this weekend for a blog, and I have to say, as a non-techie, it does look much more accessible for your average lay person. Even though I've been using MODx for nearly 3 years, I still spend hours breaking my head whenever something goes slightly wrong


  • pipemma1 Reply #10, 1 month, 2 weeks ago

    Reply
    Is there a workaround by coding the links directly and not using the editor? The blasted thing will link to internal resources and external URLs, just the file browser isn't working. I have a really important page to publish that is just waiting for those links...

    I was going to see if I could crib the code from another site I built in Evo, but the web host made some changes a couple of weeks ago and has broken that so I can't even get at it <sigh>