Fix XF News comment

This commit is contained in:
2026-06-30 16:12:17 +02:00
parent 3b0051585c
commit 7e1f8fc55a

View File

@@ -3,6 +3,7 @@
namespace App\Services;
use App\Models\Entry;
use App\Models\News;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
@@ -104,10 +105,10 @@ class XenforoApiService {
if( !$entry->comments_thread_id || $entry->comments_thread_id <= 0 ){
$data = [
'node_id' => config('xenforo.comments_node_id'),
'title' => $entry->complete_title,
'title' => $entry->complete_title ?? $entry->title,
'message' => $entry->description,
'prefix_id' => config('xenforo.comments_prefixes')[$entry->type] ?? 1,
'custom_fields' => [ 'entry_id' => $entry->id ],
'prefix_id' => config('xenforo.comments_prefixes')[$entry->type ?? "news"] ?? 1,
'custom_fields' => $entry->type ? [ 'entry_id' => $entry->id ] : [ 'news_id' => $entry->id ],
'discussion_open' => true,
];