From bc0a1cf7fecf94a3ff9def5e9ed922927b7e3a2e Mon Sep 17 00:00:00 2001 From: Aryan-R-Patel Date: Mon, 30 Mar 2026 14:23:07 -0400 Subject: [PATCH 1/5] fix: lint codebase --- ableplayer_extend.libraries.yml | 2 +- ableplayer_extend.module | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ableplayer_extend.libraries.yml b/ableplayer_extend.libraries.yml index 1f7a121..e3e87f6 100755 --- a/ableplayer_extend.libraries.yml +++ b/ableplayer_extend.libraries.yml @@ -7,4 +7,4 @@ ableplayer_extend.transcript_position: dependencies: - core/drupal - core/jquery - - core/once \ No newline at end of file + - core/once diff --git a/ableplayer_extend.module b/ableplayer_extend.module index 854c475..ddcdcd1 100755 --- a/ableplayer_extend.module +++ b/ableplayer_extend.module @@ -26,7 +26,8 @@ function ableplayer_extend_help($route_name, RouteMatchInterface $route_match) { /** * Implements hook_field_formatter_third_party_settings_form(). - * Provides additional two config options for Ableplayer + * + * Provides additional two config options for Ableplayer. */ function ableplayer_extend_field_formatter_third_party_settings_form($plugin, $field_definition, $view_mode, $form, $form_state) { @@ -63,7 +64,8 @@ function ableplayer_extend_field_formatter_third_party_settings_form($plugin, $f /** * Implements hook_preprocess_field(). - * Setups the javascript to enable Ableplayer related functions + * + * Setups the javascript to enable Ableplayer related functions. */ function ableplayer_extend_preprocess_field(&$variables) { @@ -83,7 +85,7 @@ function ableplayer_extend_preprocess_field(&$variables) { if (isset($field_display['third_party_settings']['ableplayer_extend'])) { $display_ableplayer_transcript_audio = $field_display['third_party_settings']['ableplayer_extend']['display_ableplayer_transcript_audio']; $show_timestamp_audio = $field_display['third_party_settings']['ableplayer_extend']['show_timestamp_audio']; - + $variables['#attached']['drupalSettings']['display_ableplayer_transcript'] = $display_ableplayer_transcript_audio; $variables['#attached']['drupalSettings']['show_timestamp'] = $show_timestamp_audio; } @@ -102,10 +104,10 @@ function ableplayer_extend_preprocess_field(&$variables) { // Make the setting available in the field template. if (isset($field_display['third_party_settings']['ableplayer_extend'])) { - $display_ableplayer_transcript_video = $field_display['third_party_settings']['ableplayer_extend']['display_ableplayer_transcript_video']; - $show_timestamp_video = $field_display['third_party_settings']['ableplayer_extend']['show_timestamp_video']; - $variables['#attached']['drupalSettings']['display_ableplayer_transcript'] = $display_ableplayer_transcript_video; - $variables['#attached']['drupalSettings']['show_timestamp'] = $show_timestamp_video; + $display_ableplayer_transcript_video = $field_display['third_party_settings']['ableplayer_extend']['display_ableplayer_transcript_video']; + $show_timestamp_video = $field_display['third_party_settings']['ableplayer_extend']['show_timestamp_video']; + $variables['#attached']['drupalSettings']['display_ableplayer_transcript'] = $display_ableplayer_transcript_video; + $variables['#attached']['drupalSettings']['show_timestamp'] = $show_timestamp_video; } $variables['#attached']['library'][] = 'ableplayer_extend/ableplayer_extend.transcript_position'; } From 12819092605d706e4098e5d723f43a8196bf5e9e Mon Sep 17 00:00:00 2001 From: Aryan-R-Patel Date: Mon, 30 Mar 2026 14:24:10 -0400 Subject: [PATCH 2/5] feat: add ci testing workflow --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5a0dd5c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,15 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + islandora-module-ci: + uses: digitalutsc/reusable_workflows/.github/workflows/islandora-module-ci.yml@main + with: + module_name: ableplayer_extend + install_chromedriver: false From d7d8fe8e3960f8b0c9c664faef7195c1c63526fb Mon Sep 17 00:00:00 2001 From: Aryan-R-Patel Date: Wed, 1 Apr 2026 13:09:15 -0400 Subject: [PATCH 3/5] fix: phpunit errors and lint remaining files --- css/ableplayer_transcript.css | 1 - js/ableplayer_transcript_placement.js | 4 ++-- src/Functional/LoadTest.php | 9 ++++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/css/ableplayer_transcript.css b/css/ableplayer_transcript.css index 8130b63..902e364 100644 --- a/css/ableplayer_transcript.css +++ b/css/ableplayer_transcript.css @@ -22,4 +22,3 @@ .able-status-bar { height: 2em !important; } - diff --git a/js/ableplayer_transcript_placement.js b/js/ableplayer_transcript_placement.js index f958170..4376f31 100644 --- a/js/ableplayer_transcript_placement.js +++ b/js/ableplayer_transcript_placement.js @@ -42,8 +42,8 @@ // Start observing observer.observe(document.body, { - childList: true, - subtree: true + childList: TRUE, + subtree: TRUE }); }) diff --git a/src/Functional/LoadTest.php b/src/Functional/LoadTest.php index 80d0738..1428613 100755 --- a/src/Functional/LoadTest.php +++ b/src/Functional/LoadTest.php @@ -4,14 +4,21 @@ use Drupal\Core\Url; use Drupal\Tests\BrowserTestBase; +use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses; /** * Simple test to ensure that main page loads with module enabled. * * @group ableplayer_extend */ +#[RunTestsInSeparateProcesses] class LoadTest extends BrowserTestBase { + /** + * {@inheritdoc} + */ + protected $defaultTheme = 'stark'; + /** * Modules to enable. * @@ -40,7 +47,7 @@ protected function setUp(): void { */ public function testLoad() { $this->drupalGet(Url::fromRoute('')); - $this->assertSession()->responseContains('200'); + $this->assertSession()->statusCodeEquals(200); } } From 4eaae4ee84d6b5560f196db3e9818c447f7a1f89 Mon Sep 17 00:00:00 2001 From: Aryan-R-Patel Date: Wed, 1 Apr 2026 13:11:48 -0400 Subject: [PATCH 4/5] add empty require section to resolve jq error --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0c322d3..63d1ff3 100755 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "support": { "issues": "https://github.com/digitalutsc/ableplayer_extend/issues", "source": "https://github.com/digitalutsc/ableplayer_extend" - } + }, + "require": {} } From 14ff9f5eef8685ca4fbd73f1a2ed1a6fe5fa8337 Mon Sep 17 00:00:00 2001 From: Aryan-R-Patel Date: Wed, 1 Apr 2026 15:12:55 -0400 Subject: [PATCH 5/5] fix: use JS standards and convention for boolean variables --- js/ableplayer_transcript_placement.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ableplayer_transcript_placement.js b/js/ableplayer_transcript_placement.js index 4376f31..f958170 100644 --- a/js/ableplayer_transcript_placement.js +++ b/js/ableplayer_transcript_placement.js @@ -42,8 +42,8 @@ // Start observing observer.observe(document.body, { - childList: TRUE, - subtree: TRUE + childList: true, + subtree: true }); })