Problem/Motivation

PHP deprecation notice:

PHP Deprecated:  a:5:{s:11:"deprecation";s:119:"Creation of dynamic property Drupal\Tests\scheduler\Functional\SchedulerViewsAccessTest::$schedulerEditor is deprecated";s:5:"class";s:58:"Drupal\Tests\scheduler\Functional\SchedulerViewsAccessTest";s:6:"method";s:32:"testViewScheduledContentOverview";s:15:"triggering_file";s:123:"/home/runner/work/acquia_cms/orca-build/docroot/modules/contrib/scheduler/tests/src/Functional/SchedulerViewsAccessTest.php";s:11:"files_stack";a:8:{i:0;s:123:"/home/runner/work/acquia_cms/orca-build/docroot/modules/contrib/scheduler/tests/src/Functional/SchedulerViewsAccessTest.php";i:1;s:123:"/home/runner/work/acquia_cms/orca-build/docroot/modules/contrib/scheduler/tests/src/Functional/SchedulerViewsAccessTest.php";i:2;s:77:"/home/runner/work/acquia_cms/orca-build/docroot/sites/simpletest/TestCase.php";i:3;s:77:"/home/runner/work/acquia_cms/orca-build/docroot/sites/simpletest/TestCase.php";i:4;s:91:"/home/runner/work/acquia_cms/orca-build/vendor/phpunit/phpunit/src/Framework/TestResult.php";i:5;s:77:"/home/runner/work/acquia_cms/orca-build/docroot/sites/simpletest/TestCase.php";i:6;s:19:"Standard input code";i:7;s:19:"Standard input code";}} in /home/runner/work/acquia_cms/orca-build/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerTrait.php on line 284

Issue fork scheduler-3357836

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vishalkhode created an issue. See original summary.

Rajeshreeputra made their first commit to this issue’s fork.

jonathan1055’s picture

Thanks for this. Can you run the tests at PHP8.2 to show that this fixes the warning.

vishalkhode’s picture

Status: Active » Needs work

Hi @Rajeshreeputra
Looks like there are more deprecations. Ex:

PHP Deprecated:  a:5:{s:11:"deprecation";s:111:"Creation of dynamic property Drupal\Tests\scheduler\Functional\SchedulerViewsAccessTest::$webUser is deprecated";s:5:"class";s:58:"Drupal\Tests\scheduler\Functional\SchedulerViewsAccessTest";s:6:"method";s:28:"testViewScheduledContentUser";s:15:"triggering_file";s:123:"/home/runner/work/acquia_cms/orca-build/docroot/modules/contrib/scheduler/tests/src/Functional/SchedulerViewsAccessTest.php";s:11:"files_stack";a:8:{i:0;s:123:"/home/runner/work/acquia_cms/orca-build/docroot/modules/contrib/scheduler/tests/src/Functional/SchedulerViewsAccessTest.php";i:1;s:123:"/home/runner/work/acquia_cms/orca-build/docroot/modules/contrib/scheduler/tests/src/Functional/SchedulerViewsAccessTest.php";i:2;s:77:"/home/runner/work/acquia_cms/orca-build/docroot/sites/simpletest/TestCase.php";i:3;s:77:"/home/runner/work/acquia_cms/orca-build/docroot/sites/simpletest/TestCase.php";i:4;s:91:"/home/runner/work/acquia_cms/orca-build/vendor/phpunit/phpunit/src/Framework/TestResult.php";i:5;s:77:"/home/runner/work/acquia_cms/orca-build/docroot/sites/simpletest/TestCase.php";i:6;s:19:"Standard input code";i:7;s:19:"Standard input code";}} in /home/runner/work/acquia_cms/orca-build/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerTrait.php on line 284


PHP Deprecated:  a:5:{s:11:"deprecation";s:119:"Creation of dynamic property Drupal\Tests\scheduler\Functional\SchedulerViewsAccessTest::$schedulerViewer is deprecated";s:5:"class";s:58:"Drupal\Tests\scheduler\Functional\SchedulerViewsAccessTest";s:6:"method";s:28:"testViewScheduledContentUser";s:15:"triggering_file";s:123:"/home/runner/work/acquia_cms/orca-build/docroot/modules/contrib/scheduler/tests/src/Functional/SchedulerViewsAccessTest.php";s:11:"files_stack";a:8:{i:0;s:123:"/home/runner/work/acquia_cms/orca-build/docroot/modules/contrib/scheduler/tests/src/Functional/SchedulerViewsAccessTest.php";i:1;s:123:"/home/runner/work/acquia_cms/orca-build/docroot/modules/contrib/scheduler/tests/src/Functional/SchedulerViewsAccessTest.php";i:2;s:77:"/home/runner/work/acquia_cms/orca-build/docroot/sites/simpletest/TestCase.php";i:3;s:77:"/home/runner/work/acquia_cms/orca-build/docroot/sites/simpletest/TestCase.php";i:4;s:91:"/home/runner/work/acquia_cms/orca-build/vendor/phpunit/phpunit/src/Framework/TestResult.php";i:5;s:77:"/home/runner/work/acquia_cms/orca-build/docroot/sites/simpletest/TestCase.php";i:6;s:19:"Standard input code";i:7;s:19:"Standard input code";}} in /home/runner/work/acquia_cms/orca-build/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerTrait.php on line 284
rajeshreeputra’s picture

Status: Needs work » Needs review

in devel module need to update the DevelGenerateRoutes file to fix below error.

8x: Creation of dynamic property Drupal\devel_generate\Routing\DevelGenerateRoutes::$DevelGenerateManager is deprecated
    8x in SchedulerDevelGenerateTest::testDevelGenerate from Drupal\Tests\scheduler\Functional

include this code:

/**
   * The Devel Generate Plugin Manager.
   *
   * @var \Drupal\Component\Plugin\PluginManagerInterface
   */
  protected $DevelGenerateManager;
rajeshreeputra’s picture

Issue tags: +ACMS2023
ankitv18’s picture

Assigned: Unassigned » ankitv18
rajeshreeputra’s picture

The SchedulerDevelGenerateTest test is failing because of the devel(devel_generate) module. @jonathan1055 could you update the DevelGenerateRoutes file with below change.

/**
   * The Devel Generate Plugin Manager.
   *
   * @var \Drupal\Component\Plugin\PluginManagerInterface
   */
  protected $DevelGenerateManager;

Above change fix below error and tests will be green.

8x: Creation of dynamic property Drupal\devel_generate\Routing\DevelGenerateRoutes::$DevelGenerateManager is deprecated
    8x in SchedulerDevelGenerateTest::testDevelGenerate from Drupal\Tests\scheduler\Functional

include this code:

jonathan1055’s picture

@Rajeshreeputra The change you suggest is close but not exactly correct. However there is already a Devel Generate issue regarding this
https://gitlab.com/drupalspoons/devel/-/issues/468
Please do not cross-post requests for one module on another module's issue queue. It might be just a conincidence that I am maintainer of both. Use the Devel issue queue for Devel issues :-)

  • jonathan1055 committed b6ff1894 on 2.x
    Issue #3357836 by jonathan1055: Get devel:5.x-dev when running with PHP8...
jonathan1055’s picture

The fix to Devl 5.x dev has been commited, see https://gitlab.com/drupalspoons/devel/-/merge_requests/152
This is only in the -dev version but I have made a change to Scheduer's drupalci.yml to get Devel 5.x-dev when running with PHP version 8.2 (see commit above).

So you can now rebase your MR and the DevelGenerate test should pass with PHP8.2

ankitv18’s picture

Assigned: ankitv18 » Unassigned
Status: Needs review » Reviewed & tested by the community

MR!85 applied cleanly and passing with stable and next version of Drupal with PHP 8.1 and 8.2, hence moving into RTBC.

rajeshreeputra’s picture

sure, @jonathan1055 will do. Thank you!!

jonathan1055’s picture

Thanks, it's looking good.

Now that I have opted in Scheduler for GitLab-CI testing I have now triggered a pipeline test (currently only project maintainers can do this). It is running on php8.1 so I may update that to php8.2

jonathan1055’s picture

I have made a couple of improvements

  1. Instead of the if-block for user id, convert the entity type id from snake_case to lowerCamelCase and then match as before on the user name
  2. The routeCronForm property was only used in one test, so it is now created as a local variable there, no point in having a separate property

jonathan1055’s picture

Thank you Rajeshreeputra, vishalkhode and ankitv18. Committed to 2.x.

This should also be done in 8.x-1.x I think.

jonathan1055’s picture

Category: Bug report » Task
Status: Reviewed & tested by the community » Fixed
Issue tags: -ACMS2023

Now fixed in 8.x-1.x
Thank you to everyone above who helped on this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rajeshreeputra’s picture

@jonathan1055 when can we expect release for the same.

jonathan1055’s picture

Hi Rajeshreeputra,
I have just committed the fix to the final 2.0 blocker #3336108: Don't run hook_modules_installed during config install and released Scheduler 2.0.0