We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I have upgraded a site from 2.2.16 to 2.5.2 using the following steps:

    Upgraded all Extras in 2.2.16 (Newspublisher was at 1.3 and didn't have an update button)
    Updated to 2.3
    Updated to 2.4 (couldn't login until I disabled the Captcha plugin)
    Updated to 2.5
    Updated to 2.5.2

    Attempted a front end edit by:

    Logging in to the front end in another browser
    I was successfully directed to my custom page that I can edit
    Clicked the Edit button
    Got an HTTP 500 Error
    Checked to see if there was an updated version of Newspublisher
    Installed new version (2.1.0)
    Still the same problem (TinyMCE is at 4.3.4 as requried for this version of MODX)

    Checked the server logs and get this error:

    [01-Jan-2017 15:58:53 America/New_York] PHP Fatal error:  Call to a member function addJavascript() on a non-object in M:\wamp\www\crom\core\components\tinymce\tinymce.class.php on line 151
    
    [01-Jan-2017 15:58:53 America/New_York] PHP Stack trace:
    
    [01-Jan-2017 15:58:53 America/New_York] PHP   1. {main}() M:\wamp\www\crom\index.php:0
    
    [01-Jan-2017 15:58:53 America/New_York] PHP   2. modX->handleRequest() M:\wamp\www\crom\index.php:57
    
    [01-Jan-2017 15:58:53 America/New_York] PHP   3. modRequest->handleRequest() M:\wamp\www\crom\core\model\modx\modx.class.php:1399
    
    [01-Jan-2017 15:58:53 America/New_York] PHP   4. modRequest->prepareResponse() M:\wamp\www\crom\core\model\modx\modrequest.class.php:121
    
    [01-Jan-2017 15:58:53 America/New_York] PHP   5. modResponse->outputContent() M:\wamp\www\crom\core\model\modx\modrequest.class.php:137
    
    [01-Jan-2017 15:58:53 America/New_York] PHP   6. modParser->processElementTags() M:\wamp\www\crom\core\model\modx\modresponse.class.php:69
    
    [01-Jan-2017 15:58:53 America/New_York] PHP   7. modParser->processTag() M:\wamp\www\crom\core\model\modx\modparser.class.php:250
    
    [01-Jan-2017 15:58:53 America/New_York] PHP   8. modScript->process() M:\wamp\www\crom\core\model\modx\modparser.class.php:521
    
    [01-Jan-2017 15:58:53 America/New_York] PHP   9. include() M:\wamp\www\crom\core\model\modx\modscript.class.php:70
    
    [01-Jan-2017 15:58:53 America/New_York] PHP  10. Newspublisher->init() M:\wamp\www\crom\core\cache\includes\elements\modsnippet\29.include.cache.php:148
    
    [01-Jan-2017 15:58:53 America/New_York] PHP  11. TinyMCE->initialize() M:\wamp\www\crom\core\components\newspublisher\model\newspublisher\newspublisher.class.php:590
    


    Line 151 of tinymce.class.php is:

    $this->modx->controller->addJavascript($this->config['assetsUrl'].'jscripts/tiny_mce/'.$scriptFile)
    


    Line 590 of newspublisher.class.php is:

    $tiny->initialize();
    


    Before that there is this:

                    require_once $tinyPath.'tinymce.class.php';
                    $tiny = new TinyMCE($this->modx, $tinyproperties);
    
                    $tinyproperties['language'] =
                        $this->modx->getOption('fe_editor_lang',array(),$language);
                    $tinyproperties['frontend'] = true;
                    $tinyproperties['cleanup'] = true; /* prevents "bogus" bug */
                    $tinyproperties['width'] = empty ($this->props['tinywidth'] )
                        ? '95%'
                        : $this->props['tinywidth'];
                    $tinyproperties['height'] = empty ($this->props['tinyheight'])
                        ? '400px'
                        : $this->props['tinyheight'];
                    $tinyproperties['resource'] = $this->resource;
                    $tiny->setProperties($tinyproperties);
                    $tiny->initialize();
    


    In my "Edit" template I have the following Newspublisher code:

    [[!NewsPublisher?
    &show=`pagetitle,memberlogo,content`
    &required=`pagetitle`
    &richtext=`1`
    &initrte=`1`
    &rtcontent=`1`
    &initdatepicker=`1`
    &tinyWidth=`450`
    &tinyHeight=`300`
    &parentid=`19`
    &template=`Member Profile`
    ]]
    


    My edit button code is:

    [[!NpEditThisButton? &np_id=`22`]]
    


    Not being a programmer I'm not sure what the issue is save perhaps some sort of incompatiblilty with the latest TinyMCE?
      • 42562
      • 1,145 Posts
      As you wait for an update for NewsPublisher...

      You can try this:

      How Do I use NewsPublisher with TinymceWrapper?
      https://forums.modx.com/thread/97694/support-comments-for-tinymcewrapper?page=38#dis-post-547079
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.