Skip to content

WooCommerce module: Undefined variable $admin_path in orders_list.blade.php crashes conversation page (500) #5436

@mostafasoufi

Description

@mostafasoufi

Bug

Opening a conversation that renders the WooCommerce module's orders sidebar throws a fatal ErrorException and returns a 500 ("Whoops, looks like something went wrong"), making the conversation page inaccessible in the UI.

Error

ErrorException (code: 0): Undefined variable $admin_path
(View: .../Modules/WooCommerce/Resources/views/partials/orders_list.blade.php)
at .../storage/framework/views/d3e1368b3dcc8bcce385ff4b26a7b5d8322b500e.php:23

Abbreviated stack trace:

#0  Illuminate\View\Engines\CompilerEngine->handleViewException()
#1  Illuminate\View\Engines\PhpEngine->evaluatePath()
#2  Illuminate\View\View->getContents()
#3  Illuminate\View\View->renderContents()
#5  Illuminate\Http\Response->render()
... (conversation route via Illuminate\Routing\Pipeline)

Steps to reproduce

  1. Have the WooCommerce module installed and enabled.
  2. Open a conversation whose customer renders the orders sidebar (partials/orders_list.blade.php).
  3. The page returns a 500 instead of the conversation.

Cause

partials/orders_list.blade.php references $admin_path, but that variable is not passed into the partial / not in the view scope, so Blade raises "Undefined variable $admin_path" and the entire conversation view fails to render.

Suggested fix

Ensure $admin_path is always provided to the partial (pass it in the @include(...) data array, or default it with $admin_path ?? ''), or derive it from the configured store admin URL.

Environment

  • FreeScout: 1.8.222
  • WooCommerce module: 1.0.15
  • PHP: 8.0.30

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions