Commit 1998d94b authored by Balint Pekker's avatar Balint Pekker Committed by Jakob P
Browse files

Issue #3296712 by Project Update Bot, balintpekker: Automated Drupal 10 compatibility fixes

parent 5f32a34f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -97,8 +97,7 @@ function captcha_point_load($id) {
 * Implements hook_theme().
 */
function captcha_theme() {
  // @phpstan-ignore-next-line
  $path = Drupal::hasService('extension.list.module') ? Drupal::service('extension.list.module')->getPath('captcha') : drupal_get_path('module', 'captcha');
  $path = \Drupal::service('extension.list.module')->getPath('captcha');
  return [
    'captcha' => [
      'render element' => 'element',
+1 −2
Original line number Diff line number Diff line
@@ -36,8 +36,7 @@ function image_captcha_requirements($phase) {
 */
function image_captcha_install() {
  $config = \Drupal::configFactory()->getEditable('image_captcha.settings');
  // @phpstan-ignore-next-line
  $module_path = Drupal::hasService('extension.list.module') ? \Drupal::service('extension.list.module')->getPath('image_captcha') : drupal_get_path('module', 'image_captcha');
  $module_path = \Drupal::service('extension.list.module')->getPath('image_captcha');
  $config->set('image_captcha_fonts', [
    hash('sha256', $module_path . '/fonts/Tesox/tesox.ttf'),
    hash('sha256', $module_path . '/fonts/Tuffy/Tuffy.ttf'),
+1 −2
Original line number Diff line number Diff line
@@ -84,8 +84,7 @@ function _image_captcha_get_available_fonts_from_directories($directories = NULL
  if ($directories === NULL) {
    $request = \Drupal::service('request_stack')->getCurrentRequest();
    $directories = [
      // @phpstan-ignore-next-line
      (Drupal::hasService('extension.list.module') ? \Drupal::service('extension.list.module')->getPath('image_captcha') : drupal_get_path('module', 'image_captcha')) . '/fonts',
      \Drupal::service('extension.list.module')->getPath('image_captcha') . '/fonts',
      'sites/all/libraries/fonts',
      DrupalKernel::findSitePath($request) . '/libraries/fonts',
    ];
+1 −2
Original line number Diff line number Diff line
@@ -43,8 +43,7 @@ class MigrateCaptchaPointsTest extends MigrateDrupal7TestBase {
    parent::setUp();
    $this->loadFixture(implode(DIRECTORY_SEPARATOR, [
      DRUPAL_ROOT,
      // @phpstan-ignore-next-line
      \Drupal::hasService('extension.list.module') ? \Drupal::service('extension.list.module')->getPath('captcha') : drupal_get_path('module', 'captcha'),
      \Drupal::service('extension.list.module')->getPath('captcha'),
      'tests',
      'fixtures',
      'drupal7.php',
+1 −2
Original line number Diff line number Diff line
@@ -43,8 +43,7 @@ class MigrateCaptchaSimpleConfigurationTest extends MigrateDrupal7TestBase {
    parent::setUp();
    $this->loadFixture(implode(DIRECTORY_SEPARATOR, [
      DRUPAL_ROOT,
      // @phpstan-ignore-next-line
      \Drupal::hasService('extension.list.module') ? \Drupal::service('extension.list.module')->getPath('captcha') : drupal_get_path('module', 'captcha'),
      \Drupal::service('extension.list.module')->getPath('captcha'),
      'tests',
      'fixtures',
      'drupal7.php',
Loading