Testing D7 Rules with PHP 8.1 shows some new errors due to deprecated methods in PHP. See https://www.drupal.org/pift-ci-job/2243148

These are similar to:
end(): Calling end() on an object is deprecated

This issue is a blocker for a new D7 release of Rules.

CommentFileSizeAuthor
#4 3250516-4-end.patch1.09 KBtr
#3 3250516-3-end.patch1.02 KBtr
#2 3250516-2-end.patch1.01 KBtr

Comments

TR created an issue. See original summary.

tr’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

I'm not too thrilled with this patch. If anyone else knows a cleaner way to do this I'd love to hear it.

tr’s picture

StatusFileSize
new1.02 KB
tr’s picture

StatusFileSize
new1.09 KB
liam morland’s picture

Status: Needs review » Reviewed & tested by the community

I have reviewed the patch. It fixes the problem without any side-effects.

The second param to iterator_to_array() could be left out since that is the default. It could also be set to FALSE. That might be a tiny bit faster.

  • TR committed 3f2e298 on 7.x-2.x
    Issue #3250516 by TR: [D7] PHP 8.1 compatibility - end()
    
tr’s picture

Status: Reviewed & tested by the community » Fixed

Committed #4.

Status: Fixed » Closed (fixed)

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