Downloaded and installed the YUI and markitup, neither loaded. I got errors looking for the README files in each folder. These files where not in the downloads from either YUI or markitup. I created them and placed the version number inside hoping it would fullfill the requirements but it did not.

TinyMCE is working just fine though!

Thanks

Todd

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

djem’s picture

Assigned: Unassigned » djem
FileSize
343 bytes

The README file is needed to determine the version of the YUI and its location was changed to "releasenotes/README.base". This patch will help.

sun’s picture

Status: Active » Needs review
deshilachado’s picture

Version: 6.x-1.0 » 6.x-2.x-dev
Status: Needs review » Reviewed & tested by the community

The patch works for me:
after applying the patch to the 6.x-2.x-dev version of Wysiwyg API the YUIeditor v2.7.0 installs without problems.

deshilachado’s picture

Title: can't load YUI markitup » YUIeditor installation: path to readme.txt wrong

The same solution works for markitup, too
I opened a new thread for the markitup solution here: #385736: markItUp: Wrong editor library location

hass’s picture

Version detection WFM with YUI 2.70b, but Editor is not loading... :-/

sun’s picture

Assigned: djem » Unassigned
Status: Reviewed & tested by the community » Needs review
FileSize
1.02 KB

Please test attached patch.

sun’s picture

Title: YUIeditor installation: path to readme.txt wrong » YUI editor: Version detection not working
hass’s picture

d.o eated my comment :-(. New patch as the one above does not work and stops processing on the first copyright line with 2009 inside. I have added the version in front and now it WFM.

/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
hass’s picture

Aside - do we already have a case for this error that prevents loading of the editor?

YAHOO.widget.Editor is not a constructor
http://localhost/drupal6/sites/all/modules/wysiwyg/editors/js/yui.js?2
Line 10
hass’s picture

sun’s picture

Status: Needs review » Fixed

Committed to all branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Mike_Waters’s picture

This still doesn't work, for wysiwg 6.x-2.0 using YUI editor 2.8.0r4.
The problem appears to be the version check regex in wysiwyg_yui_version() (yui.inc); it does not allow for 'r' in the version string.

  $library = $editor['library path'] . '/editor/editor.js';
  $library = fopen($library, 'r');
  $max_lines = 10;
  while ($max_lines && $line = fgets($library, 60)) {
    if (preg_match('@version:\s([0-9r\.]+)$@', $line, $version)) {
      fclose($library);
      return $version[1];
    }
    $max_lines--;
  }

'@version:\s([0-9\.]+)$@' is at fault. I personally just changed it to '@version:\s([0-9r\.]+)$@' but I don't think that's a future-proof fix.

HTH

TomSherlock’s picture

@Mike_Waters,
I would greatly appreciate your explanation as to why '@version:\s([0-9\.]+)$@' is at fault and why it is not future-proof.

Your solutions seems to have done the trick for me. However, i would still appreciate an explanation.

Thanks,
Tom

Mike_Waters’s picture

that regex only allows for digits and a dot (.) to appear in the version string (e.g. 2.70). The current yui editor version has an 'r' in it (stands for 'revision'; ex. 2.70r4 for revision 4 of version 2.70), and so the regex test failed and the version was not detected. adding 'r' to the regex allowed the version to be properly detected. This is not an optimal solution however; if yahoo decided to add a new characteer to the revision string, version detection would break again. for example, a beta release might be called 2.70b5; this string would not be detected by the regex. that is why my fix is not future proof, and so i did not submit a patch. HTH

vegardjo’s picture

Status: Closed (fixed) » Active

Marking this as active again, as the problem have resurfaced again after the r* version. Had the same problem here: #581236: The version of YUI editor could not be detected.

TwoD’s picture

Marked #581236: The version of YUI editor could not be detected. a duplicate of this.

Looking at older releases of YUI, it seems they just append a, b or r# so I think we'd be pretty safe with '@version:\s([0-9abr\.]+)$@'. What do you think?

sun’s picture

Please just remove the trailing $ in the regex.

"2.70r4" will then be "2.70", regardless of a, b, r, foo. I hope and guess that "2.70" is the official version, and "r4" is just an incremental build number, and the API will keep the same within "2.70".

If that assumption is not the case, then we probably need ([0-9\.-])(a-z)?([0-9\.-])?, and potentially, we need to translate the optional character in the middle into "alpha" (a), "beta" (b), or nothing (r) to make it compatible to PHP's version_compare().

2.70 => 2.70             (major release)
2.70a2 => 2.70-alpha-2   (second alpha BEFORE major release)
2.70b1 => 2.70-beta-1    (first beta after alphas BEFORE major release)
2.70r4 => 2.70.4         (minor release 4 AFTER major release)

version_compare() already performs this logic, but requires certain strings to my knowledge. (I may be mistaken though)

TwoD’s picture

Good point Sun. We will most likely never need that detailed info about the version in use to be able to determine if a plugin or setting etc should be available to the user.

Hmm, after some reading, it seems they "may" change the API even in beta releases. But I highly doubt they'll change the initialization and other parts we're relying on that easily.

ac’s picture

Version 2.8.0r4 is out now and does not work with this module due to this bug

drupizzle’s picture

SimonEast’s picture

Status: Active » Needs review
FileSize
462 bytes

Yes, here is the simple change (hack) needed for the latest YUI editor to load.

TwoD’s picture

Status: Needs review » Fixed

Committed to all branches. Thanks for reviewing, testing and patching!
This should be in the -dev snapshots within a few hours.

aiphes’s picture

how to apply the patch please ?

TwoD’s picture

@aiphe, http://drupal.org/patch/apply

The patch only removes the $ at the end of the regular expression, so it's just as easy to apply it by hand.
Note that if you're using the -dev version, you do not need to apply the patch if you have the latest snapshot as this fix is now in it.

aiphes’s picture

thanks for help

if you're using the -dev version

you're speaking the wysiwig version ?

TwoD’s picture

Yes

boldart’s picture

@Mike_Waters

This fix worked fr me - thanks!

This is on line 72 of wysiwyg/editors/yui.inc

jdw

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drvdt’s picture

I follow this:
#13
Mike_Waters - September 16, 2009 - 00:13
It's OK!!!!!!!!!!
Many thanks, Mike!