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

User Model missing methods #2795

Closed
crackAT opened this issue Nov 4, 2020 · 5 comments
Closed

User Model missing methods #2795

crackAT opened this issue Nov 4, 2020 · 5 comments

Comments

@crackAT
Copy link

crackAT commented Nov 4, 2020

Bug Description

Changed User Management to Database but getting in some cases an Model error. Like password function is missing, after new User clicked on the E-Mail link.

BadMethodCallException Call to undefined method App\Models\User::password()

Also last login is still NULL.

How to Reproduce

Add new User, send E-Mail, click on the E-Mail Link

Extra Detail

BadMethodCallExceptionPOST /!/auth/activate
Call to undefined method App\Models\User::password()

Stacktrace:

BadMethodCallException Call to undefined method App\Models\User::password() 
    vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50 Illuminate\Database\Eloquent\Model::throwBadMethodCallException
    vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:36 Illuminate\Database\Eloquent\Model::forwardCallTo
    vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1757 Illuminate\Database\Eloquent\Model::__call
    vendor/statamic/cms/src/Http/Controllers/ResetPasswordController.php:52 Statamic\Http\Controllers\ResetPasswordController::resetPassword
    vendor/statamic/cms/src/Auth/ResetsPasswords.php:56 Statamic\Http\Controllers\ResetPasswordController::Statamic\Auth\{closure}
    vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php:100 Illuminate\Auth\Passwords\PasswordBroker::reset
    vendor/statamic/cms/src/Auth/ResetsPasswords.php:57 Statamic\Http\Controllers\ResetPasswordController::reset
    vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54 Illuminate\Routing\Controller::callAction
    vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45 Illuminate\Routing\ControllerDispatcher::dispatch
    vendor/laravel/framework/src/Illuminate/Routing/Route.php:255 Illuminate\Routing\Route::runController
    vendor/laravel/framework/src/Illuminate/Routing/Route.php:197 Illuminate\Routing\Route::run
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:691 Illuminate\Routing\Router::Illuminate\Routing\{closure}
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:128 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/statamic/cms/src/Http/Middleware/RedirectIfAuthenticated.php:24 Statamic\Http\Middleware\RedirectIfAuthenticated::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:41 Illuminate\Routing\Middleware\SubstituteBindings::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:77 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49 Illuminate\View\Middleware\ShareErrorsFromSession::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:121 Illuminate\Session\Middleware\StartSession::handleStatefulRequest
    vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:63 Illuminate\Session\Middleware\StartSession::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:67 Illuminate\Cookie\Middleware\EncryptCookies::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/statamic/cms/src/StaticCaching/Middleware/Retrieve.php:34 Statamic\StaticCaching\Middleware\Retrieve::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103 Illuminate\Pipeline\Pipeline::then
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:693 Illuminate\Routing\Router::runRouteWithinStack
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:668 Illuminate\Routing\Router::runRoute
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:634 Illuminate\Routing\Router::dispatchToRoute
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:623 Illuminate\Routing\Router::dispatch
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:166 Illuminate\Foundation\Http\Kernel::Illuminate\Foundation\Http\{closure}
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:128 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php:14 Statamic\Http\Middleware\CheckMultisite::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php:19 Statamic\Http\Middleware\PoweredByHeader::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21 Illuminate\Foundation\Http\Middleware\TransformsRequest::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21 Illuminate\Foundation\Http\Middleware\TransformsRequest::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27 Illuminate\Foundation\Http\Middleware\ValidatePostSize::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:87 Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/fruitcake/laravel-cors/src/HandleCors.php:37 Fruitcake\Cors\HandleCors::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/fideloper/proxy/src/TrustProxies.php:57 Fideloper\Proxy\TrustProxies::handle
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103 Illuminate\Pipeline\Pipeline::then
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:141 Illuminate\Foundation\Http\Kernel::sendRequestThroughRouter
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:110 Illuminate\Foundation\Http\Kernel::handle
    public/index.php:52 [main]

Environment

Statamic version: 3.0.{?}
Statamic 3.0.22 Pro Laravel 8.12.3 PHP 7.3.11 phpsa/statamic-analytics 1.0.0 rias/statamic-redirect 1.3.1 statamic/seo-pro 2.0.14
PHP version: 7.{?}

Install method (choose one):

  • Existing Laravel app
@crackAT crackAT changed the title User Model User Model missing methods Nov 4, 2020
@jasonvarga
Copy link
Member

Can you please provide your config/auth.php and config/statamic/users.php?

@crackAT
Copy link
Author

crackAT commented Nov 4, 2020

sure, attached both files.
statamic_user_config.zip

@crackAT
Copy link
Author

crackAT commented Nov 4, 2020

for record: i changed the user storage as described in the documentation: https://statamic.dev/knowledge-base/storing-users-in-a-database
also tried to change the user model to the statamic user model = white screen

@jasonvarga
Copy link
Member

Thanks! I think I see the issue. It's not you, it's me.
Also, you don't need to change the model in your config.

@jasonvarga jasonvarga added the bug label Nov 4, 2020
@crackAT
Copy link
Author

crackAT commented Nov 23, 2020

Hei, is there any workaround? Can I copy a User class from the statamic vendor folder?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants