November Happy Hour will be moved to Thursday December 5th.

JS Exception in pagetreeview.js 6R2 ()

Vote:
 

I'm seeing an exception generated in pagetreeview.js when expanding a node with ~ 1000 child nodes in the EpiServer Edit interface

The line that generates the exception is the eval() statement at 895 (surrounding lines for context) in the snippet below

 

// Parse and execute script properties for the new nodes.
if (scriptContainer) {
    scriptBlock = eval(scriptContainer.innerHTML);
    if (typeof (scriptBlock) == "function") {
        scriptBlock();
    }
}

 

Inspecting the value of scriptContainer.HTML in Chrome reveals what looks like code to bind click events to the newly expanded nodes; around 1000 assignments in JS, whitespace, indents and CRs included.

The error generated depends on the browser: Chrome yields "Unexpected token ILLEGAL" whereas Firefox yields "Unterminated string constant" at the point of eval()

I've checked the text that's being offered for evaluation seperately, and there is no error in balancing / escaping quotation marks or braces etc, i.e. it is ostensibly legal (if verbose) JS.

 

Evaluating standalone in a test HTML harness has mixed results; with the string as-is - formatting and all - I get the same error. If I first remove the indentation and formatting, so that all 1000 or so lines are a single line, the eval() succeeds.

The end effect is that newly expanded nodes cannot be edited through this route.

Is there a newer version of pagetreeview.js / EpiServer fix that solves this problem?

 

 

 
 
#61096
Sep 06, 2012 19:48
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.