Closed (won't fix)
Project:
Wysiwyg
Version:
6.x-2.x-dev
Component:
Editor - TinyMCE
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Dec 2009 at 15:46 UTC
Updated:
16 Dec 2010 at 03:14 UTC
Jump to comment: Most recent file
Comments
Comment #1
twodThank you for reporting and patching this! I didn't even know there was a new version up yet. Yes, all the versions of Wysiwyg currently use the same editor implementations. I'll test this ASAP. Only comment I have for now is whether it would be more appropriate to use
\sinstead of just a space?Comment #2
sunI don't see why we would want to change this - please revert.
We want to append another example for the new version string (just copy + paste), so we can track back the origins of this regular expression later.
Like TwoD already mentioned, we should use \s* instead of a space.
This review is powered by Dreditor.
Comment #3
guillaume.outters commentedWow, forget everything I said. I was using tinymce's source version (that is, before being whitespace-compacted). This explains all those spaces, and newlines, I encountered mysteriously.
Sorry for the time loss… I'll try to submit something useful next time.
Comment #4
twodNo worries. In the future we want to let users chose which editor library variant to load, which would be useful when debugging etc. When that gets in, documentation on this issue will be really nice to have.
Comment #5
guillaume.outters commentedWow (twice)… I couldn't have expected a more optimist and nice reaction than yours. In fact, I hadn't even imagined one could react this way. Thanks!
So, in case tiny_mce_src.js ever get used (this time intentionally…), I polish the patch (spaces, comment, and the fread for that _src.js has a newline between major and minor version).
Comment #6
twodAlways nice when people want to help! =) Thanks again for the patches.
@sun, fgets stops at newlines, fread doesn't. However, according to http://se.php.net/manual/en/function.fread.php we should also use the 'b' (binary) option to fopen or we may encounter problems on Windows platforms.
Comment #7
sunThe consideration for using fgets() was to stop a newlines, to not read more lines of a file than we want.
None of the files we want to parse are binary files... did I overlook something important on that page?
Please re-open this issue if you think there's room for investigation.
Comment #8
guillaume.outters commentedNo, no need to reopen: the current implementation is correct, and does not require the fread. But we were discussing its necessity in the "you know one day we will allow routing to tiny_mce_src.js instead of tiny_mce.js" case: in the _src.js file, the version number is effectively cut in half by a newline.
Comment #9
sunoh, I see! Now I feel dumb. Sorry for not recognizing this detail!
That's indeed a problem, and wasn't the case in earlier versions of TinyMCE. Damn. This hardens the migration to Libraries API, and I'm not sure how a keep-it-simple regex/solution could be able to parse the version info in both cases -- without introducing a separate version parsing function for library variants.
Tagging with global d.o Libraries tag. (you need to remove the project name from the URL to see all issues)
Comment #10
jimmb commentedHello, I'm not a programmer and as such cannot follow much of what's said in this thread. But I just downloaded the latest source version of TinyMCE (Version: 3.3b1) for the 6.x-2.0 version of WYSIWYG.
After I placed the latest TinyMCE into the /sites/all/libraries directory, Drupal wasn't able to detect it. So I'm not sure what to do at this point. Any advice (tailored to a non-programmer) would be much appreciated!
Thanks,
Jim
Comment #11
twodThat is an unrelated issue, which I'm currently working on. For a quick workaround, either download the previous release (recommended) or change the value on line 86 in wysiwyg/editors/tinymce.inc from 80 to 100, and remove line 21 from editors/js/tinymce-3.js. You won't get the new 'Advanced Lists' plugin, and you should NOT enable the 'Safari' compatibility plugin. This version of TinyMCE is still in Beta, since they've changed a lot internally. I will open a new issue about this shortly.
Comment #12
twodUmm guys, aren't we missing something?
@guillaume.outters, am I correct when guessing that you renamed tiny_mce_src.js to tiny_mce.js in order to use the source version?
wysiwyg_tinymce_version($editor)only looks at tiny_mce.js, and the source variant is always located in tiny_mce_src.js, meaning that even if we add an option to change the variant to load, the actual file looked in for version info will stay the same.The file header can be different for each of the variants (normal/minified, _src, _dev), so it makes sense to only look at one of those files to simplify the version parsing. As we encourage users not to edit or [re]move any files in the library folders after extracting them, this should also be safe to do regardless of which version the user actually wants to use. (I doubt anyone will complain about the few extra kb of diskspace 'wasted' by leaving tiny_mce.js in there if they only want to use tiny_mce_src.js).
So, is this a non-issue?
Comment #13
sunerm, sure, we at least can defer worrying about that entire topic to when we support different library variants in the first place. ;)
See #374391: Allow to configure editor library variant to load
Comment #14
guillaume.outters commented@TwoD: you're correct about my unorthodox file renaming.
On the plus side, we now know that the TinyMCE src variant will work with only a filename switch and not so much modifications in Wysiwyg.
Comment #15
jhans commentedHi
I detected the problem today but after patching the include file problem persits. I have not really knowledge about php but after investigating the tiny_mce.js file I recognized 80 characters are not enough to get major and minor version. I changed the number of characters from 80 to 100 and now it runs. The minor version ends at character 91.
Best regards
Joachim
Comment #16
sjovanig commentedHi,
Problem still exists with WYSIWYG 6.x-2.1 and TinyMCE 3.9.2.
To fix it, I had to increase from 100 to 200 bytes at line 87 in file editors/tinymce.inc.
Regards.
Comment #17
twodPlease check with the latest -dev before reporting issues like this. The problem was fixed a while ago using that very same solution in #695398: Support for TinyMCE 3.3.
This applies to all TinyMCE variants, not just the Source variant.
Comment #18
felipesluz commentedTank´s "lesergi" ..........