Closed (fixed)
Project:
Edit
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Issue tags:
Reporter:
Created:
8 Jan 2014 at 23:58 UTC
Updated:
7 Apr 2014 at 14:03 UTC
Jump to comment: Most recent
In my logs I get the following error:
TypeError: entityElement.get(...) is undefined
http://demo/sites/all/modules/core/contrib-oa-sng-1/edit/js/edit.js?v=7.25
Line 222
the line at 222 is ".get(0)"
if (entityElement.length === 0) {
entityElement = $('.region-content').find(entityElementSelector);
}
var entityInstanceID = entityElement
.get(0)
.getAttribute('data-edit-entity-instance-id');
I placed this code from the readme in oa_radix template.php file:
/*
* Edit module fix
* https://drupal.org/comment/8310093#comment-8310093
* function exampletheme_preprocess_region(&$variables, $hook)
*/
function oa_radix_preprocess_region(&$variables, $hook) {
// Don't use Zen's region--no-wrapper.tpl.php template
// @see https://drupal.org/node/1728134
if (strpos($variables['region'], 'content') === 0) {
$variables['theme_hook_suggestions'] = array_diff($variables['theme_hook_suggestions'], array('region__no_wrapper'));
}
}
Comments
Comment #1
socialnicheguru commentedfixed formatting
Comment #2
wim leersSo the "content" region (with a
class="region-content"piece of HTML) does show up? Edit's Status Report doesn't complain?Comment #3
socialnicheguru commentedregion-content is defined in system/stylesheet/screen.css
but the class value,'class="region-content"', is not given in node.tpl.php or panels.tpl.php.
on the article content type that is not panelized, the edit in the contextual link goes to the regular node edit page not the in place editing.
Comment #4
wim leersD'oh, I didn't see this reply! Please mark an issue back as active once you've replied, otherwise I won't see it :)
This is not at all related to CSS. Please check your status report, and look at the resulting HTML, not the actual templates.
Comment #5
wim leersComment #6
socialnicheguru commentedThanks. here is what is part of source:
Comment #7
wim leersI'm afraid d.o stripped it out. You'll have to wrap it in
<code>tags!Comment #8
socialnicheguru commentedand for the main area further down I see:
Comment #9
socialnicheguru commentedI applied the fix ie. adding the suggestion to the template.php file.
I have this now but I still get the error:
OK
Edit: Backbone library Exists & compatible
OK
Edit: CKEditor library Exists, compatible and correct location
OK
Edit: CKEditor's "Shared Space" plugin is included Included
OK
Edit: Underscore library Exists & compatible
OK
Edit: theme compatibility The theme appears compatible
Comment #10
socialnicheguru commentedComment #11
wim leers#8: so you have *two*
.region-contentDOM nodes! That's not possible, unless you manually added that class to one of the two yourself. I bet you set it manually on the<body>tag, because it should not appear on that one.#9: I don't see any error in there? :)
Comment #12
wim leersGreat news for you: I just committed #2178103: Stop requiring a content region wrapper + "region-content" class for maximum theme compatibility, which changes Edit to no longer require the content region wrapper to exist! Therefor, you can upgrade to the latest dev snapshot of Edit, or RC2 (I'll release RC2 later today probably), undo your changes to your theme, and not have to worry about this again :)
Comment #14
goudal commentedI have downloaded the 7.1.0 version and I still have the bug on get(0)
I have added a test to return when entityElement.get(0) is not defined and it works... but.. dirty workaround.