drupal_set_message(t('The page you are editing could not be locked automatically. Please !link to make sure other people cannot accidentally overwrite your changes.',array(
'!link'=>l(t('lock the page'),'nojs/content_lock/'.$nid.'/lock/'.drupal_get_token($nid),array('attributes'=>array('class'=>array('use-ajax')))),
watchdog('content_lock','Attempt to load the node_form form at menu path %path which is not protected from CSRF. Developers who want to create custom node editing pages and protect them with hook_content_lock_path_protected() or use protection_menu_token module to protect this path.',array('%path'=>$menu_item['path']),WATCHDOG_WARNING);
}
}
else{
// Finally set the lock if everything passed.
if(content_lock_node($nid,$user->uid)==FALSE){
// Could not lock node, it's locked by someone else.
drupal_goto($destination);
}
// If we should lock or already have been locked, load the unload js.
// Don't use form alter but rather after build, so it works even for