Project

General

Profile

Actions

Bug #18496

open

PHP 8+ Compatibility

Added by Raymond Hoh over 1 year ago. Updated 20 days ago.

Status:
New
Priority name:
Normal
Assignee:
-
Category name:
Internal Tools and Workflow
Target version:
Start date:
2023-07-21
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

We're currently running PHP 7.4 in our PHPCS set up and on the GC server, but some of us are using PHP 8+ in our development environments. (For example, #16948.)

This will be a catch-all ticket to address deprecated notices, fatal errors and the like.

Also, just to note that PHP 7.4 reached end-of-life back in November 2022. Upgrading to PHP 8.2 is probably good to think about when we decide to move hosts. PHP 8.2 is supported until December 2025, while PHP 8.0 will reach end-of-life in November 2023.


Related issues

Related to CUNY Academic Commons - Feature #21381: Upgrade to PHP 8.1.x as part of Reclaim migrationNewBoone Gorges2024-11-01

Actions
Actions #1

Updated by Raymond Hoh over 1 year ago

I've added a commit to address the implicit conversion from float to int notice for the cac_get_default_avatar() function here - https://github.com/cuny-academic-commons/cac/commit/0ffc3b8ae2166981eb5564bbbad780df241768ef .

bp-groupblog and invite-anyone also needed some changes to fix some deprecated notices, but I wasn't aware that the upstream versions already fixed them. I've backported those changes in the following commits - https://github.com/cuny-academic-commons/cac/commit/cb10f022b627315f2d0c01fb8d3980a629f9c005 , https://github.com/cuny-academic-commons/cac/commit/d481ae990c8a53ebe14fd0ade0afb6013781fed2 . Boone, are there any major changes between the upstream versions and our CAC version?

Actions #2

Updated by Boone Gorges over 1 year ago

Boone, are there any major changes between the upstream versions and our CAC version?

No, I don't think so. I'll likely be performing updates to both plugins as part of the upcoming Commons In A Box release (~mid August), after which point the new versions will be on wordpress.org and will trickle down to the Commons. In the meantime, I don't see any harm in backporting some or all of the fixes to CAC.

Actions #3

Updated by Boone Gorges over 1 year ago

  • Target version changed from 2.1.11 to 2.1.12
Actions #4

Updated by Boone Gorges over 1 year ago

  • Target version changed from 2.1.12 to 2.1.13
Actions #5

Updated by Boone Gorges over 1 year ago

  • Target version changed from 2.1.13 to 2.1.14
Actions #6

Updated by Boone Gorges about 1 year ago

  • Target version changed from 2.1.14 to 2.1.15
Actions #7

Updated by Boone Gorges about 1 year ago

  • Target version changed from 2.1.15 to 2.1.16
Actions #8

Updated by Jeremy Felt about 1 year ago

I think related to PHP 8 compat. :)

I have a branch open from master (test/improve-php8-scan) that uses dev-develop on the PHPCompatibility library. The PHPCompatibility library itself hasn't had a version release since 2019, and there are quite a few improvements pending. I landed on this config for quite a few other projects after seeing Juliette's guidance. The tests still pass as expected, so there is no real change other than (hopefully) increased reliability.

Actions #9

Updated by Boone Gorges about 1 year ago

Thanks so much for looking at this, Jeremy! These updates look good. I've merged them into the mainline 2.1.x branch.

Actions #10

Updated by Boone Gorges about 1 year ago

  • Target version changed from 2.1.16 to 2.2.1
Actions #11

Updated by Boone Gorges about 1 year ago

  • Target version changed from 2.2.1 to 2.2.2
Actions #12

Updated by Boone Gorges about 1 year ago

  • Target version changed from 2.2.2 to 2.2.3
Actions #13

Updated by Boone Gorges 12 months ago

  • Target version changed from 2.2.3 to 2.2.4
Actions #14

Updated by Jeremy Felt 12 months ago

I'm seeing a PHP warning (previously a notice) via CAC Courses when on PHP 8.2 in this line: https://github.com/cuny-academic-commons/cac-courses/blob/1f4bbb093e2b89760d9b1ba436ebd119e070ecb2/src/API.php#L44

I've adjusted this locally to be

$user = new \WP_User( $user['id'] );
return $user->user_login;

But I'm not sure what that may be impacting other than removing the warning for me. :)

Actions #15

Updated by Boone Gorges 12 months ago

I'm not sure the root of the issue, but I don't see any harm in the change https://github.com/cuny-academic-commons/cac-courses/commit/4ff624fa1288a969aa12623aba72ceb157f21679

Actions #16

Updated by Boone Gorges 12 months ago

  • Target version changed from 2.2.4 to 2.2.5
Actions #17

Updated by Boone Gorges 11 months ago

  • Target version changed from 2.2.5 to 2.2.6
Actions #18

Updated by Boone Gorges 11 months ago

  • Target version changed from 2.2.6 to 2.3.1
Actions #19

Updated by Boone Gorges 10 months ago

  • Target version changed from 2.3.1 to 2.3.2
Actions #20

Updated by Boone Gorges 9 months ago

  • Target version changed from 2.3.2 to 2.4.0
Actions #21

Updated by Boone Gorges 5 months ago

  • Target version changed from 2.4.0 to 2.5.0
Actions #22

Updated by Boone Gorges 20 days ago

  • Related to Feature #21381: Upgrade to PHP 8.1.x as part of Reclaim migration added
Actions #23

Updated by Boone Gorges 20 days ago

  • Target version changed from 2.5.0 to Migration to Reclaim
Actions

Also available in: Atom PDF