I click the edit button top left nothing happens but I see the following
Notice: Undefined index: edit in {closure}() (line 100 of D:\xampp\htdocs\ck717tmp\sites\all\modules\edit\includes\wysiwyg.inc).
fyi

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Title: after install » View/edit toggle broken
Priority: Normal » Critical

I'm not seeing the notice issue, but view/edit mode toggle is definitely broken in stock Edit module. (No Edit: Aloha Editor).

webchick’s picture

Ok, so without Edit: Aloha editor module, view/edit mode is just broken in that it does exactly nothing when you flip between the radios. (The styling is also off, because the radios are stacked on top of one another instead of side by side).

With Edit: Aloha editor module, the styling is fixed, but again nothing happens. Google's error console says:

Uncaught TypeError: Cannot read property 'length' of undefined aloha.js:483
Entities: 1 ; ["node:1"] edit.js:40
Fields: 3 ; ["node:1:title", "node:1:author", "node:1:created"] edit.js:41
Fields with (server-generated) forms: ["node:1:author", "node:1:created"] edit.js:45
edit_aloha:initializing edit_aloha.js:10
Uncaught TypeError: Object #<Object> has no method 'deferInit' edit_aloha.js:13
Uncaught TypeError: Object #<Object> has no method 'deferInit' edit_aloha.js:13
Drupal.edit.wysiwyg.edit_aloha.init edit_aloha.js:13
Drupal.edit.init edit.js:53
b.extend.each jquery.js:34
b.fn.b.each jquery.js:27
$.fn.once jquery.once.js:55
Drupal.behaviors.edit.attach edit.js:11
Drupal.attachBehaviors drupal.js:55
b.extend.each jquery.js:33
Drupal.attachBehaviors drupal.js:53
Drupal.theme.placeholder drupal.js:391
b.extend.ready jquery.js:30
u jquery.js:38
Wim Leers’s picture

Title: View/edit toggle broken » View/edit toggle broken; JS console: "no method 'deferInit'"
Category: bug » support

You must update to the 0.21 release of Aloha; the one you have doesn't have the "deferInit" method that we got in during the sprint.

Potentially it's a browser cache issue, so you may want to clear the browser cache as well.

sylus’s picture

Assigned: Wim Leers » Unassigned
Status: Postponed (maintainer needs more info) » Active

I am able to reproduce the exact same error that webchick posted.

I am using the dev releases of FAPE, Edit, and version 0.21 of Aloha Editor.

Additionally I have flushed both my drupal and browser cache repeatedly and error still persists.

Still really excited about the work going into this, can't wait to see it in action! :)

Wim Leers’s picture

Assigned: Unassigned » Wim Leers
Status: Active » Postponed (maintainer needs more info)

Hm… did you apply this core patch? http://drupal.org/node/1664602#comment-6221066

sylus’s picture

Assigned: Unassigned » Wim Leers
Status: Active » Postponed (maintainer needs more info)

Thanks @Wim Leers that did get past those specific errors for me ^_^

A new one did popup though probably is specific to my setup.

Uncaught TypeError: Object #

has no method '_load' aloha.js:2217 (anonymous function) aloha.js:2217 (anonymous function) aloha.js:2217 Entities: 1 ; ["node:3"] edit.js:40 Fields: 0 ; [] edit.js:41 Fields with (server-generated) forms: [] edit.js:45 edit_aloha:initializing edit_aloha.js:10
Wim Leers’s picture

I've most definitely never seen that one before (it being inside of Aloha). Can you please clear all Drupal caches and your browser cache to make sure it's not a caching issue?

sylus’s picture

I tried clearing caches but to no avail.

I did try to perform a more reproducible set-up by doing the following steps:

1) Downloaded Spark (alpha 2) from: http://drupal.org/project/spark
2) Applied patch to core (common.inc): http://drupal.org/node/1664602#comment-6221066
3) Added dev release of edit to spark/modules/contrib (replacing existing edit)
4) Added libraries module (7-.x-2.0) to spark/modules/contrib
5) Added alohaeditor (0.21) to spark/libraries/alohaeditor

While the view edit tab works I still do get the following on spark's front page:

Uncaught TypeError: Object #<Object> has no method '_load' aloha.js:2217
(anonymous function) aloha.js:2217
(anonymous function) aloha.js:2217
Entities: 1 ; ["node:1"] edit.js:40
Fields: 3 ; ["node:1:title", "node:1:author", "node:1:created"] edit.js:41
Fields with (server-generated) forms: ["node:1:author", "node:1:created"] edit.js:45
edit_aloha:initializing :8082/profiles/spark/modules/contrib/edit/edit_aloha/js/edit_aloha.js?m7zmqu:10

While navigating a few more areas:

Failed to load resource: the server responded with a status of 404 (Not Found) http://drupal_spark:8082/aloha//token-filter/lib/token-filter-plugin.js
Uncaught Error: Script error
http://requirejs.org/docs/errors.html#scripterror require.js:1795

It might just be a problem with my acquia dev setup, I'll try to reproduce on my CentOS box when get a chance and report back here. Thanks for your help though as I know your crazy busy :)

Wim Leers’s picture

Okay, so the problem is the token_filter stuff. I tested it on my computer to make sure it'd work *without* token_filter installed, but apparently it does not.

Please replace these lines in edit/edit_aloha/edit_aloha.module:

    'token_filter/token-filter'
  );

with these lines:

  );
  if (module_exists('token_filter')) {
    $plugins[] = 'token_filter/token-filter';
  }

That should do the trick. If it does, I'll commit it right away. Sorry for all the trouble! And thanks for taking the time to work it through!

sylus’s picture

Hey @Wim Leers,

Your suggestion did fix the token-filter-plugin problem. ^_^

I do still get the _load problem as per:

TypeError: 'undefined' is not a function (evaluating 'Aloha._load()')  aloha.js:2217
Entities: 1 ; ["node:1"] edit_aloha.js:40
Fields: 3 ; ["node:1:title", "node:1:author", "node:1:created"] edit_aloha.js:41
Fields with (server-generated) forms: ["node:1:author", "node:1:created"] edit_aloha.js:45
edit_aloha:initializing  edit_aloha.js:10
edit: WYSIWYG ready  edit_aloha.js:51

Wondering if using using the alpha2 version of spark is missing something from dev. Will check that next :)

sylus’s picture

I just switched to dev version from Aloha Editor's git repo rather then the 0.21 download they provided on their website and everything works! :)

Well there are no more javascripts errors at least.

Is the Aloha Editor supposed to show up with a standard wysiwyg interface on long text? Or is this the next bit of work to be done? :)

Wim Leers’s picture

That's very odd. I tested with 0.21, and that should've worked as well!

With regards to text formats: yes, that needs to be configured rather precisely, unfortunately. The module should let you know automatically when you need to add certain tags to the list of allowed tags. It will only work on HTML-based input formats, which are configured similar to this:

Screen Shot 2012-08-01 at 12.01.35 PM.png

Wim Leers’s picture

Title: View/edit toggle broken; JS console: "no method 'deferInit'" » View/edit toggle broken; JS console: token filter error, "no method 'deferInit'"

#9 committed: http://drupalcode.org/project/edit.git/commit/668c2d4.

I've now reproduced the problem you described in #11. Any chance you used their "CDN version"?

Wim Leers’s picture

Wim Leers’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Needs work
Wim Leers’s picture

Title: View/edit toggle broken; JS console: token filter error, "no method 'deferInit'" » When using compiled version of Aloha Editor: "no method 'deferInit'"
Component: Code » Aloha Editor
Status: Needs work » Fixed
babbage’s picture

In my testing, the core patch in #5 above fixes the problem if you have js aggregation turned off, but not if it is turned on. It may be that this would not be a problem anyway once the patch to Aloha Editor is available to mortals (they don't seem to publish a mechanism for getting their -dev versions other than compiling from source?) but it does raise the possibility that the patch linked in #5 doesn't provide the full fix that might be required for other/future problems?

Wim Leers’s picture

CSS aggregation is currently not yet supported for the Edit module or for Spark at large.

Status: Fixed » Closed (fixed)

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