The javascript to allow the forum to be collapsed has a call to an ajax page which is creating an error because of a call to an incorrect function.
function advanced_form_ajax($op, $container_id = NULL) {
global $base_url;
$base_url = str_replace('.', '_', $base_url);
switch($op) {
case 'load':
if(!isset($_COOKIE[$base_url.'_advanced_forum'])) {
//Set defaults in the cookie.
$defaults = variable_get('advanced_forum_collapse_defaults', array());
setcookie($base_url.'_advanced_forum[tids]', serialize($initial_state), time()+60*60*24*30, '/');
}
else {
$initial_state = unserialize($_COOKIE[$base_url.'_advanced_forum']['tids']);
}
print drupal_to_js(array('tids' => $initial_state));// orginal call was to drupal_json
break;
case 'toggle':
if(!$container_id)
exit;
if(!isset($_COOKIE[$base_url.'_advanced_forum'])) {
$defaults = variable_get('advanced_forum_collapse_defaults', array());
}
else {
$initial_state = unserialize($_COOKIE[$base_url.'_advanced_forum']['tids']);
}
$initial_state[$container_id] = 1 - $initial_state[$container_id];
setcookie($base_url.'_advanced_forum[tids]', serialize($initial_state), time()+60*60*24*30, '/');
break;
}
}
The drupal_json call is not available in drupal-5.x but the drupal_to_js is, which seems to have eliminated the javascript error, and allow normal operation.
Comments
Comment #1
michelleThanks for the patch, but I need a full solution before I'm willing to put that code back in.
#291084: Collapsible forum containers
Michelle