Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Double page reading afterg the class change


Reply

2 Posts   1296 Views

Avatar
xmedeko

4 July 2007 at 2:01pm (Last edited: 4 July 2007 2:01pm), Community Member, 94 Posts

Hi,

when I change the class in the Behaviour tab and save the page, then there's twice:

FormResponse::add("$('Form_EditForm').getPageFromServer($record->ID);");
FormResponse::add("$('Form_EditForm').getPageFromServer($record->ID);");

in the response. So the page is read twice from the server. I have comented the first one in the LeftAndMain.php:

// Update the icon if the class has changed
if($originalClass != $record->ClassName) {
$record->setClassName( $record->ClassName );
$newClass = $record->ClassName;
$record = $record->newClassInstance( $newClass );

FormResponse::add("if(\$('sitetree').setNodeIcon) \$('sitetree').setNodeIcon($record->ID, '$originalClass', '$record->ClassName');");
// fixed double reading //FormResponse::add("$('Form_EditForm').getPageFromServer($record->ID);");
}

// HACK: This should be turned into somethign more general
if( ($record->class == 'VirtualPage' && $originalURLSegment != $record->URLSegment) ||
($originalClass != $record->ClassName) || self::$ForceReload == true) {
FormResponse::add("$('Form_EditForm').getPageFromServer($record->ID);");
}

Avatar
Andy

9 July 2007 at 12:52pm 230 Posts

Good spotting, thanks! :)