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

Fix error when setting license key from command line #19118

Merged
merged 1 commit into from Apr 20, 2022

Conversation

bx80
Copy link
Contributor

@bx80 bx80 commented Apr 19, 2022

Description:

Attempting to set a plugin license key with ./console marketplace:set-license-key --license-key="xxx" results in the error

Uncaught exception: Error: Class "Piwik\Plugins\Marketplace\Api" not found in 
/var/www/matomo/plugins/Marketplace/Commands/SetLicenseKey.php:39

(Debian 11 running PHP 8.1.1)

This error appears to be caused by case sensitivity on the referenced class name, where the class name is API but the the referenced class is Api which is not PSR-4 compliant. Changing the referenced class name to API fixes the error.

Ref L3-258

Review

@bx80 bx80 added the Bug For errors / faults / flaws / inconsistencies etc. label Apr 19, 2022
@bx80 bx80 added this to the 4.10.0 milestone Apr 19, 2022
@bx80 bx80 self-assigned this Apr 19, 2022
@bx80 bx80 added the Needs Review PRs that need a code review label Apr 19, 2022
@justinvelluppillai justinvelluppillai merged commit b330104 into 4.x-dev Apr 20, 2022
@justinvelluppillai justinvelluppillai deleted the L3-258-license-key-set branch April 20, 2022 00:13
@justinvelluppillai justinvelluppillai added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. and removed Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Apr 20, 2022
@sgiehl
Copy link
Member

sgiehl commented Apr 24, 2022

This is an error we actually might be able to prevent with phpcs. Might be useful to evaluate that maybe.

@justinvelluppillai justinvelluppillai changed the title Fix for error when setting license key from command line Fix error when setting license key from command line May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants