I'm getting a JS error in edit.js within the processField function on line 267 with the following scenario:

  • Latest Drupal installed with standard profile.
  • Edit module and ckeditor module enabled (plus their dependencies) but nothing else.
  • Everything stock except for the setting at /admin/appearance titled "Use the administration theme when editing or creating content" which is unchecked.

Tested with seven and bartik, both themes exhibit the same behaviour.

It looks like edit is trying to process the page title field but the needed attributes haven't been added. If an administration theme is used for node editing then this problem does not occur.

I've added a possibly related issue that I noticed in the queue which has the same error but under unspecified circumstances which is why I created this issue, with reproducible steps. Let me know if I can help debug further.

CommentFileSizeAuthor
#2 node_edit_js_error-2264607-2.patch467 bytestanc

Comments

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

Edit has this:

  // In-place editing is only supported on the front-end.
  if (path_is_admin(current_path())) {
    return;
  }

I'm betting this is somehow breaking https://api.drupal.org/api/drupal/includes%21path.inc/function/path_is_a.... Can you investigate further?

tanc’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new467 bytes

Hi Wim, I think we need a way of detecting the editing of a node form and bailing out at that point, much as the path_is_admin check is doing. The problem is that in the scenario I outlined a node add/edit page is not considered an admin path and is not picked up by path_is_admin, therefore the edit code attempts to run.

One solution is to check for the TRUE value of #node_edit_form in the $page render array. Its not a very elegant solution, can you think of a better way to determine whether the current page is a node form?

wim leers’s picture

Title: Javascript error when editing node without admin theme » path_is_admin() lies: it considers node/*/edit not an admin route when using Bartik for node/*/edit
Project: Edit » Quick Edit
Version: 7.x-1.x-dev » 7.x-1.1
Priority: Normal » Minor
Status: Active » Fixed
Issue tags: +Drupal wtf

Wow, what a massive bug in D7 core this is! Turns out this was kind of "by design", apparently: #2139341: path_is_admin() is abused by "use_admin_theme". I think it's a major WTF.

I sadly can't think of a better solution than what you have. I took #2, tested it, confirmed it works and added some more documentation.

Thanks!

  • Wim Leers committed c62599f on 7.x-1.x authored by tanc
    Issue #2264607 by tanc: Fixed path_is_admin() lies: it considers node/*/...

Status: Fixed » Closed (fixed)

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