scandipwa / scandipwa

Next-generation front-end for Magento 2

Home Page:https://scandipwa.com/?utm_source=github&utm_medium=readme&utm_campaign=general

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PQ Flush fails due to invalid return type

robertdeboer opened this issue · comments

Steps to reproduce:

  1. SSH into the Magento instance
  2. Run ./bin/magento scandipwa:pq:flush

Actual result
The command fails with the following error:

There is an error in /app/vendor/symfony/console/Command/Command.php at line: 301
Return value of "ScandiPWA\PersistedQuery\Console\Command\PersistedQueryFlushCommand\Interceptor::execute()" must be of the type int, "null"

Expected result
The command should finish and the success message display Persisted query caches flushed (redis + varnish)

Testing details
Screenshot/Screencast
The first command shows a patch applied, the second command is with no patch applied

image

Versions

  • ScandiPWA: 6.2.2
  • Magento: 2.4.6-p2
  • PHP: 8.1
  • OS: Any

Additional context
I was able to remove the error by applying the following patch file locally.

diff --git a/src/Console/Command/PersistedQueryFlushCommand.php b/src/Console/Command/PersistedQueryFlushCommand.php
--- a/src/Console/Command/PersistedQueryFlushCommand.php
+++ b/src/Console/Command/PersistedQueryFlushCommand.php	(date 1694446502989)
@@ -56,6 +56,8 @@
         if ($this->query->clean()) {
             $output->writeln('Persisted query caches flushed (redis + varnish)');
         }
+
+        return 1;
     }

 }