Linktocontent popup intermittently hangs and crashes MSIE6

ShutterFreak - July 26, 2007 - 09:48
Project:Link to content
Version:5.x-1.5
Component:Code: Javascript
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

When clicking the linktocontent button in TinyMCE, sometimes the linktocontent popup shows empty with a hourglass cursor (forever). When this happens, I always get a MSIE crash (!) when closing the popup window. I am using MSIE6.

Hitting "Esc" (abort) or "F5" (reload) in the popup window doesn't help.

Is it possible that an AJAX call was initiated too early?

#1

ShutterFreak - July 27, 2007 - 12:19

For what it's worth, I have see PHP errors linked to the use of the Linktocontent module. Instead of crashing the browser, the popup window shows little or no content, and then the category browser hangs (or shows no content). Here's a typical error message:

Referrer: http://mysite.mydomain/modules/tinymce/tinymce/jscripts/tiny_mce/plugins...
Message: Invalid argument supplied for foreach() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\modules\linktocontent\linktocontent.module on line 172.

I get errors at line 163 and 172: both contain a foreach() in linktocontent_get_data().

Could this be related to the intermittent browser crashes I reported?

#2

ShutterFreak - August 7, 2007 - 13:13

Another error I found today generated a MSIE popup window with the following message:

Error on retrieving data from module.
TypeError
Object doesn't support the property or method

When clicking "OK" in this dialog, the "browse documents" pull-down menu is not populated. When looking at the PHP error log from Apache, I found the following 2 lines:

[07-Aug-2007 15:10:00] PHP Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of views_handler_filter_like(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\modules\og\og_views.inc on line 318
[07-Aug-2007 15:10:00] PHP Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of views_handler_filter_like(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\modules\og\og_views.inc on line 1181

Hoping this will help in identifying the cause of those crashes.

#3

stBorchert - August 7, 2007 - 17:30

Hi.
Sorry for responding so late but I'm currently writing my final thesis.

The php-error seems to be a result of a failed call of "linktocontent_validate_args()".
Could you please try to modify linktocontent.module as follows and try again:

<?php
function linktocontent_get_data() {
 
$plugins = linktocontent_validate_args();
 
error_log(var_export($plugins, 1));  // <-- print the array to your error-log
 
if (!is_array($plugins)) {
    print
drupal_to_js(array('message' => $plugins));
    return; 
// <-- exit function on error
 
}

 
// Sort plugins by weight.
 
$weights = variable_get('linktocontent_plugin_weight', array());
?>

The last warnings are in og_views.inc and not mine ;-) but they shouldn't cause any problems.

#4

ShutterFreak - August 8, 2007 - 11:37

Thank you for your reply, Stefan.

I applied your patch, and will monitor the PHP error log.

The MSIE crash however doesn't seem to have been fixed (I just crashed it again).

Good luck with your thesis!

#5

ShutterFreak - August 8, 2007 - 11:43

Apologies for the noise. Here's the output from that debug statement in the PHP error log:

array (
  'linktocontent_node' => 'linktocontent_node',
)

#6

stBorchert - August 8, 2007 - 14:04

Hi.
Well, the output looks good (assuming you only have linktocontent_node enabled).
Hm. Did you try the latest version (5.x-1.6)? The changes aren't really noticeable but perhaps it helps.

greetings,

Stefan

#7

ShutterFreak - August 8, 2007 - 16:54

Hi Stefan,

I reviewed the changes between version 5.x-1.5 and 5.x-1.6, then installed 5.x-1.6 and added again the "exit;" statement in linktocontent_get_data().

When I create a page and add links with linktocontent (linktonode), the crashes now seem to have disappeared. I now only get intermittent JavaScript errors:

Error on retrieving data from module.
TypeError
Object doesn't support the property or method

The JavaScript error console refers to modules/tinymce/tinymce/jscripts/tiny_mce/plugins/linktonode/popup.php, line 272, char 1.

#8

stBorchert - February 28, 2008 - 22:46
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.