When my editors are opening “slide out” windows to edit some simple text-properties, the fields appears grayed out and an error is thrown in the browser console. It seesm to be thrown from the umbraco-backoffice angular files:
Hmm, seems it’s trying to get the classList() of an object that is undefined. Maybe you can click then link in the console and see in the javascript (debug it even), and from there figure out exactly which object it’s trying to find? I guess that would be my first step anyways
everything is from internal umbraco backoffice javascripts, like umbraco.directies and so on. it doesn’t really help me at the moment
Hmm. Well I can’t say I’ve encountered this myself. I just thought that maybe debugging the javascript in devtools could give a hint about what it’s looking for.
If you change the property and have it in inline editing mode, does that give the same error?
Is this a new site? I’m guessing since you have content there already, this is something new that has occured. Maybe retracing your steps could help.
Or you could start removing properties see what happens (just take a DB backup first I guess :P). I’d start with removing the radiobutton property, see if it works then.
I think this is the way to go. I doubt it has something specific to do with the ‘classList’, I think it’s just the first property that is being read of an object that is undefined. I’ve seen this error myself as well, but not sure what the solution was…I think it differs.
This is the function, from umbraco.directives.js that’s throwing errors:
function setElementFocus() {
var lastKnownElement, defaultFocusedElement = function getAutoFocusElement(elements) {
var elmentWithAutoFocus = null;
return elements.forEach(element => {
"true" === element.getAttribute("umb-auto-focus") && (elmentWithAutoFocus = element)
}
),
elmentWithAutoFocus
}(focusableElements);
if (closingEditor) {
if (infiniteEditors && 1 === infiniteEditors.length) {
var editorInfo = infiniteEditors[0].querySelector(".editor-info");
infiniteEditors && 1 === infiniteEditors.length && null !== editorInfo && (lastKnownElement = editorInfo,
clearLastKnownFocusedElements())
} else {
var lastItemIndex = $rootScope.lastKnownFocusableElements.length - 1;
lastKnownElement = $rootScope.lastKnownFocusableElements[lastItemIndex],
$rootScope.lastKnownFocusableElements.splice(lastItemIndex, 1)
}
closingEditor = !1
}
lastKnownElement ? lastKnownElement.focus() : null === defaultFocusedElement ? 0 === focusableElements.findIndex(elm => elm.classList.contains("umb-button-ellipsis") || elm.classList.contains("umb-sub-views-nav-item__action") || elm.classList.contains("umb-tab-button") && !elm.parent.classList.contains("umb-tab")) ? focusableElements[1].focus() : firstFocusableElement.focus() : defaultFocusedElement.focus()
}(),
target.addEventListener("keydown", handleKeydown))
}
, 500)
the lastKnownElement variable is undefined, which causes the issue i’ve no idea how to fix this though
very annoying, it’s a large site and the client wants to go live tommorow. i don’t really know what’s causing this and since the error is thrown in internal umbraco.directives javascript i don’t know how to solve it.
it’s not a solution for me to just remove these fields all together.
Are you on Umbraco 13.7.2? Just making sure you are on the latest version Are all NuGet packages up to date?
i’m on Umbraco version 13.3.0
Not saying it’s causes by that specific version and it should ofcourse work, but I really think you should upgrade to the latest minor first. It has no breaking changes and should really be nothing more than updating the NuGet packages.
It also fixes a number of vulnerabilities.
I’ll try that!
Hmm, where is it trying to use lastKnownElement? Because it looks like it should be checking this, and setElementFocus should only be something if you have another “infiniteEditor” (the one that comes in from the side) open already, under it. So I think that part is correct.
But then it comes to the if-clauses where it’s trying to use .classList
Can you try and debug this and see if you can find what’s actually in “focusableElements”? The problemis that whatever is in “focusableElement” isn’t something that you can use classList() on…
Just my gut feeling, but maybe it has something to do with the tabs… Something you could just try, is move the properties away from the tab “Content”, and just have them directly on the page. Just see if that changes something. I know I’m grasping at straws here, but atleast it’s something to try…
If the upgrade doesn’t fix the problem that is…
i did an upgrade but my problem remains, i’ll try and see if moving the tabs around and the other thing you suggested helps.
It’s just so very weird
It really is weird, I agree.
Maybe you could try creating a new element type, new property, new page etc to see if it persists.
If it does, you really should file it as a bug to Umbraco. Otherwise something must be off in your data.
I did attempt to create a new tab and put some of the properties on that tab. but the issue remains. I’ll see if I can add a completely new document type and see if my issue persists.
I don’t even know how to report this as a bug to Umbraco, really
Hehe I understand. The best you can do now is try to isolate the problem and see if you can get to a point where you can reproduce the issue.
Somthing that came to mind right now; did you have an existing property that you changed the data editor for? For instance if you have a property called ‘property-a’ which is a content picker and change it to a block list later? This can sometimes cause issues that look like yours.
If I add a new block of the same type, but have it be inline. I can edit all the fields and they are never greyed out:
However, if I change the existing block to be inline, my javascript errors dissapear, but they are till grayed out, appears as readonly almost:
I notice one of your fields was varying by culture (Customer type) - I have a vague recollection of culture variants leading to some problems, possibly when variants were added after content was already created. Any change you can disable culture variations for a bit and see if that helps?
That sadly did nothing either
I’m so lost, and now I have my client breathing down my neck for a solution.