Skip to content

Commit afd2458

Browse files
authored
bug: Fix semver fatal error (#359)
* Added composer patch to fix Semver object key issue The object key "Version" should be "version" and this is causing a fatal error on Site Heath info tab * Added Changeset * Fixed paths in the patch
1 parent dc7a27f commit afd2458

File tree

4 files changed

+77
-3
lines changed

4 files changed

+77
-3
lines changed

.changeset/modern-pigs-matter.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@wpengine/wp-graphql-content-blocks": patch
3+
---
4+
5+
bug: Fixes fatal error on the Site Health page for the info tab. Caused by a naming of the wrong object key in the Semver package.

composer.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"require": {
88
"php": ">=7.4",
99
"imangazaliev/didom": "^2.0",
10-
"blakewilson/wp-enforce-semver": "^3.0"
10+
"blakewilson/wp-enforce-semver": "^3.0",
11+
"cweagans/composer-patches": "^1"
1112
},
1213
"require-dev": {
1314
"brain/monkey": "^2.6",
@@ -37,7 +38,8 @@
3738
"config": {
3839
"allow-plugins": {
3940
"dealerdirect/phpcodesniffer-composer-installer": true,
40-
"phpstan/extension-installer": true
41+
"phpstan/extension-installer": true,
42+
"cweagans/composer-patches": true
4143
},
4244
"platform": {
4345
"php": "7.4"
@@ -58,5 +60,12 @@
5860
"psr-4": {
5961
"WPGraphQL\\ContentBlocks\\Unit\\": "tests/unit/"
6062
}
63+
},
64+
"extra": {
65+
"patches": {
66+
"blakewilson/wp-enforce-semver": {
67+
"Fixes version key case": "patches/blakewilson-wp-enforce-semver/semver-object-key-version.patch"
68+
}
69+
}
6170
}
6271
}

composer.lock

Lines changed: 49 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/src/EnforceSemVer.php b/src/EnforceSemVer.php
2+
--- a/src/EnforceSemVer.php
3+
+++ b/src/EnforceSemVer.php (date 1741188709127)
4+
@@ -63,7 +63,7 @@
5+
*/
6+
if (
7+
$this->plugin_filename === $item->plugin &&
8+
- $this->does_new_version_have_major_change( $item->new_version, $item->Version ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
9+
+ $this->does_new_version_have_major_change( $item->new_version, $item->version ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
10+
return false;
11+
} else {
12+
return $update;

0 commit comments

Comments
 (0)