Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: SocialNicheGuru commentedand for the main area further down I see:
Comment #9
SocialNicheGuru CreditAttribution: 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 CreditAttribution: SocialNicheGuru commentedComment #11
Wim Leers#8: so you have *two*
.region-content
DOM 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 CreditAttribution: 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.