Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with ebess/advanced-nova-media-library #130

Open
johnpuddephatt opened this issue Sep 7, 2022 · 3 comments
Open

Not working with ebess/advanced-nova-media-library #130

johnpuddephatt opened this issue Sep 7, 2022 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@johnpuddephatt
Copy link

Error message Call to undefined method stdClass::getMedia() shown.

The problem appears to be that the resolve function in ebess/advanced-nova-media-library expects to have been passed the model and so to be able to access methods on the model.

Whereas in the getFields method in PageManagerController in outl1ne/nova-page-manager, only the model data is passed rather than the actual model.

I would imagine this could cause problems with other fields that access model relations?

Stack trace
{
  "message": "Call to undefined method stdClass::getMedia()",
  "exception": "Error",
  "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/ebess/advanced-nova-media-library/src/Fields/Media.php",
  "line": 289,
  "trace": [
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/nova/src/Fields/FieldCollection.php",
          "line": 78,
          "function": "resolve",
          "class": "Ebess\\AdvancedNovaMediaLibrary\\Fields\\Media",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php",
          "line": 262,
          "function": "Laravel\\Nova\\Fields\\{closure}",
          "class": "Laravel\\Nova\\Fields\\FieldCollection",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/nova/src/Fields/FieldCollection.php",
          "line": 80,
          "function": "each",
          "class": "Illuminate\\Support\\Collection",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/outl1ne/nova-page-manager/src/Http/Controllers/PageManagerController.php",
          "line": 60,
          "function": "resolve",
          "class": "Laravel\\Nova\\Fields\\FieldCollection",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
          "line": 54,
          "function": "getFields",
          "class": "Outl1ne\\PageManager\\Http\\Controllers\\PageManagerController",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
          "line": 45,
          "function": "callAction",
          "class": "Illuminate\\Routing\\Controller",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
          "line": 261,
          "function": "dispatch",
          "class": "Illuminate\\Routing\\ControllerDispatcher",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
          "line": 204,
          "function": "runController",
          "class": "Illuminate\\Routing\\Route",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
          "line": 725,
          "function": "run",
          "class": "Illuminate\\Routing\\Route",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 141,
          "function": "Illuminate\\Routing\\{closure}",
          "class": "Illuminate\\Routing\\Router",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/outl1ne/nova-page-manager/src/Http/Middleware/AuthorizeMiddleware.php",
          "line": 18,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Outl1ne\\PageManager\\Http\\Middleware\\AuthorizeMiddleware",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/whitecube/nova-flexible-content/src/Http/Middleware/InterceptFlexibleAttributes.php",
          "line": 27,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Whitecube\\NovaFlexibleContent\\Http\\Middleware\\InterceptFlexibleAttributes",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/nova/src/Http/Middleware/BootTools.php",
          "line": 20,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Laravel\\Nova\\Http\\Middleware\\BootTools",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/nova/src/Http/Middleware/DispatchServingNovaEvent.php",
          "line": 24,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Laravel\\Nova\\Http\\Middleware\\DispatchServingNovaEvent",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/inertiajs/inertia-laravel/src/Middleware.php",
          "line": 92,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Inertia\\Middleware",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
          "line": 50,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php",
          "line": 78,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php",
          "line": 49,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
          "line": 121,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
          "line": 64,
          "function": "handleStatefulRequest",
          "class": "Illuminate\\Session\\Middleware\\StartSession",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Session\\Middleware\\StartSession",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php",
          "line": 37,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php",
          "line": 67,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Cookie\\Middleware\\EncryptCookies",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 116,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
          "line": 726,
          "function": "then",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
          "line": 703,
          "function": "runRouteWithinStack",
          "class": "Illuminate\\Routing\\Router",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
          "line": 667,
          "function": "runRoute",
          "class": "Illuminate\\Routing\\Router",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
          "line": 656,
          "function": "dispatchToRoute",
          "class": "Illuminate\\Routing\\Router",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
          "line": 167,
          "function": "dispatch",
          "class": "Illuminate\\Routing\\Router",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 141,
          "function": "Illuminate\\Foundation\\Http\\{closure}",
          "class": "Illuminate\\Foundation\\Http\\Kernel",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/livewire/livewire/src/DisableBrowserCache.php",
          "line": 19,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Livewire\\DisableBrowserCache",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/nova/src/Http/Middleware/ServeNova.php",
          "line": 23,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Laravel\\Nova\\Http\\Middleware\\ServeNova",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
          "line": 21,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php",
          "line": 31,
          "function": "handle",
          "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
          "line": 21,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php",
          "line": 40,
          "function": "handle",
          "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Foundation\\Http\\Middleware\\TrimStrings",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
          "line": 27,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
          "line": 86,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/fruitcake/laravel-cors/src/HandleCors.php",
          "line": 38,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Fruitcake\\Cors\\HandleCors",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php",
          "line": 39,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Illuminate\\Http\\Middleware\\TrustProxies",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkMiddleware.php",
          "line": 24,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 180,
          "function": "handle",
          "class": "Clockwork\\Support\\Laravel\\ClockworkMiddleware",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
          "line": 116,
          "function": "Illuminate\\Pipeline\\{closure}",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
          "line": 142,
          "function": "then",
          "class": "Illuminate\\Pipeline\\Pipeline",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
          "line": 111,
          "function": "sendRequestThroughRouter",
          "class": "Illuminate\\Foundation\\Http\\Kernel",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/Sites/hpph2/public/index.php",
          "line": 52,
          "function": "handle",
          "class": "Illuminate\\Foundation\\Http\\Kernel",
          "type": "->"
      },
      {
          "file": "/Users/johnpuddephatt/.composer/vendor/laravel/valet/server.php",
          "line": 234,
          "function": "require"
      }
  ]
}
@trippo
Copy link
Contributor

trippo commented Dec 13, 2022

I have the same problem, how can you manage images in your admin?

@trippo
Copy link
Contributor

trippo commented Dec 13, 2022

@mbardelmeijer
Copy link

Running into this as well. Are there any known workarounds/possible fixes for this?

@Tarpsvo Tarpsvo added the help wanted Extra attention is needed label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants