e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
323 stars 214 forks source link

Tinymce/bbcode #614

Closed tgtje closed 10 years ago

tgtje commented 10 years ago

USING news create OR Page (files age : latest 5 hours ago) 2-6 INPUT AREA (window : body)

Upgrade of v1 to v2 : succeeded with 1 solvable issue : new issue made/making> forum related issue =upgrade )

Creating news and/or pages

(as installed = tinymce4 Upgraded site trying to add youtube etc. When selecting youtube it opens media manager news : youtube (2 movies); not selectable Adding an image : media m.. displayed : not selectable

adding youtube embedding code ( i frame ) works, txt works. Trying to use any image or related > not selectable

Here are some error reports Tijdstempel: 2-6-2014 14:44:05 Fout: TypeError: $(...).tooltip is not a function Bronbestand: http://domain/e107_web/js/core/admin.jquery.js?1401712003 Regel: 76 = $(this).tooltip({opacity:1.0,fade:true, placement: pos});

When creating news selecting an image at bottom (first block) it opens mediamanager.Selecting an image shown. marks it, but does NOT close the dialog : no file selection (closing window)

Tijdstempel: 2-6-2014 14:52:14 Fout: TypeError: parent.document.getElementById(...) is null Bronbestand: http://domain/e107_admin/image.php?mode=main&action=dialog&for=news&tagid=news-thumbnail-0&iframe=1&video=1 Regel: 1

Tijdstempel: 2-6-2014 14:56:25 Fout: TypeError: e is undefined Bronbestand: http://tinymce.cachefly.net/4.0/tinymce.min.js?1401712003 Regel: 9

Tijdstempel: 2-6-2014 15:02:11 Fout: TypeError: $(...).draggable is not a function Bronbestand: http://domain/e107_web/js/core/admin.jquery.js?1401712003 Regel: 82

Uninstalled Tinymce4 Installed Tinymce

In BOTH cases i have NO possibilties to add media related Preferences adjusting (disabling wysiwig) does NOT change display of window or makes changes to method for input

Tijdstempel: 2-6-2014 15:04:47 Fout: TypeError: tinymce is null Bronbestand: http://domain/e107_plugins/tinymce/tiny_mce_popup.js?1401712003 Regel: 5

basically i can not create a page or news post WITH media

Moc commented 10 years ago

Which browser is this?

tgtje commented 10 years ago

Firefox mainly, also in use (partial when testing) Opera and , IE 11 (troublesome overall) Chrome Needs re-testing due to changed files...

tgtje commented 10 years ago

9th June ; latest files browsers Opera IE11 Chrome and Firefox Tinymce 4 does NOT display the bb code panel (no not the one from non wysiwig). Only IE seems to'blimp'for a fraction of a second.

This happens on a live (test) server as new install and also as an update.

Screenshot of IE11 ( the 'blimp') where all other 3 browsers do not want to do (display) anything at all.

screenshot039

Jimmi08 commented 10 years ago

Maybe related? https://github.com/e107inc/e107/issues/624 See my second comment.

Moc commented 10 years ago

What PHP version do you have running @tgtje ?

willem010 commented 10 years ago

i just double checked, (my host offers a selector for php version, but this defaults to 5.3 (native) ) when i use that default version, no tinymce4. it doesnt render and the textarea looks like a default text area. (shows errors like you see in screenprints in this topic.)

when i set it to 5.5, problem is solved clearly this is a php version issue

Jimmi08 commented 10 years ago

The same here, but I can switch only to 5.4 version, 5.3. is native too. With 5.4 no problems.

willem010 commented 10 years ago

yep.. after some testing, 5.4 is definitely the best version my setup. when using 5.5 i notice my logs filling up with lot's of depricated msgs and errors on my plugins :D

Moc commented 10 years ago

Willem, if you see any notices related to the e107 core (plugins) please let me know in a separate issue and I'll look into them to see if we can already get rid of them.

willem010 commented 10 years ago

sure. the rss output plugin, is this considered a core plugin? if so, i will create a new topic ;)

Moc commented 10 years ago

Yes, although it's a very old one in need of a rewrite. Just post them up, all in one issue (not for every plugin a different issue but just in one issue) and I'll take a look at them. Thanks!

willem010 commented 10 years ago

no problem. i will test as much core plugins as i can for the php version problems and report it in one issue.

tgtje commented 10 years ago

php 5.3.27 & php 5.3.28

Mind ! these are basic (shared) hosting versions, no possibility to change php versions. So testing on pc will most of the times differ from actual LIVE issues. Not all hosters do run with php 5.4 (or upwards)

5.3.x should be sufficient,; 5.4 ( or higher) as minimum requirement is (imo) a no go .

Moc commented 10 years ago

@tgtje Yep, that's why the current requirement is still PHP 5.3 (which is over 5 years old!). Hosts should definitely be looking into upgrading onto PHP 5.4 in the next year or so.

Anyhow, this issue is narrowed down to a PHP 5.3 incompatibility. No issues on PHP 5.4+ Not sure how to approach this to be honest. Any suggestions @CaMer0n? Also see #624

willem010 commented 10 years ago

funny, Zyma did exactly that last night. 5.4 now has been set as native version.

(which renders some of my own plugins useless, so i needed to revert to 5.3 in the end)

after some testing i didnt find new problems or core plugins . tinymce4 doesnt work on 5.3 but thats now known to be an issue, rss out doesnt like 5.4 and up. for news items containing html and doesnt work at all for downloads. (i will open an issue for this if you want me to)

i have done a quick test on the forum and that seems to work better with 5.4 i think some issues on the forum authorisation are due to using 5.3 but this needs more testing to be sure.

Moc commented 10 years ago

and doesnt work at all for downloads. (i will open an issue for this if you want me to)

Yes please, I'll take a look. Not sure what's wrong as that plugin works properly on PHP 5.4 here and o many other installations.

i think some issues on the forum authorisation are due to using 5.3 but this needs more testing to be sure.

Would be great to have this confirmed.

Moc commented 10 years ago

Just as a reference, video by @tgtje http://tgtje.eu/movik/flvplayer/flashvideoplayer.html?video=content/tiny.flv

tgtje commented 10 years ago

adding : running php 5.3.28 issue is the display style > none (it hides in all browsers; posted before as 'blimp'only in IE 11 )

Jimmi08 commented 10 years ago

tgtje, could you click on console tab and insert picture here if there isn't javascript problem? Thanks By the way, your video is fantastic.

Jimmi08 commented 10 years ago

Only notice: there is in e_meta.php in tinymce4 used mceAddControl and I found: "they removed mceRemoveControl and mceAddControl in tinymce4, so use mceAddEditor and mceRemoveEditor instead."

tgtje commented 10 years ago

@Jimmi08 here's a pic, notice : the only error is 'made' from the 'outside". eg. external call as for the notice: i changed those 2 ( Add x2 Rem x1) but does not show any change.

screenshot043

used this time the create page instead of add news, since it is the same issue. (none set to inline)

Jimmi08 commented 10 years ago

But look what happend if I change display:none on php5.4 installation: image You are missing the second div section in your code.

Jimmi08 commented 10 years ago

Weird thing is that in source code when I clink on wysiwyg.php with tinymce init, there is in 5.4: image but in 5.3 there is only: image this is reason for javascript error, tinymce is not set correctly. @tgtje could you check yours? in chrome CTRL-U, find wysiwyg.php and see in it. Thanks.

tgtje commented 10 years ago

done as asked (by Chrome clicking link for wysiwig)

image

Jimmi08 commented 10 years ago

Yes, exactly, so this is not inserted in php 5.3: image I know nothing about json, so somebody else need to help. But we found the reason why tinymce4 doesn't work in 5.3, I think.

Moc commented 10 years ago

@tgtje On line 102 of e107_plugins/tinymce4/wysiwyg.php change this:

$text .= json_encode($this->config, JSON_PRETTY_PRINT);

to

$text .= json_encode($this->config);

Please re-test the issue, and check the source code. If the source code is different, please post another image.

tgtje commented 10 years ago

retest working img : screenshot044

identical sourcecode in Chrome now shows :

 /* TinyMce Config: Main Admin */

tinymce.init({"selector":".e-wysiwyg","theme":"modern","plugins":"advlist autolink lists link image charmap print preview hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen        insertdatetime media nonbreaking save table contextmenu directionality emoticons template paste textcolor","language":"en","menubar":"edit view format insert table tools","toolbar1":"undo redo | styleselect | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | e107-image e107-video e107-glyph | preview","external_plugins":{"e107":"/e107_plugins/tinymce4/plugins/e107/plugin.js","example":"/e107_plugins/tinymce4/plugins/example/plugin.js"},"image_advtab":true,"extended_valid_elements":"i[*], object[*],embed[*],bbcode[*]","convert_fonts_to_spans":false,"content_css":"http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"});
tgtje commented 10 years ago

As a notice: investigating why this option (code) change to understand; i found this : probably the reason for it :

http://ryanuber.com/07-10-2012/json-pretty-print-pre-5.4.html https://gist.github.com/GloryFish/1045396

Moc commented 10 years ago

Yeah the 'pretty print' option is only available since PHP 5.4. That's why the config fields aren't filled properly, and that's why TinyMCE won't show up on PHP 5.3.

I don't really get why it's not throwing a more accurate error though. Did you try enabling the debug mode to find PHP errors/warnings?

I'm going to verify with @CaMer0n if it's ok to use this fix. The only difference is that the JSON is not outputted nicely (properly formatted, but all in one row) in the source code. Functionality wise, nothing else changes. I have found a workaround in case we'd prefer to have a nicely formatted sourcecode: https://github.com/GerHobbelt/nicejson-php

tgtje commented 10 years ago

Yes, multiple times (using FF and debugger ) it will not show any errors, just some notices (related to plugins)

Moc commented 10 years ago

Ah well, we found the error anyway, thanks to you @tgtje and @Jimmi08 !

As I said in my previous reply, I'll need to verify with Cameron to see what fix we'll implement for this, but it should be sorted soon :)

Moc commented 10 years ago

Pushed the temporary fix anyway, for the time being.

Moc commented 10 years ago

@tgtje Are the issues fixed now?

tgtje commented 10 years ago

for me the small change does work.

Just have to reinstall a new pack, since (reason unknown) media manage is becoming very sluggish.. (do not think it is related)

Moc commented 10 years ago

Ok, closing this issue. Please open up a new issue in case of new issues.