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

Illegal offset type in isset or empty (version: 5.7) #26045

Closed
dalexhd opened this issue Oct 10, 2018 · 29 comments
Closed

Illegal offset type in isset or empty (version: 5.7) #26045

dalexhd opened this issue Oct 10, 2018 · 29 comments

Comments

@dalexhd
Copy link

dalexhd commented Oct 10, 2018

Url: "/password/email"

ErrorException
…/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php25

// If we've already parsed the given key, we'll return the cached version we
// already have, as this will save us some processing. We cache off every
// key we parse so we can quickly return it on all subsequent requests.
if (isset($this->parsed[$key])) {
    return $this->parsed[$key];
}
@dalexhd dalexhd changed the title Illegal offset type in isset or empty Illegal offset type in isset or empty (version: 5.7) Oct 10, 2018
@sisve
Copy link
Contributor

sisve commented Oct 10, 2018

What are the steps to reproduce it so we can add a test for the fix?

@dalexhd
Copy link
Author

dalexhd commented Oct 10, 2018

Register -> validate registration with "MustVerifyEmail" -> logout -> go to reset password -> send request:
Until here, everything work good, but it seems that in the post side there is an error.
PD: The reset password link is being send to the mail server with out any problem.

@dalexhd
Copy link
Author

dalexhd commented Oct 10, 2018

64
ErrorException 
…/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php25
63
Barryvdh\Debugbar\LaravelDebugbar handleError
…/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php25
62
Illuminate\Support\NamespacedItemResolver parseKey
…/vendor/laravel/framework/src/Illuminate/Translation/Translator.php376
61
Illuminate\Translation\Translator parseKey
…/vendor/laravel/framework/src/Illuminate/Translation/Translator.php116
60
Illuminate\Translation\Translator get
…/vendor/laravel/framework/src/Illuminate/Translation/Translator.php102
59
Illuminate\Translation\Translator trans
…/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php914
58
 trans
…/app/Http/Controllers/Auth/ForgotPasswordController.php42
57
App\Http\Controllers\Auth\ForgotPasswordController sendResetLinkResponse
…/vendor/laravel/framework/src/Illuminate/Foundation/Auth/SendsPasswordResetEmails.php38
56
App\Http\Controllers\Auth\ForgotPasswordController sendResetLinkEmail
…/vendor/laravel/framework/src/Illuminate/Routing/Controller.php54
55
 call_user_func_array
…/vendor/laravel/framework/src/Illuminate/Routing/Controller.php54
54
Illuminate\Routing\Controller callAction
…/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php45
53
Illuminate\Routing\ControllerDispatcher dispatch
…/vendor/laravel/framework/src/Illuminate/Routing/Route.php212
52
Illuminate\Routing\Route runController
…/vendor/laravel/framework/src/Illuminate/Routing/Route.php169
51
Illuminate\Routing\Route run
…/vendor/laravel/framework/src/Illuminate/Routing/Router.php679
50
Illuminate\Routing\Router Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php30
49
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/app/Http/Middleware/RedirectIfAuthenticated.php24
48
App\Http\Middleware\RedirectIfAuthenticated handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
47
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
46
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php41
45
Illuminate\Routing\Middleware\SubstituteBindings handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
44
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
43
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php75
42
Illuminate\Foundation\Http\Middleware\VerifyCsrfToken handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
41
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
40
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php49
39
Illuminate\View\Middleware\ShareErrorsFromSession handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
38
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
37
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php63
36
Illuminate\Session\Middleware\StartSession handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
35
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
34
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php37
33
Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
32
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
31
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php66
30
Illuminate\Cookie\Middleware\EncryptCookies handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
29
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
28
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php104
27
Illuminate\Pipeline\Pipeline then
…/vendor/laravel/framework/src/Illuminate/Routing/Router.php681
26
Illuminate\Routing\Router runRouteWithinStack
…/vendor/laravel/framework/src/Illuminate/Routing/Router.php656
25
Illuminate\Routing\Router runRoute
…/vendor/laravel/framework/src/Illuminate/Routing/Router.php622
24
Illuminate\Routing\Router dispatchToRoute
…/vendor/laravel/framework/src/Illuminate/Routing/Router.php611
23
Illuminate\Routing\Router dispatch
…/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php176
22
Illuminate\Foundation\Http\Kernel Illuminate\Foundation\Http\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php30
21
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php65
20
Barryvdh\Debugbar\Middleware\InjectDebugbar handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
19
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
18
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/fideloper/proxy/src/TrustProxies.php57
17
Fideloper\Proxy\TrustProxies handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
16
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
15
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php31
14
Illuminate\Foundation\Http\Middleware\TransformsRequest handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
13
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
12
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php31
11
Illuminate\Foundation\Http\Middleware\TransformsRequest handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
10
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
9
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php27
8
Illuminate\Foundation\Http\Middleware\ValidatePostSize handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
7
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
6
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php62
5
Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode handle
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php151
4
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
3
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php104
2
Illuminate\Pipeline\Pipeline then
…/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php151
1
Illuminate\Foundation\Http\Kernel sendRequestThroughRouter
…/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php116
0
Illuminate\Foundation\Http\Kernel handle
…/public/index.php53

@staudenmeir
Copy link
Contributor

Has this worked before? Put if(!is_scalar($key)) dd($key); at the beginning of NamespacedItemResolver::parseKey(): What's the result?

@dalexhd
Copy link
Author

dalexhd commented Oct 10, 2018

It seems that doing if(!is_scalar($key)) return $key; at the beginning of NamespacedItemResolver::parseKey() resolves the problem.

@dalexhd
Copy link
Author

dalexhd commented Oct 10, 2018

And if i do dd($key), I get:

Request {#42 ▼
  #json: null
  #convertedFiles: []
  #userResolver: Closure {#291 ▶}
  #routeResolver: Closure {#298 ▶}
  +attributes: ParameterBag {#44 ▶}
  +request: ParameterBag {#43 ▶}
  +query: ParameterBag {#50 ▶}
  +server: ServerBag {#46 ▶}
  +files: FileBag {#47 ▶}
  +cookies: ParameterBag {#45 ▶}
  +headers: HeaderBag {#48 ▶}
  #content: null
  #languages: null
  #charsets: null
  #encodings: null
  #acceptableContentTypes: null
  #pathInfo: "/password/email"
  #requestUri: "/password/email"
  #baseUrl: ""
  #basePath: null
  #method: "POST"
  #format: null
  #session: Store {#340 ▶}
  #locale: null
  #defaultLocale: "en"
  -isHostValid: true
  -isForwardedValid: true
  basePath: ""
  format: "html"
}

@staudenmeir
Copy link
Contributor

Are you using the default template for password reset emails?

@dalexhd
Copy link
Author

dalexhd commented Oct 10, 2018

Im using my custom view, and same model and controller.

@dalexhd dalexhd closed this as completed Oct 10, 2018
@dalexhd dalexhd reopened this Oct 10, 2018
@staudenmeir
Copy link
Contributor

Please post your view.

@dalexhd
Copy link
Author

dalexhd commented Oct 10, 2018

@extends('layouts.empty', ['paceTop' => true, 'bodyExtraClass' => 'bg-white'])

@section('title', 'Reset Password Page')

@section('content')
	<!-- begin login -->
	<div class="login login-with-news-feed">
		<!-- begin news-feed -->
		<div class="news-feed">
			<div class="news-image" style="background-image: url(/assets/panel/img/login-bg/login-bg-1.jpg)"></div>
			<div class="news-caption">
				<h4 class="caption-title"><b>Color</b> Admin App</h4>
				<p>
					Download the Color Admin app for iPhone®, iPad®, and Android™. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
				</p>
			</div>
		</div>
		<!-- end news-feed -->
		<!-- begin right-content -->
		<div class="right-content">
			<!-- begin login-header -->
			<div class="login-header">
				<div class="brand">
					<span class="logo"></span> <b>Color</b> Admin
					<small>responsive bootstrap 3 admin template</small>
				</div>
				<div class="icon">
					<i class="fa fa-sign-in"></i>
				</div>
			</div>
			<!-- end login-header -->
			<!-- begin login-content -->
			<div class="login-content">
				<form action="{{ route('password.request') }}" method="POST" class="margin-bottom-0">

					@if ($errors->has('g-recaptcha-response'))
						<div class="alert alert-dark fade show m-b-10">
							<span class="close" data-dismiss="alert">×</span>
							The recaptcha field is required.
						</div>
					@endif

					{{ csrf_field() }}

					<input type="hidden" name="token" value="{{ $token }}">

					<div class="input-group m-b-{{ $errors->has('email') ? '40' : '15' }}">
						<input id="email" type="email" class="form-control form-control-lg {{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" placeholder="Email Address" value="{{ old('email') }}" required />
						@if ($errors->has('email'))
							<div class="invalid-tooltip">{{ $errors->first('email') }}</div>
						@endif
					</div>

					<div class="input-group m-b-{{ $errors->has('password') ? '40' : '15' }}">
						<input id="password" type="password" class="form-control form-control-lg {{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" placeholder="New Password" required />
						@if ($errors->has('password'))
							<div class="invalid-tooltip">{{ $errors->first('password') }}</div>
						@endif
					</div>

					<div class="input-group m-b-{{ $errors->has('password_confirmation') ? '40' : '15' }}">
						<input id="password_confirmation" type="password" class="form-control form-control-lg {{ $errors->has('password_confirmation') ? ' is-invalid' : '' }}" name="password_confirmation" placeholder="Confirm New Password" required />
						@if ($errors->has('password'))
							<div class="invalid-tooltip">{{ $errors->first('password_confirmation') }}</div>
						@endif
					</div>

					{!! Recaptcha::render() !!}

					<div class="m-b-10"></div>

					<div class="login-buttons">
						<button type="submit" class="btn btn-success btn-block btn-lg">Reset Password</button>
					</div>
					<div class="m-t-20 m-b-40 p-b-40 text-inverse">
                        Already a member? Click <a href="/login">here</a> to login.
					</div>
					<hr />
					<p class="text-center text-grey-darker">
						&copy; Color Admin All Right Reserved 2018
					</p>
				</form>
			</div>
			<!-- end login-content -->
		</div>
		<!-- end right-container -->
	</div>
	<!-- end login -->
@endsection

@dalexhd
Copy link
Author

dalexhd commented Oct 10, 2018

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;

class ForgotPasswordController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Password Reset Controller
    |--------------------------------------------------------------------------
    |
    | This controller is responsible for handling password reset emails and
    | includes a trait which assists in sending these notifications from
    | your application to your users. Feel free to explore this trait.
    |
    */

    use SendsPasswordResetEmails;

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    /**
     * Get the response for a successful password reset link.
     *
     * @param  string  $response
     * @return \Illuminate\Http\RedirectResponse
     */
    public function sendResetLinkResponse($response)
    {
        return redirect()->route('login')->with('status', trans($response));
    }

    /**
     * Validate the email for the given request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return void
     */
    protected function validateEmail(Request $request)
    {
        $this->validate($request, [
            'email' => 'required|email',
            'g-recaptcha-response' => 'required|recaptcha'
        ]);
    }
}

@dalexhd
Copy link
Author

dalexhd commented Oct 10, 2018

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable implements MustVerifyEmail
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];
}

@staudenmeir
Copy link
Contributor

I meant the password reset email, you posted the password reset page. Your error looks like it's coming from the email template.

@dalexhd
Copy link
Author

dalexhd commented Oct 10, 2018

@extends('layouts.empty', ['paceTop' => true, 'bodyExtraClass' => 'bg-white'])

@section('title', 'Reset Password Page')

@section('content')
	<!-- begin login -->
	<div class="login login-with-news-feed">
		<!-- begin news-feed -->
		<div class="news-feed">
			<div class="news-image" style="background-image: url(/assets/panel/img/login-bg/login-bg-1.jpg)"></div>
			<div class="news-caption">
				<h4 class="caption-title"><b>Color</b> Admin App</h4>
				<p>
					Download the Color Admin app for iPhone®, iPad®, and Android™. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
				</p>
			</div>
		</div>
		<!-- end news-feed -->
		<!-- begin right-content -->
		<div class="right-content">
			<!-- begin login-header -->
			<div class="login-header">
				<div class="brand">
					<span class="logo"></span> <b>Color</b> Admin
					<small>responsive bootstrap 3 admin template</small>
				</div>
				<div class="icon">
					<i class="fa fa-sign-in"></i>
				</div>
			</div>
			<!-- end login-header -->
			<!-- begin login-content -->
			<div class="login-content">
				<form action="/password/email" method="POST" class="margin-bottom-0">

					@if ($errors->has('g-recaptcha-response'))
						<div class="alert alert-dark fade show m-b-10">
							<span class="close" data-dismiss="alert">×</span>
							The recaptcha field is required.
						</div>
					@endif

					{{ csrf_field() }}
					<div class="input-group m-b-{{ $errors->has('email') ? '40' : '15' }}">
						<input id="email" type="email" class="form-control form-control-lg {{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" placeholder="Email Address" value="{{ old('email') }}" required />
						@if ($errors->has('email'))
							<div class="invalid-tooltip">{{ $errors->first('email') }}</div>
						@endif
					</div>

					{!! Recaptcha::render() !!}

					<div class="m-b-10"></div>

					<div class="login-buttons">
						<button type="submit" class="btn btn-success btn-block btn-lg">Reset Password</button>
					</div>
					<div class="m-t-20 m-b-40 p-b-40 text-inverse">
                        Already a member? Click <a href="/login">here</a> to login.
					</div>
					<hr />
					<p class="text-center text-grey-darker">
						&copy; Color Admin All Right Reserved 2018
					</p>
				</form>
			</div>
			<!-- end login-content -->
		</div>
		<!-- end right-container -->
	</div>
	<!-- end login -->
@endsection

@dalexhd
Copy link
Author

dalexhd commented Oct 11, 2018

Any Idea of what is happening? If, no, is there a problem if I use the solution I provided before?

@laurencei
Copy link
Contributor

So if you use the default email template - it works right?

It's one of your variables in your email template that is not set correctly. Just do some debugging and remove all the code, and add it slowly back in until you find the problem.

@rbmcgowan
Copy link

I have this same problem, only realised today after some users starting complaining. I am using the standard password reset email template.

@laurencei
Copy link
Contributor

@rbmcgowan - can you give a reproducible example using a default laravel install?

@rbmcgowan
Copy link

you mean a fresh clean install ? then no, I don't have one of those. The password reset process is out of the box though.

@staudenmeir
Copy link
Contributor

@rbmcgowan When exactly does the error occur? When the user submits the /password/reset form?

@rbmcgowan
Copy link

rbmcgowan commented Oct 20, 2018

It's failing on the second "return redirect" line in ResetPasswordController.php. The password was reset fine and works, the page just doesn't return.

protected function sendResetResponse($response)
{
if(!$this->guard()->user()->hasVerifiedEmail()) {
$this->guard()->logout();
return redirect('/login')->withInfo('Password changed successfully. Please verify your email');
}
return redirect($this->redirectPath())
->with('status', trans($response));
}

@staudenmeir
Copy link
Contributor

staudenmeir commented Oct 20, 2018

Please post the exception stacktrace. What's your Laravel version?

What do you get when you put dd($response); in sendResetResponse()?

@rbmcgowan
Copy link

[2018-10-21 00:37:27] Local.ERROR: Illegal offset type in isset or empty {"userId":3,"email":"rxxxxx@xxxx","exception":"[object] (ErrorException(code: 0): Illegal offset type in isset or empty at /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php:25) [stacktrace] #0 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php(25): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'Illegal offset ...', '/home/vagrant/c...', 25, Array) #1 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Translation/Translator.php(376): Illuminate\\Support\\NamespacedItemResolver->parseKey(Object(Illuminate\\Http\\Request)) #2 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Translation/Translator.php(116): Illuminate\\Translation\\Translator->parseKey(Object(Illuminate\\Http\\Request)) #3 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Translation/Translator.php(102): Illuminate\\Translation\\Translator->get(Object(Illuminate\\Http\\Request), Array, NULL) #4 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(914): Illuminate\\Translation\\Translator->trans(Object(Illuminate\\Http\\Request), Array, NULL) #5 /home/vagrant/code/tripwatch/app/Http/Controllers/Auth/ResetPasswordController.php(48): trans(Object(Illuminate\\Http\\Request)) #6 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ResetsPasswords.php(55): App\\Http\\Controllers\\Auth\\ResetPasswordController->sendResetResponse(Object(Illuminate\\Http\\Request), 'passwords.reset') #7 [internal function]: App\\Http\\Controllers\\Auth\\ResetPasswordController->reset(Object(Illuminate\\Http\\Request)) #8 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array) #9 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('reset', Array) #10 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Route.php(212): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\Auth\\ResetPasswordController), 'reset') #11 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Route.php(169): Illuminate\\Routing\\Route->runController() #12 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Router.php(679): Illuminate\\Routing\\Route->run() #13 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #14 /home/vagrant/code/tripwatch/app/Http/Middleware/RedirectIfAuthenticated.php(24): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #15 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): App\\Http\\Middleware\\RedirectIfAuthenticated->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #16 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #17 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #18 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #19 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #20 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(75): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #21 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #22 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #23 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #24 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #25 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #26 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #27 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #28 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #29 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #30 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #31 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #32 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #33 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #34 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #35 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #36 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #37 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Router.php(656): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request)) #38 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Router.php(622): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route)) #39 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Router.php(611): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request)) #40 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request)) #41 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request)) #42 /home/vagrant/code/tripwatch/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #43 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #44 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #45 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #46 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #47 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #48 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #49 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #50 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #51 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #52 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #53 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #54 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #55 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #56 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #57 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #58 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #59 /home/vagrant/code/tripwatch/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request)) #60 /home/vagrant/code/tripwatch/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request)) #61 {main} "}

@rbmcgowan
Copy link

upgraded to 5.7.9 to see if that helped, but it was 5.7.6

Request {#42
#json: null
#convertedFiles: []
#userResolver: Closure {#646 ▶}
#routeResolver: Closure {#648 ▶}
+attributes: ParameterBag {#44 ▶}
+request: ParameterBag {#43 ▶}
+query: ParameterBag {#50 ▶}
+server: ServerBag {#46 ▶}
+files: FileBag {#47 ▶}
+cookies: ParameterBag {#45 ▶}
+headers: HeaderBag {#48 ▶}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: null
#pathInfo: "/password/reset"
#requestUri: "/password/reset"
#baseUrl: ""
#basePath: null
#method: "POST"
#format: null
#session: Store {#679 ▶}
#locale: null
#defaultLocale: "en"
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}

I have included the collapsed data, do you want anything in particular?

One interesting behaviour, if I insert the DD in sendResetResponse, then when the DD output displays I remove the DD, hit BACK in the browser and complete the new password form again, it works fine, no error.

@staudenmeir
Copy link
Contributor

You have to adjust the signature of ResetPasswordController::sendResetResponse():

protected function sendResetResponse(Request $request, $response)

This has been changed in Laravel 5.7 (upgrade guide).

@staudenmeir
Copy link
Contributor

@dalexhd You have to apply the same change to ResetPasswordController::sendResetLinkResponse().

@rbmcgowan
Copy link

rbmcgowan commented Oct 21, 2018

ah, sorry, don't know how I missed that, clearly my fault, I really appreciate your outstanding level of support.

@jackobwu
Copy link

jackobwu commented Nov 2, 2018

same problem, and solved , dut to changed in laravle new update 5.7

protected function sendResetResponse(Request $request, $response)

thank you !!!

@wasitmirani
Copy link

hello guys I'm facing this issue Illegal offset type in isset or empty (version: 8.19) on Laravel 8
kindly suggest me this problem solution.

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

7 participants