fix variables

This commit is contained in:
Godfrey M
2025-07-01 12:52:16 -07:00
parent 55ebb4671f
commit 76f59f7b85
2 changed files with 4 additions and 3 deletions

View File

@@ -1484,8 +1484,8 @@ class Helper
static public function getRedirectOption($request, $id, $table, $item_id = null) : RedirectResponse
{
$redirect_option = Session::get('redirect_option') ?? $request->input('redirect_option');
$checkout_to_type = Session::get('checkout_to_type') ?? $request->input('checkout_to_type');
$redirect_option = Session::get('redirect_option') ?? $request->redirect_option;
$checkout_to_type = Session::get('checkout_to_type') ?? null;
$checkedInFrom = Session::get('checkedInFrom');
$other_redirect = Session::get('other_redirect');
$backUrl = Session::pull('back_url', route('home'));

View File

@@ -167,7 +167,8 @@ class HelperTest extends TestCase
Session::put('redirect_option', $data['redirect_option']);
Session::put('checkout_to_type', $data['checkout_to_type']);
$redirect = redirect()->to(Helper::getRedirectOption($data['request'],$data['id'], $data['table']));
$redirect = Helper::getRedirectOption($data['request'], $data['id'], $data['table']);
$this->assertInstanceOf(RedirectResponse::class, $redirect);
$this->assertEquals($data['route'], $redirect->getTargetUrl(), $scenario.'failed.');