Problem/Motivation

/builds/project/scheduler/web/core/lib/Drupal/Core/Plugin/Discovery/AttributeDiscoveryWithAnnotations.php:98
Using @Constraint annotation for plugin with ID SchedulerUnpublishOn is deprecated and is removed from drupal:13.0.0. Use a Drupal\Core\Validation\Attribute\Constraint attribute instead. See https://www.drupal.org/node/3395575
    
/builds/project/scheduler/web/core/lib/Drupal/Core/Plugin/Discovery/AttributeDiscoveryWithAnnotations.php:98
Using @Constraint annotation for plugin with ID SchedulerPublishOn is deprecated and is removed from drupal:13.0.0. Use a Drupal\Core\Validation\Attribute\Constraint attribute instead. See https://www.drupal.org/node/3395575

Change record https://www.drupal.org/node/3395575

Proposed resolution

Need to end compatibility with Drupal 8 because the new syntax is invalid in PHP7

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork scheduler-3546172

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

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Status: Active » Needs review

With these four constraint annotation and void fixes, the scheduler group test log is reduced from 11,280 to 8,659 lines. There were previously tests with 16 deprecations, but we now get a maximum of 10.

All tests run OK at:

  • Drupal 11.2.3, PHP version : 8.3.25
  • Drupal 10.5.2 , PHP version : 8.1.33
  • Drupal 9.5.11, PHP version : 8.1.33

However we get PHP syntax parsing problems at in Drupal 8.9.20, PHP 7.4.28. So before this is committed we need to check the minimum PHP version that this 2.x branch is compatible with, and increase it.

https://www.drupal.org/project/drupal/releases/8.9.0
https://www.drupal.org/psa-2021-06-29
https://www.innoraft.ai/blog/understanding-drupals-php-version-support-m...

jonathan1055’s picture

Status: Needs review » Postponed
Related issues: +#3546516: End compatibility with Drupal 8

This is postponed until we drop Drupal 8 support.
#3546516: End compatibility with Drupal 8

jonathan1055’s picture

Issue summary: View changes
Status: Postponed » Active

#3546516: End compatibility with Drupal 8 merged, so can now work on this.

Before - @group scheduler test log length 17,116 lines
21 x 21 deprecations
1 x 23 deprecations
1 x 24 deprecations
https://git.drupalcode.org/project/scheduler/-/jobs/6953047/viewer

Now log reduced by 2,600 lines to 14,468
21 x 17 deprecations
1 x 18 deprecations
1 x 19 deprecations
https://git.drupalcode.org/project/scheduler/-/jobs/6963786/viewer

jonathan1055’s picture

Next Minor is now testing with 11.4-dev

Existing 'scheduler' @group is 17,660 lines (job log). Of the 23 tests:
5 x 21 deprecations
12 x 22 deprecations
3 x 23
2 x 26
1 x 28

With with MR, four deprecations are fixed. The log is 15,053 lines a reduction of 2,600
5 x 17 deprecations
12 x 18 deprecations
3 x 19
2 x 22
1 x 24

jonathan1055’s picture

Title: Fix @Constraint annotation for plugin » Add @Constraint annotation to validation plugins
Status: Active » Fixed

Merged

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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