Closed (fixed)
Project:
CAS
Version:
3.x-dev
Component:
CAS
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2024 at 14:05 UTC
Updated:
7 Aug 2024 at 12:49 UTC
Jump to comment: Most recent
This is blocked on #3461478: Drupal 11 compatibility
Modernize the whole CAS module codebase:
CAS 3.0.0 is compatible with Drupal 10.3, 10.4 and 11.0
drupal/cas:^3.0 with Composer
CasLoginException::getCode() was changed from integer to enum of type CasLoginExceptionType. If your code calls this method, you should adapt. If you still need the integer value, you can do something like$codes = CasLoginExceptionType::cases();
$code = array_search($exception->getCode(), $codes, TRUE);
CasUserManager::getCasUsernameForAccount() is now strict typed as integer. Make sure you cast the parameter to an Integer before is passed to the method:$account = ...;
$uid = (int) $account->id();
$name = \Drupal::service('cas.user_manager')->getCasUsernameForAccount($uid);
CasServerConfig::setProtocolVersion() setter accepts now a CasProtocolVersion enum case as parameter instead of a string. Same, the CasServerConfig::getProtocolVersion() getter returns now a CasProtocolVersion enum case instead of a string. If needed, get the server version as a legacy string: CasServerConfig::getProtocolVersion()->value.CasServerConfig::setHttpScheme() setter accepts now a HttpScheme enum case as parameter instead of a string. Same, the CasServerConfig::getHttpScheme() getter returns now a HttpScheme enum case instead of a string. If needed, get the HTTP scheme as a legacy string: CasServerConfig:: getHttpScheme()->value.CasServerConfig::setVerify() setter accepts now a SslCertificateVerification enum case as parameter instead of an integer. Same, the CasServerConfig::getVerify() getter returns now a SslCertificateVerification enum case instead of an integer. If needed, get the certificate verification scheme as a legacy integer: CasServerConfig:: getVerify()->value.Prepare for the next CAS version by replacing the deprecated code. Check https://www.drupal.org/node/3462792 to learn what is deprecated in CAS 3.0.0 and adapt your code.
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
Comment #3
claudiu.cristea#3461478: Drupal 11 compatibility is merged.
Comment #4
bkosborneThis was a huge merge request, I reviewed it at a high level.
Comment #5
claudiu.cristeaComment #6
claudiu.cristeaComment #7
claudiu.cristeaComment #8
claudiu.cristeaComment #9
claudiu.cristeaThis is ready for a new review. Please take a look to issue summary where I've prepared the release notes for 3.0.0, because there are some tiny BC violations, but this is accepted between major releases according to semver.
Comment #10
claudiu.cristeaComment #11
claudiu.cristeaComment #12
claudiu.cristeaComment #13
claudiu.cristeaComment #14
bkosborneComment #15
bkosborneMade some minor changes to the issue summary and reviewed the newer commits from yesterday. This looks good to me. This seems like it was a lot of work. I learned a lot about enums from reviewing the code! Such a better solution than what we used before!
Comment #16
claudiu.cristeaComment #18
claudiu.cristeaThank you for review.