#127539 by yched: simplify developer docs about the finished value and fix an URL placeholder
parent
9003e7590f
commit
a0caf14052
|
@ -1688,10 +1688,9 @@ function form_clean_id($id = NULL) {
|
|||
* // continues browsing in a separate window while the batch is processing.
|
||||
* // 'finished' (write): A float number between 0 and 1 informing
|
||||
* // the processing engine of the completion level for the operation.
|
||||
* // 1 means the operation is finished and processing can continue
|
||||
* // to the next operation. This value always be 1 if not specified
|
||||
* // by the batch operation (a single-step operation), so that will
|
||||
* // be considered as finished.
|
||||
* // 1 (or no value explicitly set) means the operation is finished
|
||||
* // and the batch processing can continue to the next operation.
|
||||
*
|
||||
* $node = node_load(array('uid' => $uid, 'type' => $type));
|
||||
* $context['results'][] = $node->nid .' : '. $node->title;
|
||||
* $context['message'] = $node->title;
|
||||
|
@ -1854,7 +1853,7 @@ function batch_process($redirect = NULL, $url = NULL) {
|
|||
'url' => isset($url) ? $url : 'batch',
|
||||
'source_page' => $_GET['q'],
|
||||
'redirect' => $redirect,
|
||||
'error_message' => $t('Please continue to <a href="!error_url">the error page</a>', array('!error_url' => url($url, array('query' => array('id' => $batch['id'], 'op' => 'error'))))),
|
||||
'error_message' => $t('Please continue to <a href="@error_url">the error page</a>', array('@error_url' => url($url, array('query' => array('id' => $batch['id'], 'op' => 'error'))))),
|
||||
);
|
||||
$batch += $process_info;
|
||||
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
// $Id$
|
||||
|
||||
if (Drupal.jsEnabled) {
|
||||
$(document).ready(function() {
|
||||
$('#edit-has-js').each(function() { this.value = 1; });
|
||||
$('#progress').each(function () {
|
||||
var holder = this;
|
||||
|
||||
// Success: redirect to the summary.
|
||||
var updateCallback = function (progress, status, pb) {
|
||||
if (progress == 100) {
|
||||
pb.stopMonitoring();
|
||||
window.location = window.location.href.split('op=')[0] +'op=finished';
|
||||
}
|
||||
}
|
||||
|
||||
// Failure: point out error message and provide link to the summary.
|
||||
var errorCallback = function (pb) {
|
||||
var div = document.createElement('p');
|
||||
div.className = 'error';
|
||||
$(div).html('An unrecoverable error has occured. You can find the error message below. It is advised to copy it to the clipboard for reference. Please continue to the <a href="update.php?op=error">update summary</a>');
|
||||
$(holder).prepend(div);
|
||||
$('#wait').hide();
|
||||
}
|
||||
|
||||
var progress = new Drupal.progressBar('updateprogress', updateCallback, "POST", errorCallback);
|
||||
progress.setProgress(-1, 'Starting updates');
|
||||
$(holder).append(progress.element);
|
||||
progress.startMonitoring('update.php?op=do_update', 0);
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue