Drupal 10 compatibility

Created on 21 May 2023, about 1 year ago
Updated 16 June 2023, about 1 year ago

Problem/Motivation

The current version of this module is not compatible with Drupal 10 and thejacer87/canadapost-api library is not compatible with PHP 8.

drupal/commerce_canadapost dev-1.x requires drupal/core ^8 || ^9

Package thejacer87/canadapost-api has requirements incompatible with your PHP version, PHP extensions and Composer version:  
    - thejacer87/canadapost-api v0.2.4 requires php ^5.5.9 || ^5.6 || ^7.0 which does not match your installed version 8.1.3.

Steps to reproduce

Try to install the module on a site using Drupal 10.

Proposed resolution

1. (I am attaching patch with those fixes and some drupal-check fixes)
2. Update https://github.com/thejacer87/php-canadapost-api composer.json - add PHP 8 to composer php requirements.
3. Update module composer dependencies to new library version when library is updated.

Remaining tasks

1. Update https://github.com/thejacer87/php-canadapost-api library.
2. Update module composer dependencies when library is updated.
3. Tests.

๐Ÿ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ad0z
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad

    bharath-kondeti โ†’ made their first commit to this issueโ€™s fork.

  • @bharath-kondeti opened merge request.
  • ๐Ÿ‡ฑ๐Ÿ‡ฐSri Lanka umesl

    Thank you very much for providing the Drupal 9.4^ and Drupal 10 compatible patch. I have successfully applied all the patches for the module.

    However, I am still encountering an issue with the following error message: 'Error: Class "CanadaPost\Rating" not found in C:\wamp64\www\dru9.test\modules\contrib\commerce_canadapost\src\Plugin\Commerce\ShippingMethod\CanadaPost.php on line 159'.

    To resolve this, I manually downloaded the Canada Post API from the GitHub repository 'thejacer87/php-canadapost-api' and placed it in both the 'Vendor' and 'library' folders. (This API cannot be downloaded using Composer due to an error message related to PHP version compatibility.)

    I have attempted the following folder structure in both the 'vendor' and 'libraries' folders:

    • php-canadapost-api
    • canadapost-api
    • canadapost
    • thejacer87/php-canadapost-api
    • thejacer87/canadapost-api
    • thejacer87/canadapost

    Please let me know if this folder structure is correct, or if there are any specific instructions regarding the placement of these files.

    Despite these efforts, the issue persists. Could you please provide further assistance or guidance on how to resolve this error? Thank you

Production build 0.69.0 2024