Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]/[3.x]: Argument 1 passed to craft\helpers\App::editionIdByHandle() must be of the type string #12899

Closed
Zae opened this issue Mar 15, 2023 · 2 comments

Comments

@Zae
Copy link

Zae commented Mar 15, 2023

What happened?

Description

After updating to CraftCMS 3.8 or CraftCMS 4.4 I keep getting this error in several projects.

Argument 1 passed to craft\helpers\App::editionIdByHandle() must be of the type string

Steps to reproduce

  1. Have a craft install without a valid license (trial?)
  2. Update to 3.8 or 4.4 from lower.
  3. Open the CP
  4. Refresh
  5. Error

Expected behavior

  1. It works like before

Actual behavior

Error: Argument 1 passed to craft\helpers\App::editionIdByHandle() must be of the type string

What I found out during debugging, is that it seems that the "Consolidated Licensing Issues alert" commit has added some additonal code that writes the licenseInfo to the cache.

However, when the license is "invalid" it will write NULL to the edition field, when this value is fetched from the cache on the next refresh, the value of edition will be passed into the editionIdByHandle function, which requires a string as edition not a NULL, so PHP screams.

Craft CMS version

3.8 / 4.4

PHP version

7.4 / 8.2

Operating system and version

Linux 5.15.49 aarch64 (docker m1)

Database type and version

MySQL 8

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

Thanks for reporting that! Fixed for the next Craft 3 and 4 releases.

To get the fix early, change your craftcms/cms requirement in composer.json to:

  • Craft 3: v3-dev#89c7c16c3ac0c061ba8ed9fcccf34f64c4c46bfe as 3.8.2
  • Craft 4: dev-develop#605a210c6e9524f8d2781d34e63329a76408936d as 4.4.2

Then run composer update.

@brandonkelly
Copy link
Member

3.8.3 and 4.4.3 are out with that fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants