Installed this module to use on a new site and when I go to create a new content type I get the following:

Deprecated function: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in _scheduler_entity_type_form_alter() (line 344 of /home/sitename/public_html/modules/contrib/scheduler/scheduler.module).

CommentFileSizeAuthor
#4 3293936-4.patch679 byteskbriand
#2 3293936-2.patch491 bytesnarendra.rajwar27

Issue fork scheduler-3293936

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

Christopher Riley created an issue. See original summary.

narendra.rajwar27’s picture

Status: Active » Needs review
StatusFileSize
new491 bytes

Hi @Christopher Riley,
though couldn't reproduce the issue, its working fine for me with Drupal 9.5.x and PHP 8.0
Still adding patch if someone else face this issue in future.

Christopher Riley’s picture

I am running it on 8.1, however I went ahead and applied your patch. I will let you know if I see anything else acting up.

Thanks

kbriand’s picture

StatusFileSize
new679 bytes

When creating a new vocabulary, $type->label() is null. Therefore, in $params, both @type and %type keys are null. The second one triggers the strtolower() error, while the first one trigger an htmlspecialchars() error since PHP 8.1. Both need to be fixed. I add the patch.

jatingupta40’s picture

Assigned: Unassigned » jatingupta40

I will review this patch.

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

jonathan1055’s picture

Assigned: jatingupta40 » Unassigned

Thanks narendra.rajwar27 for the initial patch and thanks kbriand for the update. I confirm that these are problems in php8.1 and this change fixes both of them.

I've pushed a MR and running against php8.1 will probably find other failures too.

jonathan1055’s picture

The known problems in Scheduler code are now fixed with this second commit. The 6 remaining failures for PHP8.1 are all in the Rules tests, because Rules 8.x-3.0-alpha7 (the newest tagged release) has not been updated for php8.1. However, the changes have been committed to Rules dev. We can update the version of Rules via a container_command in drupalci.yml which (if it works) will show that Scheduler tests can pass in PHP8.1

  • jonathan1055 committed 4de5323 on 2.x
    Issue #3293936 by jonathan1055, narendra.rajwar27, kbriand: PHP8...
jonathan1055’s picture

Title: PHP8 Compatibility » PHP8.1 compatibility
Status: Needs review » Fixed

Thanks narendra.rajwar27 and kbriand.
The change to get dev version of Rules can stay in until the next tagged Rules release.

Status: Fixed » Closed (fixed)

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