Page 1 of 1

PHP errors when browsing for image TinyMCE

Posted: Tue Jun 28, 2016 6:39 pm
by handcoded
Hi

I have upgraded an old install to version 1.12.1 "Rontiki" and after finally getting TinyMCE to work by changing the settings for the module so that it uses a static config file I have run into another issue.

When editing a page and browsing for an image this error appears and I don't know how to fix it.

Warning: Creating default object from empty value in /home/******/public_html/modules/TinyMCE/filepicker.php on line 14

Fatal error: Call to undefined method stdClass::GetPreference() in /home/******/public_html/modules/TinyMCE/filepicker.php on line 15

The code looks like this:

Code: Select all

$CMS_ADMIN_PAGE=1;
$path = dirname(dirname(dirname(__FILE__)));
require_once($path . DIRECTORY_SEPARATOR . 'include.php');
$urlext = get_secure_param();

check_login();
$userid = get_userid();

$config=&$gCms->GetConfig();

$modules =&$gCms->modules;
$tiny=$modules["TinyMCE"]['object'];
$tiny->curlang=get_preference($userid, 'default_cms_language');
$filepickerstyle=$tiny->GetPreference("filepickerstyle","both");
$tiny->smarty->assign("filepickerstyle",$filepickerstyle);

$tiny->smarty->assign("rooturl",$config["root_url"]);
$tiny->smarty->assign("admindir",$config["admin_dir"]);
$tiny->smarty->assign("filepickertitle",$tiny->Lang("filepickertitle"));
$tiny->smarty->assign("youareintext",$tiny->Lang("youareintext"));
Some assistance would certainly be appreciated.

Re: PHP errors when browsing for image TinyMCE

Posted: Wed Jun 29, 2016 10:14 am
by PinkElephant
Hi
handcoded wrote:modules/TinyMCE/filepicker.php on line 14
Looking briefly at 1.x I'm guessing that your version of TinyMCE is out-of-date or out-of-whack. I'd try a fresh install with vanilla TinyMCE (better still, CMSms 2.x).

Re: PHP errors when browsing for image TinyMCE

Posted: Thu Jun 30, 2016 7:02 pm
by Jeff
Which version of TinyMCE?

My guess is you are using the latest version which is for 2.x not 1.x.

Re: PHP errors when browsing for image TinyMCE

Posted: Thu Jun 30, 2016 7:05 pm
by handcoded
Hi

Was version 2.something but have upgraded it to a later version 2 and it is now working fine.