WYSIWYG Editor(en) gehen nur einmal [SOLVED]

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

WYSIWYG Editor(en) gehen nur einmal [SOLVED]

Post by pico »

nach dem anmelden im Backend kann ich nur einmal den Content-Part WYSIWYG benutzen

- egal welchen Editor ich in der conf.inc.php einstelle -

beim zweiten aufruf oder nach 'Inhalt aktualisieren' kommt nur noch 'reines HTML'

nach Logout und erneutem Login geht es wieder einmal.

Horst
Last edited by pico on Wed 26. Jan 2005, 12:43, edited 1 time in total.
herbu
Posts: 31
Joined: Mon 10. Nov 2003, 10:46

Post by herbu »

habe genau das gleiche problem. kann jemand helfen?
Buster
Posts: 50
Joined: Sat 9. Oct 2004, 12:16

Post by Buster »

Nähere Info's wie z.B. Browser, Version etc. wären schon hilfreich :)

Gruss
Buster
herbu
Posts: 31
Joined: Mon 10. Nov 2003, 10:46

Post by herbu »

Release Name: 1.1.5-DEV

Bei jedem Browser der neusten Version (IE, Mozilla, Firefox, Netscape)
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

Browser: getestet IE6, Firefox, Mozilla

überall das gleiche Problem - scheint nicht am Browser zu liegen

bin kein PHP-Guru aber ich vermute dass die Variable '$phpwcms["wysiwyg_editor"]' irgendwie gelöscht wird bzw. auf '0' = no WYSIWG gesetzt wird.
whizkid
Posts: 14
Joined: Wed 1. Dec 2004, 11:48

Post by whizkid »

The WYSIWYG HTML Editor is not working at all in my 1.1.5 (patch1) test installation. No matter which editor I set it to in the config (1 to 3). I am using Internet Explorer 6.

-whiz
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

so - hab jetzt mal in der wysiwyg.editor.inc ein echo eingefügt

Code: Select all

if(!isset($wysiwyg_editor['rows']))		$wysiwyg_editor['rows']		= '15';
if(!isset($wysiwyg_editor['editor'])){
	$wysiwyg_editor['editor']	= 1;
	if(isset($_SESSION["wysiwyg_editor"])) $wysiwyg_editor['editor'] = $_SESSION["wysiwyg_editor"];
}
$wysiwyg_editor['lang']	= isset($_SESSION["wcs_user_lang"]) ? $_SESSION["wcs_user_lang"] : 'en';

echo $wysiwyg_editor['editor']; /* <------- hier */

switch($wysiwyg_editor['editor']) {
wenn man nun den wysiwyg-Editor das erstemal in einer Session aufruft wird der Wert '4' (hab ich so in der config.inc.php) ausgegeben, beim 2. Aufruf wird 'Array' ausgegeben, was wohl meine Vermutung bestätigt, dass die Variable verloren geht :!: :?:

Ich kann leider nicht feststellen wann und wo dieser Datenverlust eintritt :?:

Horst
Executter
Posts: 78
Joined: Thu 29. Jul 2004, 15:37
Location: Koblenz, Deutschland
Contact:

Post by Executter »

Es wäre schon von Vorteil wenn jemand mit Ahnung das mal fixen könnte :D
THX
Executter
Armin Rüdiger Vieweg
Design & Programmierung

Image
Website: http://www.dewecon.de
User avatar
habi
Posts: 166
Joined: Sun 15. Feb 2004, 13:39
Location: Rutschwil, Switzerland
Contact:

Post by habi »

it looks like one of this "flüchtigkeitsfehler". the session is stored in a array field instead of the array.

so in file wysiwig.editor.inc.php change line

Code: Select all

	if(isset($_SESSION["wysiwyg_editor"])) $wysiwyg_editor['editor'] = $_SESSION["wysiwyg_editor"];
to

Code: Select all

	if(isset($_SESSION["wysiwyg_editor"])) $wysiwyg_editor = $_SESSION["wysiwyg_editor"];
hope this helps
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

have changed it - but it still works only for one time :(

Horst
User avatar
habi
Posts: 166
Joined: Sun 15. Feb 2004, 13:39
Location: Rutschwil, Switzerland
Contact:

Post by habi »

ok. schnellschüsse sind nicht immer gleich treffer.

but after a closer look I found that OG builds the array at several locations in the code and for the field editor he is using the session value. but instead of filling the field value he fills the entire array in the editor field. so you have to change this at several locations. please look in the following files:
  • inc_tmpl/article.editsummary.tmpl.php
    inc_tmpl/content/cnt1.inc.php
    inc_tmpl/content/cnt14.inc.php
    inc_tmpl/content/cnt51.inc.php
    inc_tmpl/message.newsletter.tmpl
look for a line like this:

Code: Select all

	'editor'	=> $_SESSION["wysiwyg_editor"]
and change it to

Code: Select all

	'editor'	=> $_SESSION["wysiwyg_editor"]["editor"]
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

many thanx to you Habi,

now it seems that it works

:idea: maybe I will understand a little bit more about PHP and Array Variable's in future :oops:
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

found now that the Typ of WYSIWG-Editor is not taken from conf.inc.php

it looks to me that it takes the one who is set in the wysiwyg.edito.inc.php
here:

Code: Select all

if(!isset($wysiwyg_editor['editor'])){

	$wysiwyg_editor['editor']	= 4;  /*<<------- hier */

	if(isset($_SESSION["wysiwyg_editor"])) $wysiwyg_editor['editor'] = $_SESSION["wysiwyg_editor"][editor];
}
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
herbu
Posts: 31
Joined: Mon 10. Nov 2003, 10:46

Post by herbu »

ok pico,
nun musst du die 4 durch dieses ersetzen $phpwcms["wysiwyg_editor"] damit du den editor in der conf.inc. php einstellen kanst.
danke, dass du mich auf den weg gebracht hast.
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

ok thanx to Habi and Herbu
now it looks good

I will now resume all Steps for further users

Step 1 - change in inc_lib/wysiwyg.editor.inc.php line 43 to

Code: Select all

if(!isset($wysiwyg_editor['editor'])){
	$wysiwyg_editor['editor']	= $phpwcms["wysiwyg_editor"];
	if(isset($_SESSION["wysiwyg_editor"])) $wysiwyg_editor ['editor'] = $_SESSION["wysiwyg_editor"][editor];
}
Step 2 - search Code

Code: Select all

'editor'   => $_SESSION["wysiwyg_editor"] 
in
inc_tmpl/article.editsummary.tmpl.php
inc_tmpl/content/cnt1.inc.php
inc_tmpl/content/cnt14.inc.php
inc_tmpl/content/cnt51.inc.php
inc_tmpl/message.newsletter.tmpl

and change it to

Code: Select all

'editor'   => $_SESSION["wysiwyg_editor"][editor] 
btw - i think it would be nice to change the Editortyp in the Backend because everyone has some Features I use sometimes

so long and many Thanks again
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
Post Reply