1. Apply the latest patch and create the last 1.x release.
  2. Create 2.x with the only difference from 1.x - PHP 7.3 requirement.

Comments

francoud created an issue. See original summary.

br0ken’s picture

Title: TypeError » Bump PHP version in cshs.info.yml to 7.3
Version: 8.x-1.5 » 8.x-1.x-dev

That's because the object type became available since PHP 7.2 (https://wiki.php.net/rfc/object-typehint). Drupal docs (https://www.drupal.org/docs/system-requirements/php-requirements) say the 7.1 is not recommended so I'd classify this issue as Bump PHP version in cshs.info.yml to 7.3.

If you're willing to continue using the module with PHP 7.1, I'd suggest finding all object $ and replacing them with \stdClass $ (2 occurrences for now) however the future versions of the module may/will receive more incompatible changes with PHP 7.1 so better option is to upgrade your PHP to 7.4.

br0ken’s picture

Status: Active » Needs review
StatusFileSize
new313 bytes

  • BR0kEN committed 9bb20a3 on 8.x-1.x
    Issue #3194532 by BR0kEN: Bump PHP version in cshs.info.yml to 7.3
    
br0ken’s picture

Status: Needs review » Fixed
br0ken’s picture

StatusFileSize
new813 bytes

Here is the patch for those who need PHP 7.1 support.

francoud’s picture

I'm afraid will take time until provider will update php, but really thanks for the *really quick* patch :)

andy-blum’s picture

Would it be too much trouble to create a new major version of this module? Updating to php 7.3 is a BC-breaking change and instead of having to reverse-patch every single new release could we just leave a version of CSHS static that supports php 7.1? I'm also in a situation where my hosting provider is locked to 7.2

br0ken’s picture

StatusFileSize
new1.1 KB

I see no difference between a version that will not receive updates and a situation where the patch to support PHP 7.1 should be applied. Actually, as long as the patch is applicable, you get the latest codebase adopted to PHP < 7.3.

Here is the updated one for the latest module version.

andy-blum’s picture

The problem is that this major version will continue to receive updates that will then require future patches. I've got my composer.json file pinning this module at "1.5" now so we don't have to worry about it being updated in the future. Sites using this module on PHP < 7.3 should NOT update to this, and doing so WILL break their sites. That's cause enough for a new major version.

Additionally, shouldn't this module's composer.json add php 7.3 as a dependency now?

br0ken’s picture

Additionally, shouldn't this module's composer.json add php 7.3 as a dependency now?

Probably it should.

The problem is that this major version will continue to receive updates that will then require future patches.

Ideally not, but most probably yes. That's the trade-off the one should accept sticking to the legacy software. Again, what is the purpose of freezing a codebase at the specific version that will never be updated? As you said, you can hardcode the version to which the latest patch from this issue is applicable and that will have the same effect.

  • BR0kEN committed b988ddd on 8.x-1.x
    Issue #3194532 by BR0kEN: Add `"php": ">=7.3.0"` to `composer.json`
    
br0ken’s picture

StatusFileSize
new1.37 KB
andy-blum’s picture

The purpose isn't to freeze a codebase, it's to split the new development into a new branch (8.x-2.x) so that you don't have to consistently re-patch your updates. Developers expect updates in the same major version to not break things. Since you're changing dependencies from php 7.1 to php 7.3 (which may not be an easy update or may not even be possible depending on other external factors) I would expect the module to create a new major version.

As it is now, there's no warning to developers that even though they might be using a version of PHP that's still supported (though not recommended) by core 8.x, this module will start to throw errors. A new major version branch where development moves to creates that clear line of demarcation

br0ken’s picture

Got the point. Makes sense.

br0ken’s picture

Title: Bump PHP version in cshs.info.yml to 7.3 » Rollback PHP 7.3 requirement and freeze the state at 1.x
Assigned: Unassigned » br0ken
Issue summary: View changes
Status: Fixed » Needs work

  • BR0kEN committed fb5b1b8 on 8.x-1.x
    Issue #3194532 by BR0kEN: Rollback PHP 7.3 requirement and freeze the...
br0ken’s picture

Assigned: br0ken » Unassigned
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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