From 027166a186bbc16e861d6dbe8c67cb36f8b70ec9 Mon Sep 17 00:00:00 2001 From: Justin Busa Date: Wed, 15 Sep 2021 08:45:56 -0700 Subject: [PATCH 1/4] Fixed exporting customizer settings throwing a fatal error. Init on wp_loaded instead of plugins_loaded. --- .../Hooks/Actions/{OnPluginsLoaded.php => OnWPLoaded.php} | 4 ++-- backend/src/Providers/HooksServiceProvider.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename backend/src/Hooks/Actions/{OnPluginsLoaded.php => OnWPLoaded.php} (90%) diff --git a/backend/src/Hooks/Actions/OnPluginsLoaded.php b/backend/src/Hooks/Actions/OnWPLoaded.php similarity index 90% rename from backend/src/Hooks/Actions/OnPluginsLoaded.php rename to backend/src/Hooks/Actions/OnWPLoaded.php index d03d33d8..8932254e 100644 --- a/backend/src/Hooks/Actions/OnPluginsLoaded.php +++ b/backend/src/Hooks/Actions/OnWPLoaded.php @@ -5,10 +5,10 @@ use FL\Assistant\Services\CustomizerService; /** - * Class OnPluginsLoaded + * Class OnWPLoaded * @package FL\Assistant\Hooks\Actions */ -class OnPluginsLoaded { +class OnWPLoaded { public function __invoke() { $this->init_customizer_requests(); diff --git a/backend/src/Providers/HooksServiceProvider.php b/backend/src/Providers/HooksServiceProvider.php index e616837c..9ea40fb3 100644 --- a/backend/src/Providers/HooksServiceProvider.php +++ b/backend/src/Providers/HooksServiceProvider.php @@ -4,7 +4,7 @@ use FL\Assistant\System\Contracts\ServiceProviderAbstract; -use FL\Assistant\Hooks\Actions\OnPluginsLoaded; +use FL\Assistant\Hooks\Actions\OnWPLoaded; use FL\Assistant\Hooks\Actions\OnEditUserProfile; use FL\Assistant\Hooks\Actions\OnEnqueueScripts; use FL\Assistant\Hooks\Actions\OnPersonalOptionsUpdate; @@ -45,8 +45,8 @@ public function bootstrap() { public function actions() { - // Plugins loaded - add_action( 'plugins_loaded', $this->injector->make( OnPluginsLoaded::class ) ); + // WP loaded + add_action( 'wp_loaded', $this->injector->make( OnWPLoaded::class ) ); // Enqueue Assistant frontend $enqueue_scripts = $this->injector->make( OnEnqueueScripts::class ); From badd2bcc7e934bcee700b051995dabe533ef6a62 Mon Sep 17 00:00:00 2001 From: Justin Busa Date: Wed, 15 Sep 2021 08:56:12 -0700 Subject: [PATCH 2/4] Don't import screenshots as featured images. --- .../Cloud/Libraries/LibraryItemPostController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/Controllers/Cloud/Libraries/LibraryItemPostController.php b/backend/src/Controllers/Cloud/Libraries/LibraryItemPostController.php index 8fd5076b..d6b7482f 100644 --- a/backend/src/Controllers/Cloud/Libraries/LibraryItemPostController.php +++ b/backend/src/Controllers/Cloud/Libraries/LibraryItemPostController.php @@ -482,9 +482,11 @@ public function import_post_media_from_library( $post_id, $media, $import = true $service = new MediaLibraryService(); // Import post thumbnail - if ( $import && isset( $media->thumb ) && 'screenshot.png' !== $media->thumb->file_name ) { - $response = $service->import_cloud_media( $media->thumb, $post_id ); - set_post_thumbnail( $post_id, $response['id'] ); + if ( $import && isset( $media->thumb ) ) { + if ( ! preg_match( '/screenshot\.(png|jpg|gif)/', $media->thumb->file_name ) ) { + $response = $service->import_cloud_media( $media->thumb, $post_id ); + set_post_thumbnail( $post_id, $response['id'] ); + } } // Import post attachments From 1dca75d89a3551b3896b69d772c27da08ac3de05 Mon Sep 17 00:00:00 2001 From: Justin Busa Date: Wed, 15 Sep 2021 10:28:02 -0700 Subject: [PATCH 3/4] Fixed react errors. Bumped packages. --- package-lock.json | 64 ++++++++++++++++++------------------- package.json | 8 ++--- src/apps/fl-updates/icon.js | 4 +-- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index f3f214df..4c73868f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,10 +13,10 @@ "@beaverbuilder/box": "0.0.3", "@beaverbuilder/cloud": "^0.5.5", "@beaverbuilder/cloud-ui": "^0.8.4", - "@beaverbuilder/fluid": "^0.7.8", - "@beaverbuilder/fluid-docs": "0.0.6", - "@beaverbuilder/forms": "^0.3.8", - "@beaverbuilder/icons": "0.0.5", + "@beaverbuilder/fluid": "^0.7.9", + "@beaverbuilder/fluid-docs": "0.0.7", + "@beaverbuilder/forms": "^0.3.11", + "@beaverbuilder/icons": "^0.0.6", "@popmotion/popcorn": "^0.4.4", "array-move": "^3.0.1", "axios": "0.21.1", @@ -1697,14 +1697,14 @@ } }, "node_modules/@beaverbuilder/fluid": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid/-/fluid-0.7.8.tgz", - "integrity": "sha512-Khm9aeleKxtt1h+Xthlh6xqltrqyGlwVGJEhG26UY9NoxI0L7b46eoyhcBqIk5ur0ud1bucaRCdqarUXRZnxKA==", + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid/-/fluid-0.7.9.tgz", + "integrity": "sha512-DMvbvjUwXiMGzYzNbHwqEcMmBvbtTFqY12hcufK/9VHglGM8CIiHGeuUGo6MQpsPywy3/vkR+1wdESKwR6286w==", "dependencies": { "classnames": "^2.2.6" }, "peerDependencies": { - "@beaverbuilder/icons": "^0.0.5", + "@beaverbuilder/icons": "~0.0.5", "framer-motion": "^3.10.5", "react": "^17.0.2", "react-dom": "^17.0.2", @@ -1713,36 +1713,36 @@ } }, "node_modules/@beaverbuilder/fluid-docs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid-docs/-/fluid-docs-0.0.6.tgz", - "integrity": "sha512-TLvWfgoY4RC7C1i/yVKenpWrWUaINyPnk4jEU70BZpBTQgUHRCWNLyLKJZscpwwPPWjGyKMQEURFS2b7G1jK9A==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid-docs/-/fluid-docs-0.0.7.tgz", + "integrity": "sha512-UetLDS5lWrV6Nx8nY3WDCldFIIL1H/s67Lm60E2nmATDwmeXUlOX8hEF6ZWqscFIWo2tWvYtxzoRIN5bFAW7Tw==", "dependencies": { "camelcase": "^5.3.1" }, "peerDependencies": { "@beaverbuilder/fluid": "^0.7.8", - "@beaverbuilder/icons": "^0.0.5", + "@beaverbuilder/icons": "~0.0.5", "react": "^17.0.2", "react-router-dom": "^5.2.0" } }, "node_modules/@beaverbuilder/forms": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@beaverbuilder/forms/-/forms-0.3.9.tgz", - "integrity": "sha512-KE00hXEFL9rhx9JXMZ6LMQf0CWWWa26VeN5/dIm8D8srM2pkP9j+Ery1Maa8efh8jnz1cLN50JGneG+B/F2u1w==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@beaverbuilder/forms/-/forms-0.3.11.tgz", + "integrity": "sha512-sJsOzOIc+n/TPYZhHNu038oi2FJTZ+BHxNmlbnCBLIg76dWV6ZiIIXiKQ7jw80jETUeP3W2jVA0bJGngz39fZA==", "peerDependencies": { "@beaverbuilder/fluid": "^0.7.8", - "@beaverbuilder/icons": "0.0.5", - "@wordpress/i18n": "^3.13.0", + "@beaverbuilder/icons": "~0.0.5", + "@wordpress/i18n": "^3.15.0", "classnames": "^2.2.6", "react": "^17.0.2", "react-router-dom": "^5.2.0" } }, "node_modules/@beaverbuilder/icons": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@beaverbuilder/icons/-/icons-0.0.5.tgz", - "integrity": "sha512-RRmfJwKFikEDrWfrDvYAlsifLEbnoWlK3U9XxmIxFCfVey/Vlo3pblKB1ujdbXRAIWTJr7nk7ddK7excsD/aJQ==", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@beaverbuilder/icons/-/icons-0.0.6.tgz", + "integrity": "sha512-hxoO8MzXb1+yul8tXA6tF0XY9Xypb+UqZ7c0zWSQ5SWD3hKh/wdS7z9RgCjEXaYZIJDBoOp3TzSJE4VYZI4nwQ==", "peerDependencies": { "react": "^17.0.2" } @@ -21324,31 +21324,31 @@ } }, "@beaverbuilder/fluid": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid/-/fluid-0.7.8.tgz", - "integrity": "sha512-Khm9aeleKxtt1h+Xthlh6xqltrqyGlwVGJEhG26UY9NoxI0L7b46eoyhcBqIk5ur0ud1bucaRCdqarUXRZnxKA==", + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid/-/fluid-0.7.9.tgz", + "integrity": "sha512-DMvbvjUwXiMGzYzNbHwqEcMmBvbtTFqY12hcufK/9VHglGM8CIiHGeuUGo6MQpsPywy3/vkR+1wdESKwR6286w==", "requires": { "classnames": "^2.2.6" } }, "@beaverbuilder/fluid-docs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid-docs/-/fluid-docs-0.0.6.tgz", - "integrity": "sha512-TLvWfgoY4RC7C1i/yVKenpWrWUaINyPnk4jEU70BZpBTQgUHRCWNLyLKJZscpwwPPWjGyKMQEURFS2b7G1jK9A==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid-docs/-/fluid-docs-0.0.7.tgz", + "integrity": "sha512-UetLDS5lWrV6Nx8nY3WDCldFIIL1H/s67Lm60E2nmATDwmeXUlOX8hEF6ZWqscFIWo2tWvYtxzoRIN5bFAW7Tw==", "requires": { "camelcase": "^5.3.1" } }, "@beaverbuilder/forms": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@beaverbuilder/forms/-/forms-0.3.9.tgz", - "integrity": "sha512-KE00hXEFL9rhx9JXMZ6LMQf0CWWWa26VeN5/dIm8D8srM2pkP9j+Ery1Maa8efh8jnz1cLN50JGneG+B/F2u1w==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@beaverbuilder/forms/-/forms-0.3.11.tgz", + "integrity": "sha512-sJsOzOIc+n/TPYZhHNu038oi2FJTZ+BHxNmlbnCBLIg76dWV6ZiIIXiKQ7jw80jETUeP3W2jVA0bJGngz39fZA==", "requires": {} }, "@beaverbuilder/icons": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@beaverbuilder/icons/-/icons-0.0.5.tgz", - "integrity": "sha512-RRmfJwKFikEDrWfrDvYAlsifLEbnoWlK3U9XxmIxFCfVey/Vlo3pblKB1ujdbXRAIWTJr7nk7ddK7excsD/aJQ==", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@beaverbuilder/icons/-/icons-0.0.6.tgz", + "integrity": "sha512-hxoO8MzXb1+yul8tXA6tF0XY9Xypb+UqZ7c0zWSQ5SWD3hKh/wdS7z9RgCjEXaYZIJDBoOp3TzSJE4VYZI4nwQ==", "requires": {} }, "@beaverbuilder/webpack-config": { diff --git a/package.json b/package.json index 6484be72..579a97e7 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "@beaverbuilder/box": "0.0.3", "@beaverbuilder/cloud": "^0.5.5", "@beaverbuilder/cloud-ui": "^0.8.4", - "@beaverbuilder/fluid": "^0.7.8", - "@beaverbuilder/fluid-docs": "0.0.6", - "@beaverbuilder/forms": "^0.3.8", - "@beaverbuilder/icons": "0.0.5", + "@beaverbuilder/fluid": "^0.7.9", + "@beaverbuilder/fluid-docs": "0.0.7", + "@beaverbuilder/forms": "^0.3.11", + "@beaverbuilder/icons": "^0.0.6", "@popmotion/popcorn": "^0.4.4", "array-move": "^3.0.1", "axios": "0.21.1", diff --git a/src/apps/fl-updates/icon.js b/src/apps/fl-updates/icon.js index 239ca1f9..d8282d60 100644 --- a/src/apps/fl-updates/icon.js +++ b/src/apps/fl-updates/icon.js @@ -1,8 +1,8 @@ import React from 'react' -import { useSystemState } from 'assistant/data' +import { getSystemState } from 'assistant/data' const AppIcon = ( { context, isSelected = false } ) => { - const { counts } = useSystemState() + const { counts } = getSystemState() const total = counts['update/total'] ? counts['update/total'] : 0 const shouldHighlight = 'sidebar' === context && 0 < total const color = ( shouldHighlight && ! isSelected ) ? 'var(--fluid-blue)' : 'currentColor' From 13996f17a0a39aa11fa8d9bc183c01b38a3ff747 Mon Sep 17 00:00:00 2001 From: Justin Busa Date: Wed, 15 Sep 2021 10:35:13 -0700 Subject: [PATCH 4/4] Fixed the last of the react errors. --- src/apps/fl-home/ui/header-bar/index.js | 1 + src/apps/fl-home/ui/sections/media/index.js | 3 ++- src/apps/fl-home/ui/sections/recent-posts/index.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apps/fl-home/ui/header-bar/index.js b/src/apps/fl-home/ui/header-bar/index.js index 302a230b..d8970adb 100644 --- a/src/apps/fl-home/ui/header-bar/index.js +++ b/src/apps/fl-home/ui/header-bar/index.js @@ -56,6 +56,7 @@ const HeaderBar = ( { setIsFocused( true ) onFocus() } } + onChange={ () => {} } // Prevent react error />