verbb / vizy

A flexible visual editor for Craft CMS
Other
44 stars 8 forks source link

Cannot use object of type verbb\vizy\models\NodeCollection as array #107

Closed gopeter closed 2 years ago

gopeter commented 2 years ago

Since updating to Vizy 1.0.10, I get errors from Craft queues and Graphql queries:

Cannot use object of type verbb\vizy\models\NodeCollection as array

or

{
  "errors": [
    {
      "debugMessage": "Cannot access private property verbb\\vizy\\models\\NodeCollection::$nodes",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "file": "/var/www/html/vendor/verbb/vizy/src/gql/types/NodeCollectionType.php",
      "line": 68,
      "trace": [
        {
          "file": "/var/www/html/vendor/craftcms/cms/src/gql/base/ObjectType.php",
          "line": 47,
          "call": "verbb\\vizy\\gql\\types\\NodeCollectionType::resolve(instance of verbb\\vizy\\models\\NodeCollection(445), array(0), array(2), instance of GraphQL\\Type\\Definition\\ResolveInfo)"
        },
        {
          "file": "/var/www/html/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
          "line": 623,
          "call": "craft\\gql\\base\\ObjectType::resolveWithDirectives(instance of verbb\\vizy\\models\\NodeCollection(445), array(0), array(2), instance of GraphQL\\Type\\Definition\\ResolveInfo)"
        },
...
engram-design commented 2 years ago

Fixed for the next release. To get the fix early, change your verbb/vizy requirement in composer.json to:

"require": {
  "verbb/vizy": "dev-craft-3 as 1.0.10",
  "...": "..."
}

Then run composer update.

gopeter commented 2 years ago

Thanks! Works in my Graphql queries, but I still get the errors in my queues:

image

engram-design commented 2 years ago

Just pushed a fix for this, as I believe it's an issue due to nested Vizy fields. Just run the same command again as above.

gopeter commented 2 years ago

Works fine, thanks :)

engram-design commented 2 years ago

Fixed in 1.0.11