Commit 4de53234 authored by Jonathan Smith's avatar Jonathan Smith
Browse files

Issue #3293936 by jonathan1055, narendra.rajwar27, kbriand: PHP8 Compatibility

parent 1bcefc6d
Loading
Loading
Loading
Loading
+4 −0
Changes for drupalci.yml: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,6 +18,10 @@ build:
      phpstan:
        halt-on-fail: false
    testing:
      container_command:
        commands:
          # Rule 3.0-alpha7 is not compatible with PHP8.1 but the dev version has been fixed.
          - "cd ${SOURCE_DIR} && sudo -u www-data composer require drupal/rules:3.x-dev"
      run_tests.functional:
        types: 'PHPUnit-Functional'
        testgroups: '--all'
+2 −2
Changes for scheduler.module: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -340,8 +340,8 @@ function _scheduler_entity_type_form_alter(&$form, FormStateInterface $form_stat
  $contentEntity = \Drupal::entityTypeManager()->getStorage($contentEntityType->id())->create([$contentEntityType->getKey('bundle') => 'scaffold']);

  $params = [
    '@type' => $type->label(),
    '%type' => strtolower($type->label()),
    '@type' => $type->label() ?? '',
    '%type' => strtolower($type->label() ?? ''),
    '@singular' => $contentEntityType->getSingularLabel(),
    '@plural' => $contentEntityType->getPluralLabel(),
  ];
+5 −3
Changes for tests/modules/scheduler_api_test/scheduler_api_legacy_test/scheduler_api_legacy_test.module: 5 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -127,7 +127,8 @@ function scheduler_api_legacy_test_scheduler_allow_unpublishing(NodeInterface $n
 */
function scheduler_api_legacy_test_scheduler_hide_publish_on_field($form, $form_state, $node) {
  // Hide the publish_on field if the node title contains orange or green.
  if (stristr($node->title->value, 'orange legacy') || stristr($node->title->value, 'green legacy')) {
  $title = $node->title->value ?? '';
  if (stristr($title, 'orange legacy') || stristr($title, 'green legacy')) {
    \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The publish_on field is hidden for orange or green node titles.'), 'status', FALSE);
    return TRUE;
  }
@@ -140,8 +141,9 @@ function scheduler_api_legacy_test_scheduler_hide_publish_on_field($form, $form_
 * Implements hook_scheduler_hide_unpublish_on_field().
 */
function scheduler_api_legacy_test_scheduler_hide_unpublish_on_field($form, $form_state, $node) {
  // Hide the publish_on field if the node title contains yellow or green.
  if (stristr($node->title->value, 'yellow legacy') || stristr($node->title->value, 'green legacy')) {
  // Hide the unpublish_on field if the node title contains yellow or green.
  $title = $node->title->value ?? '';
  if (stristr($title, 'yellow legacy') || stristr($title, 'green legacy')) {
    \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The unpublish_on field is hidden for yellow or green node titles.'), 'status', FALSE);
    return TRUE;
  }
+4 −4
Changes for tests/modules/scheduler_api_test/scheduler_api_test.module: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -334,7 +334,7 @@ function scheduler_api_test_scheduler_commerce_product_unpublishing_allowed(Prod
 */
function scheduler_api_test_scheduler_hide_publish_date($form, $form_state, $entity) {
  // Hide the publish_on field if the title contains 'orange {type}'.
  if (stristr($entity->label(), "orange {$entity->getEntityTypeId()}")) {
  if (stristr($entity->label() ?? '', "orange {$entity->getEntityTypeId()}")) {
    \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The publish_on field is hidden for orange.'), 'status', FALSE);
    return TRUE;
  }
@@ -348,7 +348,7 @@ function scheduler_api_test_scheduler_hide_publish_date($form, $form_state, $ent
 */
function _scheduler_api_test_hide_publish_date($form, $form_state, $entity) {
  // Hide the publish_on field if the title contains 'green {type}'.
  if (stristr($entity->label(), "green {$entity->getEntityTypeId()}")) {
  if (stristr($entity->label() ?? '', "green {$entity->getEntityTypeId()}")) {
    \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The publish_on field is hidden for green.'), 'status', FALSE);
    return TRUE;
  }
@@ -394,7 +394,7 @@ function scheduler_api_test_scheduler_taxonomy_term_hide_publish_date($form, $fo
 */
function scheduler_api_test_scheduler_hide_unpublish_date($form, $form_state, $entity) {
  // Hide the unpublish_on field if the title contains 'yellow {type}'.
  if (stristr($entity->label(), "yellow {$entity->getEntityTypeId()}")) {
  if (stristr($entity->label() ?? '', "yellow {$entity->getEntityTypeId()}")) {
    \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The unpublish_on field is hidden for yellow.'), 'status', FALSE);
    return TRUE;
  }
@@ -408,7 +408,7 @@ function scheduler_api_test_scheduler_hide_unpublish_date($form, $form_state, $e
 */
function _scheduler_api_test_hide_unpublish_date($form, $form_state, $entity) {
  // Hide the unpublish_on field if the title contains 'green {type}'.
  if (stristr($entity->label(), "green {$entity->getEntityTypeId()}")) {
  if (stristr($entity->label() ?? '', "green {$entity->getEntityTypeId()}")) {
    \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The unpublish_on field is hidden for green.'), 'status', FALSE);
    return TRUE;
  }