Skip to content
Snippets Groups Projects
Commit 009a7aca authored by Thomas Robey's avatar Thomas Robey Committed by Thomas Robey
Browse files

Issue #3286205 by trobey: Automated Drupal 10 compatibility fixes

parent 5870ab2a
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,6 @@ type: module
description: Batch job functionality
package: Other
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9 || ^10
dependencies:
- jquery_ui_progressbar:jquery_ui_progressbar
......@@ -6,9 +6,9 @@ batch_jobs:
js:
js/batch_jobs.js: {}
dependencies:
- core/jquery
- core/jquery.once
- core/drupal
- core/jquery
- core/once
- core/drupal.form
- core/drupalSettings
- jquery_ui_progressbar/progressbar
......@@ -3,6 +3,6 @@ type: module
description: Example for using Batch Jobs
package: examples
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9 || ^10
dependencies:
- batch_jobs:batch_jobs
......@@ -7,7 +7,7 @@
'use strict';
Drupal.behaviors.batch_jobs = {
attach: function (context, settings) {
$('div.batch').once('batch').each(function() {
$(once('batch', 'div.batch', context)).each(function() {
var batch = $('div.batch').attr('class');
if (typeof batch !== 'undefined') {
batch = batch.split(' ');
......
......@@ -91,7 +91,7 @@ class BatchJobsJobs extends FormBase {
$job = new Job($batch_job->bid);
$token = $job->getToken($job->bid);
$form['jobs'][$job->bid]['title'] = [
'#markup' => $this->link($job->title, '/batch-jobs/' . $job->bid),
'#markup' => $this->toLink($job->title, '/batch-jobs/' . $job->bid)->toString(),
];
$form['jobs'][$job->bid]['user'] = [
'#markup' => $job->getUser(),
......
......@@ -24,7 +24,7 @@ class BatchJobsTest extends BrowserTestBase {
*
* @var array
*/
public static $modules = ['node', 'batch_jobs', 'batch_jobs_example'];
protected static $modules = ['node', 'batch_jobs', 'batch_jobs_example'];
/**
* Batch Jobs test.
......@@ -36,19 +36,19 @@ class BatchJobsTest extends BrowserTestBase {
// Create batch job.
$batch = batch_jobs_example_create_job(10);
$this->drupalGet('admin/reports/batch-jobs');
$this->assertText('Create nodes');
$this->assertRaw('value="Run"');
$this->assertSession()->pageTextContains('Create node');
$this->assertSession()->responseContains('value="run"');
// Run batch job.
$this->runBatchJobs($batch->bid);
$this->drupalGet('admin/reports/batch-jobs');
$this->assertRaw('value="Run finish tasks"');
$this->assertSession()->responseContains('value="Run finish tasks"');
// Run finish task.
$job = new Job($batch->bid);
$job->finish();
$this->drupalGet('admin/reports/batch-jobs');
$this->assertText('Completed');
$this->assertSession()->pageTextContains('Completed');
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment