Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13562 closed Bug (invalid)

TypeError: Cannot read property equals of undefined in combination with crVCL

Reported by: Richie Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Hello,

I like to use the CKEditor in combination with crVCL PHP Framework. If I also load the framework I get the following error in ckeditor.js at function getEditor:function():

TypeError: Cannot read property equals of undefined

I tried to debug and solve it self, but I'm not finding the problem :-(

My Test-Script contain only this few lines:

<!DOCTYPE html>
<html>
<head>
<title>Test CKEditor</title>
</script>
<script type="text/javascript" src="http://mydomain/cache/fwtools.inc.1433776457.a109ac8026fc449c2ca9c305451254f4.cache.js.php"></script>
<script src="http://mydomain/crvcl/external/ckeditor/ckeditor.js" type="text/javascript"></script>
</head>

<body style="" class="" onLoad="fw_doc_init(); fw_loadingtime_css_js_ms = (new Date()).valueOf() - fw_start_tick.valueOf();" onUnload="if(fw_DebugWin && fw_DebugWin !== null && (typeof fw_DebugWin) == 'object' && fw_DebugWin.closed == false){fw_DebugWin.close();} " onMouseMove="fw_getMousePos(event);" onKeyPress="fw_setKeyCode(event);">
<!-- crVCL PHP Framework Version 2.7 beta (http://www.cr-solutions.net) -->
<div id="fw_Tooltip" style="background-color:#FFFFCC;padding:5px;width:150px;position:absolute;left:0;top:0;visibility:hidden;z-index:9999;border-width:1px;border-style:solid;" ><div id="fw_Tooltip_Spacer">&nbsp;</div></div><div id="fw_IText" style="border-color:#F4F4F4;border-left-width:2px;border-right-width:2px;border-top-width:0px;border-bottom-width:0px;border-style:solid;width:150px;position:absolute;left:0;top:0;visibility:hidden;z-index:9998;" onmouseout="this.style.backgroundColor = '';" onmouseover="this.style.backgroundColor = '#FFFFCC';"><div id="fw_IText_Caption" style="background-color:#FFFFCC;">&nbsp;</div></div><script type="text/javascript">rounded("div#fw_IText","","#F4F4F4", "small");</script><input id="fwPageLoaded" name="fwPageLoaded" type="hidden" value="false">

<form name="Form" id="Form" action="http://mydomain/test/test.php" method="post" target="" onSubmit="">
<textarea id="CKEdit" name="CKEdit" style="width:100px;height:100px;">
</textarea>
<script type="text/javascript">CKEDITOR.replace('CKEdit');</script>
</form>
<!-- crVCL PHP Framework Version 2.7 beta (http://www.cr-solutions.net) -->
<script type="text/javascript">window.setTimeout("fw_isPageLoaded(true)", 900);</script>
</body>
</html>

Change History (6)

comment:1 Changed 4 years ago by Richie

I debuged it with Chrome and find out that the following property "c.element" of the line

if(c.element.equals(this)&&c.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO)return c}

is undefined.

comment:2 Changed 4 years ago by Richie

Now I found something.

"crVCL" implements a own function "getName"

Object.prototype.getName = function() {
    if (this && this.constructor && this.constructor.toString) {
        var arr = this.constructor.toString().match(
            /function\s*(\w+)/);

        if (arr && arr.length == 2) {
            return arr[1];
        }
    }
    return undefined;
};

If I comment or remove this function from "crVCL" it CKEditor works fine. How to solve both works?

Last edited 4 years ago by Richie (previous) (diff)

comment:3 Changed 4 years ago by Jakub Ś

Resolution: invalid
Status: newclosed
Version: 4.5.1

Drop crVCL? I'm sorry but this is really a bad practice and they should not be doing this. The only thing I can recommend is reporting them a bug.

Closing the ticket as this is not the editor issue.

comment:4 in reply to:  3 Changed 4 years ago by Richie

Replying to j.swiderski:

Drop crVCL? I'm sorry but this is really a bad practice and they should not be doing this. The only thing I can recommend is reporting them a bug.

Closing the ticket as this is not the editor issue.

Hello,

why this is a bad practice, ckeditor use also Object Prototyping?

comment:5 Changed 4 years ago by Jakub Ś

Yes we do use prototyping but not with the {Object.prototype. We don't assign functions to global object prototype.

The reason why this is a bad practice is because such function may conflict with some other function from different library (what you are seeing here).

comment:6 in reply to:  5 Changed 4 years ago by Richie

Replying to j.swiderski:

Yes we do use prototyping but not with the {Object.prototype. We don't assign functions to global object prototype.

The reason why this is a bad practice is because such function may conflict with some other function from different library (what you are seeing here).

Thanks for your support and have a nice week.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy