jacksleight / statamic-memberbox

This Statamic addon adds a few member related extras on top of Statamic’s existing user features.
https://statamic.com/addons/jacksleight/memberbox
Other
2 stars 3 forks source link

local.ERROR: Method Statamic\Auth\UserCollection::columns does not exist. #12

Closed cemarta7 closed 2 years ago

cemarta7 commented 2 years ago

Bug Description

While trying to see the members it is giving the error. I do have one member. The site lang is es. Not sure if that is creating the issue. I got the language translations working fine. I check the Method Statamic\Auth\UserCollection::columns look at the second screenshot it is there as a private method. Maybe something change on a newer version of Statamic.

[2022-07-12 00:54:50] local.ERROR: Method Statamic\Auth\UserCollection::columns does not exist. {"userId":1,"exception":"[object] (BadMethodCallException(code: 0): Method Statamic\Auth\UserCollection::columns does not exist. at /Users/camilomartinez/Sites/conecta/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:113) [stacktrace]

0 /Users/camilomartinez/Sites/conecta/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(23): Illuminate\Support\Collection->__call('columns', Array)

1 /Users/camilomartinez/Sites/conecta/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php(785): Illuminate\Pagination\AbstractPaginator->forwardCallTo(Object(Statamic\Auth\UserCollection), 'columns', Array)

2 /Users/camilomartinez/Sites/conecta/vendor/statamic/cms/src/Extensions/Pagination/LengthAwarePaginator.php(39): Illuminate\Pagination\AbstractPaginator->__call('columns', Array)

3 /Users/camilomartinez/Sites/conecta/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(23): Statamic\Extensions\Pagination\LengthAwarePaginator->__call('columns', Array)

4 /Users/camilomartinez/Sites/conecta/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php(155): Illuminate\Http\Resources\Json\JsonResource->forwardCallTo(Object(Statamic\Extensions\Pagination\LengthAwarePaginator), 'columns', Array)

5 /Users/camilomartinez/Sites/conecta/vendor/jacksleight/statamic-memberbox/src/Http/Controllers/CP/MembersController.php(80): Illuminate\Http\Resources\Json\JsonResource->__call('columns', Array)

6 /Users/camilomartinez/Sites/conecta/vendor/jacksleight/statamic-memberbox/src/Http/Controllers/CP/MembersController.php(33): JackSleight\StatamicMemberbox\Http\Controllers\CP\MembersController->json(Object(Statamic\Http\Requests\FilteredRequest))

7 /Users/camilomartinez/Sites/conecta/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): JackSleight\StatamicMemberbox\Http\Controllers\CP\MembersController->index(Object(Statamic\Http\Requests\FilteredRequest))

How to Reproduce

Just click on the Members tab on the CP.

Extra Detail

Error screen

image

This is never reach

image

Environment

Statamic 3.3.18 Pro Laravel 9.11.0 PHP 8.0.20 cnj/seotamic 2.0.6 jacksleight/statamic-memberbox 1.0.0

cemarta7 commented 2 years ago

So the issue is that in Statamic 3.3 the method is private while on 3.2 it was public. image

cemarta7 commented 2 years ago

Solved with #13 for Statamic 3.3