Loading scheduler.module +3 −3 Original line number Diff line number Diff line Loading @@ -1193,7 +1193,7 @@ function scheduler_migrate_prepare_row(Row $row, MigrateSourceInterface $source, ); // Two third-party-settings have changed name and value, so convert these. if ($config_name == 'use_vertical_tabs') { if (unserialize($setting->value) == 1) { if (unserialize($setting->value, ['allowed_classes' => FALSE]) == 1) { $third_party_settings['fields_display_mode'] = 'vertical_tab'; } else { Loading @@ -1201,7 +1201,7 @@ function scheduler_migrate_prepare_row(Row $row, MigrateSourceInterface $source, } } elseif ($config_name == 'expand_fieldset') { if (unserialize($setting->value) == 1) { if (unserialize($setting->value, ['allowed_classes' => FALSE]) == 1) { $third_party_settings['expand_fieldset'] = 'always'; } else { Loading @@ -1210,7 +1210,7 @@ function scheduler_migrate_prepare_row(Row $row, MigrateSourceInterface $source, } else { // The remaining eight settings are exactly the same as in Drupal 7. $third_party_settings[$config_name] = unserialize($setting->value); $third_party_settings[$config_name] = unserialize($setting->value, ['allowed_classes' => FALSE]); } } $row->setSourceProperty('scheduler_third_party_settings', $third_party_settings); Loading scheduler.tokens.inc +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ function scheduler_token_info() { function scheduler_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { $token_service = \Drupal::token(); $date_formatter = \Drupal::service('date.formatter'); $language_code = isset($options['langcode']) ? $options['langcode'] : NULL; $language_code = $options['langcode'] ?? NULL; $replacements = []; $plugin_types = \Drupal::service('scheduler.manager')->getPluginEntityTypes(); Loading scheduler_rules_integration/tests/src/Functional/SchedulerRulesEventsTest.php +2 −13 Original line number Diff line number Diff line Loading @@ -68,28 +68,17 @@ class SchedulerRulesEventsTest extends SchedulerBrowserTestBase { 24 => ['scheduler:taxonomy_term_has_been_unpublished_via_cron', 'Scheduler has unpublished this taxonomy term during cron.'], ]; // PHPCS throws a false-positive 'variable $var is undefined' message when // the variable is defined by list( ) syntax. To avoid the unwanted warnings // we can put phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis // before each line that produces a warning of this type. // This has been fixed in Coder 8.3.10 which is used in Core 9.1. // @see https://www.drupal.org/project/coder/issues/2876245 // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis foreach ($rule_data as $i => list($event_name, $description)) { // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis $rule = []; foreach ($rule_data as $i => [$event_name, $description]) { $rule[$i] = $this->expressionManager->createRule(); // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis $this->message[$i] = 'RULES message ' . $i . '. ' . $description; // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis $rule[$i]->addAction('rules_system_message', ContextConfig::create() ->setValue('message', $this->message[$i]) ->setValue('type', 'status') ); $config_entity = $this->rulesStorage->create([ 'id' => 'rule' . $i, // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis 'events' => [['event_name' => $event_name]], // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis 'expression' => $rule[$i]->getConfiguration(), ]); $config_entity->save(); Loading tests/modules/scheduler_api_test/scheduler_api_test.module +28 −28 Original line number Diff line number Diff line Loading @@ -211,7 +211,7 @@ function scheduler_api_test_scheduler_publishing_allowed(EntityInterface $entity /** * Generic function to check if the entity is allowed to be published. */ function _api_publishing_allowed(EntityInterface $entity) { function _scheduler_api_test_publishing_allowed(EntityInterface $entity) { // If there is no 'Approved for Publishing' field or we are not dealing with // an entity designed for this test then allow publishing. if (!isset($entity->field_approved_publishing) || !stristr($entity->label(), "blue {$entity->getEntityTypeId()}")) { Loading Loading @@ -246,7 +246,7 @@ function _api_publishing_allowed(EntityInterface $entity) { */ function scheduler_api_test_scheduler_node_publishing_allowed(NodeInterface $node) { // Use the generic publishing_allowed helper function. return _api_publishing_allowed($node); return _scheduler_api_test_publishing_allowed($node); } /** Loading @@ -254,7 +254,7 @@ function scheduler_api_test_scheduler_node_publishing_allowed(NodeInterface $nod */ function scheduler_api_test_scheduler_media_publishing_allowed(MediaInterface $media) { // Use the generic publishing_allowed helper function. return _api_publishing_allowed($media); return _scheduler_api_test_publishing_allowed($media); } /** Loading @@ -262,7 +262,7 @@ function scheduler_api_test_scheduler_media_publishing_allowed(MediaInterface $m */ function scheduler_api_test_scheduler_commerce_product_publishing_allowed(ProductInterface $product) { // Use the generic publishing_allowed helper function. return _api_publishing_allowed($product); return _scheduler_api_test_publishing_allowed($product); } /** Loading @@ -275,7 +275,7 @@ function scheduler_api_test_scheduler_unpublishing_allowed(EntityInterface $enti /** * Generic function to check if the entity is allowed to be unpublished. */ function _api_unpublishing_allowed(EntityInterface $entity) { function _scheduler_api_test_unpublishing_allowed(EntityInterface $entity) { // If there is no 'Approved for Unpublishing' field or we are not dealing with // an entity designed for this test then allow unpublishing. if (!isset($entity->field_approved_unpublishing) || !stristr($entity->label(), "red {$entity->getEntityTypeId()}")) { Loading Loading @@ -310,7 +310,7 @@ function _api_unpublishing_allowed(EntityInterface $entity) { */ function scheduler_api_test_scheduler_node_unpublishing_allowed(NodeInterface $node) { // Use the generic unpublishing_allowed helper function. return _api_unpublishing_allowed($node); return _scheduler_api_test_unpublishing_allowed($node); } /** Loading @@ -318,7 +318,7 @@ function scheduler_api_test_scheduler_node_unpublishing_allowed(NodeInterface $n */ function scheduler_api_test_scheduler_media_unpublishing_allowed(MediaInterface $media) { // Use the generic unpublishing_allowed helper function. return _api_unpublishing_allowed($media); return _scheduler_api_test_unpublishing_allowed($media); } /** Loading @@ -326,7 +326,7 @@ function scheduler_api_test_scheduler_media_unpublishing_allowed(MediaInterface */ function scheduler_api_test_scheduler_commerce_product_unpublishing_allowed(ProductInterface $product) { // Use the generic unpublishing_allowed helper function. return _api_unpublishing_allowed($product); return _scheduler_api_test_unpublishing_allowed($product); } /** Loading @@ -346,7 +346,7 @@ function scheduler_api_test_scheduler_hide_publish_date($form, $form_state, $ent /** * Generic function to hide the publish_on date field. */ function _api_hide_publish_date($form, $form_state, $entity) { 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()}")) { \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The publish_on field is hidden for green.'), 'status', FALSE); Loading @@ -362,7 +362,7 @@ function _api_hide_publish_date($form, $form_state, $entity) { */ function scheduler_api_test_scheduler_node_hide_publish_date($form, $form_state, $entity) { // Use the generic hide_publish_date helper function. return _api_hide_publish_date($form, $form_state, $entity); return _scheduler_api_test_hide_publish_date($form, $form_state, $entity); } /** Loading @@ -370,7 +370,7 @@ function scheduler_api_test_scheduler_node_hide_publish_date($form, $form_state, */ function scheduler_api_test_scheduler_media_hide_publish_date($form, $form_state, $entity) { // Use the generic hide_publish_date helper function. return _api_hide_publish_date($form, $form_state, $entity); return _scheduler_api_test_hide_publish_date($form, $form_state, $entity); } /** Loading @@ -378,7 +378,7 @@ function scheduler_api_test_scheduler_media_hide_publish_date($form, $form_state */ function scheduler_api_test_scheduler_commerce_product_hide_publish_date($form, $form_state, $entity) { // Use the generic hide_publish_date helper function. return _api_hide_publish_date($form, $form_state, $entity); return _scheduler_api_test_hide_publish_date($form, $form_state, $entity); } /** Loading @@ -386,7 +386,7 @@ function scheduler_api_test_scheduler_commerce_product_hide_publish_date($form, */ function scheduler_api_test_scheduler_taxonomy_term_hide_publish_date($form, $form_state, $entity) { // Use the generic hide_publish_date helper function. return _api_hide_publish_date($form, $form_state, $entity); return _scheduler_api_test_hide_publish_date($form, $form_state, $entity); } /** Loading @@ -406,7 +406,7 @@ function scheduler_api_test_scheduler_hide_unpublish_date($form, $form_state, $e /** * Generic function to hide the unpublish_on date field. */ function _api_hide_unpublish_date($form, $form_state, $entity) { 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()}")) { \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The unpublish_on field is hidden for green.'), 'status', FALSE); Loading @@ -422,7 +422,7 @@ function _api_hide_unpublish_date($form, $form_state, $entity) { */ function scheduler_api_test_scheduler_node_hide_unpublish_date($form, $form_state, $entity) { // Use the generic hide_unpublish_date helper function. return _api_hide_unpublish_date($form, $form_state, $entity); return _scheduler_api_test_hide_unpublish_date($form, $form_state, $entity); } /** Loading @@ -430,7 +430,7 @@ function scheduler_api_test_scheduler_node_hide_unpublish_date($form, $form_stat */ function scheduler_api_test_scheduler_media_hide_unpublish_date($form, $form_state, $entity) { // Use the generic hide_unpublish_date helper function. return _api_hide_unpublish_date($form, $form_state, $entity); return _scheduler_api_test_hide_unpublish_date($form, $form_state, $entity); } /** Loading @@ -438,7 +438,7 @@ function scheduler_api_test_scheduler_media_hide_unpublish_date($form, $form_sta */ function scheduler_api_test_scheduler_commerce_product_hide_unpublish_date($form, $form_state, $entity) { // Use the generic hide_unpublish_date helper function. return _api_hide_unpublish_date($form, $form_state, $entity); return _scheduler_api_test_hide_unpublish_date($form, $form_state, $entity); } /** Loading @@ -446,7 +446,7 @@ function scheduler_api_test_scheduler_commerce_product_hide_unpublish_date($form */ function scheduler_api_test_scheduler_taxonomy_term_hide_unpublish_date($form, $form_state, $entity) { // Use the generic hide_unpublish_date helper function. return _api_hide_unpublish_date($form, $form_state, $entity); return _scheduler_api_test_hide_unpublish_date($form, $form_state, $entity); } /** Loading @@ -467,7 +467,7 @@ function scheduler_api_test_scheduler_publish_process(EntityInterface $entity) { /** * Generic function to process third-party publishing. */ function _api_publish_process(EntityInterface $entity) { function _scheduler_api_test_publish_process(EntityInterface $entity) { // Entities with 'yellow {type}' in the title are simulated to be processed // by this hook, and will not be published by Scheduler. if (stristr($entity->label(), "yellow {$entity->getEntityTypeId()}")) { Loading @@ -485,7 +485,7 @@ function _api_publish_process(EntityInterface $entity) { */ function scheduler_api_test_scheduler_node_publish_process(NodeInterface $node) { // Use the generic publish_process helper function. return _api_publish_process($node); return _scheduler_api_test_publish_process($node); } /** Loading @@ -493,7 +493,7 @@ function scheduler_api_test_scheduler_node_publish_process(NodeInterface $node) */ function scheduler_api_test_scheduler_media_publish_process(MediaInterface $media) { // Use the generic publish_process helper function. return _api_publish_process($media); return _scheduler_api_test_publish_process($media); } /** Loading @@ -501,7 +501,7 @@ function scheduler_api_test_scheduler_media_publish_process(MediaInterface $medi */ function scheduler_api_test_scheduler_commerce_product_publish_process(ProductInterface $product) { // Use the generic publish_process helper function. return _api_publish_process($product); return _scheduler_api_test_publish_process($product); } /** Loading @@ -509,7 +509,7 @@ function scheduler_api_test_scheduler_commerce_product_publish_process(ProductIn */ function scheduler_api_test_scheduler_taxonomy_term_publish_process(TermInterface $term) { // Use the generic publish_process helper function. return _api_publish_process($term); return _scheduler_api_test_publish_process($term); } /** Loading @@ -530,7 +530,7 @@ function scheduler_api_test_scheduler_unpublish_process(EntityInterface $entity) /** * Generic function to process third-party unpublishing. */ function _api_unpublish_process(EntityInterface $entity) { function _scheduler_api_test_unpublish_process(EntityInterface $entity) { // Entities with 'orange {type}' in the title are simulated to be processed by // this hook, and will not be unpublished by Scheduler. if (stristr($entity->label(), "orange {$entity->getEntityTypeId()}")) { Loading @@ -548,7 +548,7 @@ function _api_unpublish_process(EntityInterface $entity) { */ function scheduler_api_test_scheduler_node_unpublish_process(NodeInterface $node) { // Use the generic unpublish_process helper function. return _api_unpublish_process($node); return _scheduler_api_test_unpublish_process($node); } /** Loading @@ -556,7 +556,7 @@ function scheduler_api_test_scheduler_node_unpublish_process(NodeInterface $node */ function scheduler_api_test_scheduler_media_unpublish_process(MediaInterface $media) { // Use the generic unpublish_process helper function. return _api_unpublish_process($media); return _scheduler_api_test_unpublish_process($media); } /** Loading @@ -564,7 +564,7 @@ function scheduler_api_test_scheduler_media_unpublish_process(MediaInterface $me */ function scheduler_api_test_scheduler_commerce_product_unpublish_process(ProductInterface $product) { // Use the generic unpublish_process helper function. return _api_unpublish_process($product); return _scheduler_api_test_unpublish_process($product); } /** Loading @@ -572,5 +572,5 @@ function scheduler_api_test_scheduler_commerce_product_unpublish_process(Product */ function scheduler_api_test_scheduler_taxonomy_term_unpublish_process(TermInterface $term) { // Use the generic unpublish_process helper function. return _api_unpublish_process($term); return _scheduler_api_test_unpublish_process($term); } Loading
scheduler.module +3 −3 Original line number Diff line number Diff line Loading @@ -1193,7 +1193,7 @@ function scheduler_migrate_prepare_row(Row $row, MigrateSourceInterface $source, ); // Two third-party-settings have changed name and value, so convert these. if ($config_name == 'use_vertical_tabs') { if (unserialize($setting->value) == 1) { if (unserialize($setting->value, ['allowed_classes' => FALSE]) == 1) { $third_party_settings['fields_display_mode'] = 'vertical_tab'; } else { Loading @@ -1201,7 +1201,7 @@ function scheduler_migrate_prepare_row(Row $row, MigrateSourceInterface $source, } } elseif ($config_name == 'expand_fieldset') { if (unserialize($setting->value) == 1) { if (unserialize($setting->value, ['allowed_classes' => FALSE]) == 1) { $third_party_settings['expand_fieldset'] = 'always'; } else { Loading @@ -1210,7 +1210,7 @@ function scheduler_migrate_prepare_row(Row $row, MigrateSourceInterface $source, } else { // The remaining eight settings are exactly the same as in Drupal 7. $third_party_settings[$config_name] = unserialize($setting->value); $third_party_settings[$config_name] = unserialize($setting->value, ['allowed_classes' => FALSE]); } } $row->setSourceProperty('scheduler_third_party_settings', $third_party_settings); Loading
scheduler.tokens.inc +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ function scheduler_token_info() { function scheduler_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { $token_service = \Drupal::token(); $date_formatter = \Drupal::service('date.formatter'); $language_code = isset($options['langcode']) ? $options['langcode'] : NULL; $language_code = $options['langcode'] ?? NULL; $replacements = []; $plugin_types = \Drupal::service('scheduler.manager')->getPluginEntityTypes(); Loading
scheduler_rules_integration/tests/src/Functional/SchedulerRulesEventsTest.php +2 −13 Original line number Diff line number Diff line Loading @@ -68,28 +68,17 @@ class SchedulerRulesEventsTest extends SchedulerBrowserTestBase { 24 => ['scheduler:taxonomy_term_has_been_unpublished_via_cron', 'Scheduler has unpublished this taxonomy term during cron.'], ]; // PHPCS throws a false-positive 'variable $var is undefined' message when // the variable is defined by list( ) syntax. To avoid the unwanted warnings // we can put phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis // before each line that produces a warning of this type. // This has been fixed in Coder 8.3.10 which is used in Core 9.1. // @see https://www.drupal.org/project/coder/issues/2876245 // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis foreach ($rule_data as $i => list($event_name, $description)) { // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis $rule = []; foreach ($rule_data as $i => [$event_name, $description]) { $rule[$i] = $this->expressionManager->createRule(); // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis $this->message[$i] = 'RULES message ' . $i . '. ' . $description; // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis $rule[$i]->addAction('rules_system_message', ContextConfig::create() ->setValue('message', $this->message[$i]) ->setValue('type', 'status') ); $config_entity = $this->rulesStorage->create([ 'id' => 'rule' . $i, // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis 'events' => [['event_name' => $event_name]], // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis 'expression' => $rule[$i]->getConfiguration(), ]); $config_entity->save(); Loading
tests/modules/scheduler_api_test/scheduler_api_test.module +28 −28 Original line number Diff line number Diff line Loading @@ -211,7 +211,7 @@ function scheduler_api_test_scheduler_publishing_allowed(EntityInterface $entity /** * Generic function to check if the entity is allowed to be published. */ function _api_publishing_allowed(EntityInterface $entity) { function _scheduler_api_test_publishing_allowed(EntityInterface $entity) { // If there is no 'Approved for Publishing' field or we are not dealing with // an entity designed for this test then allow publishing. if (!isset($entity->field_approved_publishing) || !stristr($entity->label(), "blue {$entity->getEntityTypeId()}")) { Loading Loading @@ -246,7 +246,7 @@ function _api_publishing_allowed(EntityInterface $entity) { */ function scheduler_api_test_scheduler_node_publishing_allowed(NodeInterface $node) { // Use the generic publishing_allowed helper function. return _api_publishing_allowed($node); return _scheduler_api_test_publishing_allowed($node); } /** Loading @@ -254,7 +254,7 @@ function scheduler_api_test_scheduler_node_publishing_allowed(NodeInterface $nod */ function scheduler_api_test_scheduler_media_publishing_allowed(MediaInterface $media) { // Use the generic publishing_allowed helper function. return _api_publishing_allowed($media); return _scheduler_api_test_publishing_allowed($media); } /** Loading @@ -262,7 +262,7 @@ function scheduler_api_test_scheduler_media_publishing_allowed(MediaInterface $m */ function scheduler_api_test_scheduler_commerce_product_publishing_allowed(ProductInterface $product) { // Use the generic publishing_allowed helper function. return _api_publishing_allowed($product); return _scheduler_api_test_publishing_allowed($product); } /** Loading @@ -275,7 +275,7 @@ function scheduler_api_test_scheduler_unpublishing_allowed(EntityInterface $enti /** * Generic function to check if the entity is allowed to be unpublished. */ function _api_unpublishing_allowed(EntityInterface $entity) { function _scheduler_api_test_unpublishing_allowed(EntityInterface $entity) { // If there is no 'Approved for Unpublishing' field or we are not dealing with // an entity designed for this test then allow unpublishing. if (!isset($entity->field_approved_unpublishing) || !stristr($entity->label(), "red {$entity->getEntityTypeId()}")) { Loading Loading @@ -310,7 +310,7 @@ function _api_unpublishing_allowed(EntityInterface $entity) { */ function scheduler_api_test_scheduler_node_unpublishing_allowed(NodeInterface $node) { // Use the generic unpublishing_allowed helper function. return _api_unpublishing_allowed($node); return _scheduler_api_test_unpublishing_allowed($node); } /** Loading @@ -318,7 +318,7 @@ function scheduler_api_test_scheduler_node_unpublishing_allowed(NodeInterface $n */ function scheduler_api_test_scheduler_media_unpublishing_allowed(MediaInterface $media) { // Use the generic unpublishing_allowed helper function. return _api_unpublishing_allowed($media); return _scheduler_api_test_unpublishing_allowed($media); } /** Loading @@ -326,7 +326,7 @@ function scheduler_api_test_scheduler_media_unpublishing_allowed(MediaInterface */ function scheduler_api_test_scheduler_commerce_product_unpublishing_allowed(ProductInterface $product) { // Use the generic unpublishing_allowed helper function. return _api_unpublishing_allowed($product); return _scheduler_api_test_unpublishing_allowed($product); } /** Loading @@ -346,7 +346,7 @@ function scheduler_api_test_scheduler_hide_publish_date($form, $form_state, $ent /** * Generic function to hide the publish_on date field. */ function _api_hide_publish_date($form, $form_state, $entity) { 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()}")) { \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The publish_on field is hidden for green.'), 'status', FALSE); Loading @@ -362,7 +362,7 @@ function _api_hide_publish_date($form, $form_state, $entity) { */ function scheduler_api_test_scheduler_node_hide_publish_date($form, $form_state, $entity) { // Use the generic hide_publish_date helper function. return _api_hide_publish_date($form, $form_state, $entity); return _scheduler_api_test_hide_publish_date($form, $form_state, $entity); } /** Loading @@ -370,7 +370,7 @@ function scheduler_api_test_scheduler_node_hide_publish_date($form, $form_state, */ function scheduler_api_test_scheduler_media_hide_publish_date($form, $form_state, $entity) { // Use the generic hide_publish_date helper function. return _api_hide_publish_date($form, $form_state, $entity); return _scheduler_api_test_hide_publish_date($form, $form_state, $entity); } /** Loading @@ -378,7 +378,7 @@ function scheduler_api_test_scheduler_media_hide_publish_date($form, $form_state */ function scheduler_api_test_scheduler_commerce_product_hide_publish_date($form, $form_state, $entity) { // Use the generic hide_publish_date helper function. return _api_hide_publish_date($form, $form_state, $entity); return _scheduler_api_test_hide_publish_date($form, $form_state, $entity); } /** Loading @@ -386,7 +386,7 @@ function scheduler_api_test_scheduler_commerce_product_hide_publish_date($form, */ function scheduler_api_test_scheduler_taxonomy_term_hide_publish_date($form, $form_state, $entity) { // Use the generic hide_publish_date helper function. return _api_hide_publish_date($form, $form_state, $entity); return _scheduler_api_test_hide_publish_date($form, $form_state, $entity); } /** Loading @@ -406,7 +406,7 @@ function scheduler_api_test_scheduler_hide_unpublish_date($form, $form_state, $e /** * Generic function to hide the unpublish_on date field. */ function _api_hide_unpublish_date($form, $form_state, $entity) { 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()}")) { \Drupal::messenger()->addMessage(t('Scheduler_Api_Test: The unpublish_on field is hidden for green.'), 'status', FALSE); Loading @@ -422,7 +422,7 @@ function _api_hide_unpublish_date($form, $form_state, $entity) { */ function scheduler_api_test_scheduler_node_hide_unpublish_date($form, $form_state, $entity) { // Use the generic hide_unpublish_date helper function. return _api_hide_unpublish_date($form, $form_state, $entity); return _scheduler_api_test_hide_unpublish_date($form, $form_state, $entity); } /** Loading @@ -430,7 +430,7 @@ function scheduler_api_test_scheduler_node_hide_unpublish_date($form, $form_stat */ function scheduler_api_test_scheduler_media_hide_unpublish_date($form, $form_state, $entity) { // Use the generic hide_unpublish_date helper function. return _api_hide_unpublish_date($form, $form_state, $entity); return _scheduler_api_test_hide_unpublish_date($form, $form_state, $entity); } /** Loading @@ -438,7 +438,7 @@ function scheduler_api_test_scheduler_media_hide_unpublish_date($form, $form_sta */ function scheduler_api_test_scheduler_commerce_product_hide_unpublish_date($form, $form_state, $entity) { // Use the generic hide_unpublish_date helper function. return _api_hide_unpublish_date($form, $form_state, $entity); return _scheduler_api_test_hide_unpublish_date($form, $form_state, $entity); } /** Loading @@ -446,7 +446,7 @@ function scheduler_api_test_scheduler_commerce_product_hide_unpublish_date($form */ function scheduler_api_test_scheduler_taxonomy_term_hide_unpublish_date($form, $form_state, $entity) { // Use the generic hide_unpublish_date helper function. return _api_hide_unpublish_date($form, $form_state, $entity); return _scheduler_api_test_hide_unpublish_date($form, $form_state, $entity); } /** Loading @@ -467,7 +467,7 @@ function scheduler_api_test_scheduler_publish_process(EntityInterface $entity) { /** * Generic function to process third-party publishing. */ function _api_publish_process(EntityInterface $entity) { function _scheduler_api_test_publish_process(EntityInterface $entity) { // Entities with 'yellow {type}' in the title are simulated to be processed // by this hook, and will not be published by Scheduler. if (stristr($entity->label(), "yellow {$entity->getEntityTypeId()}")) { Loading @@ -485,7 +485,7 @@ function _api_publish_process(EntityInterface $entity) { */ function scheduler_api_test_scheduler_node_publish_process(NodeInterface $node) { // Use the generic publish_process helper function. return _api_publish_process($node); return _scheduler_api_test_publish_process($node); } /** Loading @@ -493,7 +493,7 @@ function scheduler_api_test_scheduler_node_publish_process(NodeInterface $node) */ function scheduler_api_test_scheduler_media_publish_process(MediaInterface $media) { // Use the generic publish_process helper function. return _api_publish_process($media); return _scheduler_api_test_publish_process($media); } /** Loading @@ -501,7 +501,7 @@ function scheduler_api_test_scheduler_media_publish_process(MediaInterface $medi */ function scheduler_api_test_scheduler_commerce_product_publish_process(ProductInterface $product) { // Use the generic publish_process helper function. return _api_publish_process($product); return _scheduler_api_test_publish_process($product); } /** Loading @@ -509,7 +509,7 @@ function scheduler_api_test_scheduler_commerce_product_publish_process(ProductIn */ function scheduler_api_test_scheduler_taxonomy_term_publish_process(TermInterface $term) { // Use the generic publish_process helper function. return _api_publish_process($term); return _scheduler_api_test_publish_process($term); } /** Loading @@ -530,7 +530,7 @@ function scheduler_api_test_scheduler_unpublish_process(EntityInterface $entity) /** * Generic function to process third-party unpublishing. */ function _api_unpublish_process(EntityInterface $entity) { function _scheduler_api_test_unpublish_process(EntityInterface $entity) { // Entities with 'orange {type}' in the title are simulated to be processed by // this hook, and will not be unpublished by Scheduler. if (stristr($entity->label(), "orange {$entity->getEntityTypeId()}")) { Loading @@ -548,7 +548,7 @@ function _api_unpublish_process(EntityInterface $entity) { */ function scheduler_api_test_scheduler_node_unpublish_process(NodeInterface $node) { // Use the generic unpublish_process helper function. return _api_unpublish_process($node); return _scheduler_api_test_unpublish_process($node); } /** Loading @@ -556,7 +556,7 @@ function scheduler_api_test_scheduler_node_unpublish_process(NodeInterface $node */ function scheduler_api_test_scheduler_media_unpublish_process(MediaInterface $media) { // Use the generic unpublish_process helper function. return _api_unpublish_process($media); return _scheduler_api_test_unpublish_process($media); } /** Loading @@ -564,7 +564,7 @@ function scheduler_api_test_scheduler_media_unpublish_process(MediaInterface $me */ function scheduler_api_test_scheduler_commerce_product_unpublish_process(ProductInterface $product) { // Use the generic unpublish_process helper function. return _api_unpublish_process($product); return _scheduler_api_test_unpublish_process($product); } /** Loading @@ -572,5 +572,5 @@ function scheduler_api_test_scheduler_commerce_product_unpublish_process(Product */ function scheduler_api_test_scheduler_taxonomy_term_unpublish_process(TermInterface $term) { // Use the generic unpublish_process helper function. return _api_unpublish_process($term); return _scheduler_api_test_unpublish_process($term); }