Portal-Abo: Abo-Anlage und Ausfuehrungsliste rendern ohne Fehler

Log-Analyse 26.08. (P0-1, P1-2): getContentByOrder() liefert ein Array,
contains() darauf warf bei jeder Abo-Anlage im Portal einen 500. Die
Ausfuehrungsliste nutzt CRM-Routen, die im Portal fehlen; dort gibt es jetzt
user_order_detail als Alias auf die Portal-Bestellansicht, und die View
prueft die Route vor dem Verlinken.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kevin 2026-09-23 15:40:46 +00:00
parent 316a9b76d6
commit ede8e0532d
3 changed files with 6 additions and 3 deletions

View file

@ -64,7 +64,7 @@
@endif
@else
@if($user_abo->is_for === 'me')
@if(!isset($only_show_products) || !$only_show_products)
@if((!isset($only_show_products) || !$only_show_products) && Route::has('user_order_detail'))
{!! '<a href="' . route('user_order_detail', [$user_abo_order->shopping_order_id]) . '" class="btn btn-xs btn-primary">'.$user_abo_order->shopping_order_id.'</a>' !!}
@else
@ -72,7 +72,7 @@
@endif
@endif
@if($user_abo->is_for === 'ot')
@if(!isset($only_show_products) || !$only_show_products)
@if((!isset($only_show_products) || !$only_show_products) && Route::has('user_shop_order_detail'))
{!! '<a href="' . route('user_shop_order_detail', [$user_abo_order->shopping_order_id]) . '" class="btn btn-xs btn-secondary">'.$user_abo_order->shopping_order_id.'</a>' !!}
@else
{{ $user_abo_order->shopping_order_id }}

View file

@ -125,7 +125,7 @@
</div>
@endforeach
@php($hasOneTimeRows = Yard::instance('subscription')->getContentByOrder()->contains(function ($item) { return (bool) ($item->options->abo_addon ?? false); }))
@php($hasOneTimeRows = collect(Yard::instance('subscription')->getContentByOrder())->contains(function ($item) { return (bool) ($item->options->abo_addon ?? false); }))
@if ($hasOneTimeRows)
<div class="alert alert-info mt-3">
<i class="fa fa-bolt text-warning"></i> {{ __('abo.onetime_create_info') }}

View file

@ -70,6 +70,9 @@ Route::domain(config('app.pre_url_portal').config('app.domain').config('app.tld_
return redirect()->route('portal.my_data.edit');
})->name('user_customer_edit');
Route::get('portal/my-orders/detail/{id}', [OrderController::class, 'myOrderShow'])->name('user_shop_order_detail');
// Kunden im Portal haben nur eine Bestellansicht; der CRM-Name wird fuer
// admin.abo._executions (is_for === 'me') mit abgebildet.
Route::get('portal/my-orders/own-detail/{id}', [OrderController::class, 'myOrderShow'])->name('user_order_detail');
Route::get('portal/settings', [InController::class, 'settings'])->name('portal.settings');
// Weitere Kunden-spezifische Routen
});