Page 1 of 1

Warning in CMS 1.1.3.1, TinyMCE

Posted: Sun Sep 23, 2007 7:28 am
by Sy
This isn't an error as such, but it will cause a warning to be displayed if you have errors set at the appropriate level in PHP.

Line 104. of TinyMCE.module.php, reads:

if (!$this->wysiwygactive ) {if (!$this->wysiwygactive && isset($_SESSION["tiny_live_textareas"]) ) {

Change this to:

if (!$this->wysiwygactive && isset($_SESSION["tiny_live_textareas"]) ) {

I get the warning:

Notice: Undefined index: tiny_live_textareas in C:\eska\modules\TinyMCE\TinyMCE.module.php on line 104

I always have error reporting set to display absolutely everything, which is good practice for development.

Re: Warning in CMS 1.1.3.1, TinyMCE

Posted: Sun Sep 23, 2007 6:26 pm
by Ned Nowotny
Sy wrote: Change this to:

if (!$this->wysiwygactive && isset($_SESSION["tiny_live_textareas"]) ) {
In PHP 4.0.7 and later, this line can be:

Code: Select all

if (!$this->wysiwygactive && array_key_exists("tiny_live_textareas", $_SESSION) ) {
The array_key_exists function is key_exists in PHP 4.0.6.

If you must be compatible with older versions of PHP, a somewhat inefficient solution is:

Code: Select all

if (!$this->wysiwygactive && in_array("tiny_live_textareas", array_keys($_SESSION) ) ) {