{"id":803,"date":"2006-05-31T19:44:02","date_gmt":"2006-05-31T23:44:02","guid":{"rendered":"http:\/\/wordpress.cephas.net\/?p=803"},"modified":"2006-05-31T19:44:02","modified_gmt":"2006-05-31T23:44:02","slug":"prototype-tinymce-too-much-recursion","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2006\/05\/31\/prototype-tinymce-too-much-recursion\/","title":{"rendered":"Prototype, tinyMCE, &#8216;too much recursion&#8217;"},"content":{"rendered":"<p>If you happen to be using <a href=\"http:\/\/tinymce.moxiecode.com\/\">TinyMCE<\/a> and the <a href=\"http:\/\/prototype.conio.net\/\">Prototype<\/a> library together and you&#8217;re getting a &#8216;too much recursion&#8217; error in FireFox, make sure to upgrade to the latest version of Prototype, which at the time of this post is version 1.5.0.  Near as I can tell, the only way to get version 1.5.0 is to either a) check it out of the <a href=\"http:\/\/dev.rubyonrails.org\/browser\/spinoffs\/prototype\/\">subversion repository<\/a> or b) download <a href=\"http:\/\/script.aculo.us\/\">script.aculo.us<\/a>, which contains version 1.5.0 in the lib directory of the distribution.<\/p>\n<p>I think the &#8216;too much recursion&#8217; Prototype \/ TinyMCE problem happens because Prototype stores a copy of the <a href=\"http:\/\/www.sergiopereira.com\/articles\/prototype.js.html#Reference.Array\">Array reverse function<\/a> in a property called _reverse:<br \/>\n<code><br \/>\nArray.prototype._reverse = Array.prototype.reverse;<br \/>\n<\/code><br \/>\nand then redefines the reverse function, adding a argument &#8216;inline&#8217;:<br \/>\n<code><br \/>\nreverse: function(inline) {<br \/>\n&nbsp;&nbsp;return (inline !== false ? this : this.toArray())._reverse();<br \/>\n}<br \/>\n<\/code><br \/>\nSomehow (and I&#8217;m not sure how this would happen) the copy happens again, which means that _reverse() would point to the redefined reverse() method function, which of course points to _reverse(), which leads to a infinite loop. Hence, &#8216;too much recursion&#8217;.<\/p>\n<p>Regardless, the <a href=\"http:\/\/dev.rubyonrails.org\/svn\/rails\/spinoffs\/prototype\/CHANGELOG\">changelog from latest version of Prototype<\/a> has a pointer to issue #3951 (but it doesn&#8217;t appear that the issues are public): in short, version 1.5.0 of Prototype does a check to make sure that _reverse() hasn&#8217;t been defined:<br \/>\n<code><br \/>\nif (!Array.prototype._reverse)<br \/>\n&nbsp;&nbsp;Array.prototype._reverse = Array.prototype.reverse;<br \/>\n<\/code><br \/>\nIn related news, if you&#8217;re using script.aculo.us with TinyMCE, make sure to <a href=\"http:\/\/www.systemmobile.com\/wp\/?p=184\">embed the script.aculo.us js after the TinyMCE js<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you happen to be using TinyMCE and the Prototype library together and you&#8217;re getting a &#8216;too much recursion&#8217; error in FireFox, make sure to upgrade to the latest version of Prototype, which at the time of this post is version 1.5.0. Near as I can tell, the only way to get version 1.5.0 is &hellip; <a href=\"https:\/\/cephas.net\/blog\/2006\/05\/31\/prototype-tinymce-too-much-recursion\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Prototype, tinyMCE, &#8216;too much recursion&#8217;<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[29,2],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/803"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=803"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/803\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}