invoker-community icon indicating copy to clipboard operation
invoker-community copied to clipboard

Creating Trend widget causes a FatalError

Open adampatterson opened this issue 1 year ago • 1 comments


OS: darwin Invoker Version: 2.13.1 Laravel Version: 10.17 Local project: true PHP Binary: /opt/homebrew/Cellar/php/8.2.8/bin/php Route: /project/index?class=App%5CModels%5CInvoice&time=1692027774627&project=local-hyLt5zswyaqmohewQmjtHR

Error:

Symfony\Component\ErrorHandler\Error\FatalError 

  Declaration of _HumbugBox691400d5ac8c\Invoker\Metrics\MySqlTrendDateExpression::getValue() must be compatible with Illuminate\Database\Query\Expression::getValue(Illuminate\Database\Grammar $grammar)

  at phar:/Applications/Invoker.app/Contents/Resources/invoker_l10.phar/src/Metrics/MySqlTrendDateExpression.php:7
      3▕ namespace _HumbugBox691400d5ac8c\Invoker\Metrics;
      4▕ 
      5▕ class MySqlTrendDateExpression extends \_HumbugBox691400d5ac8c\Invoker\Metrics\TrendDateExpression
      6▕ {
  ➜   7▕     public function getValue()
      8▕     {
      9▕         switch ($this->unit) {
     10▕             case 'months':
     11▕                 return "date_format({$this->wrap($this->column)}, '%Y-%m')";

      [2m+6 vendor frames [22m

  7   phar:/Applications/Invoker.app/Contents/Resources/invoker_l10.phar/src/Metrics/TrendDateExpressionFactory.php:16
      Composer\Autoload\ClassLoader::loadClass("'_HumbugBox691400d5ac8c\\Invoker\\Metrics\\MySqlTrendDateExpression'")

  8   phar:/Applications/Invoker.app/Contents/Resources/invoker_l10.phar/src/Actions/CalculateWidgetAction.php:104
      _HumbugBox691400d5ac8c\Invoker\Metrics\TrendDateExpressionFactory::make("class Illuminate\Database\Eloquent\Builder { protected $query = class Illuminate\Database\Query\Builder { public $connection = class Illuminate\Database\MySqlConnection { ... }; public $grammar = class Illuminate\Database\Query\Grammars\MySqlGrammar { ... }; public $processor = class Illuminate\Database\Query\Processors\MySqlProcessor { ... }; public $bindings = [...]; public $aggregate = NULL; public $columns = NULL; public $distinct = FALSE; public $from = 'invoices'; public $indexHint = NULL; public $joins = NULL; public $wheres = [...]; public $groups = NULL; public $havings = NULL; public $orders = NULL; public $limit = NULL; public $offset = NULL; public $unions = NULL; public $unionLimit = NULL; public $unionOffset = NULL; public $unionOrders = NULL; public $lock = NULL; public $beforeQueryCallbacks = [...]; public $operators = [...]; public $bitwiseOperators = [...]; public $useWritePdo = FALSE }; protected $model = class App\Models\Invoice { protected $connection = NULL; prote...", "'created_at'", "'days'")


   Whoops\Exception\ErrorException 

  Declaration of _HumbugBox691400d5ac8c\Invoker\Metrics\MySqlTrendDateExpression::getValue() must be compatible with Illuminate\Database\Query\Expression::getValue(Illuminate\Database\Grammar $grammar)

  at phar:/Applications/Invoker.app/Contents/Resources/invoker_l10.phar/src/Metrics/MySqlTrendDateExpression.php:7
      3▕ namespace _HumbugBox691400d5ac8c\Invoker\Metrics;
      4▕ 
      5▕ class MySqlTrendDateExpression extends \_HumbugBox691400d5ac8c\Invoker\Metrics\TrendDateExpression
      6▕ {
  ➜   7▕     public function getValue()
      8▕     {
      9▕         switch ($this->unit) {
     10▕             case 'months':
     11▕                 return "date_format({$this->wrap($this->column)}, '%Y-%m')";

      [2m+1 vendor frames [22m

  2   [internal]:0
      Whoops\Run::handleShutdown()

adampatterson avatar Aug 14 '23 16:08 adampatterson

Currently there does not appear to be a way to get any combination of a Trend to work. Once they fix this bug it would be helpful to see some working examples for the Query box or custom options, and how those are used in conjunction with the other input fields on the widget modal.

daniel-wright avatar Sep 02 '23 23:09 daniel-wright