From f700ef5953f406beecaf87396c3c844432d65ade Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 6 Feb 2026 20:34:05 +0100 Subject: [PATCH] wip #7868 @1 --- app/Jobs/AuditLinkRegister.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/Jobs/AuditLinkRegister.php b/app/Jobs/AuditLinkRegister.php index a94b45d59..9458495d6 100644 --- a/app/Jobs/AuditLinkRegister.php +++ b/app/Jobs/AuditLinkRegister.php @@ -8,7 +8,7 @@ use App\Models\FluidbookPublication; use App\Models\FluidbookCollection; use Fluidbook\Tools\Links\Link as LinkAlias; use Illuminate\Support\Arr; -use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\DB; class AuditLinkRegister extends Base { @@ -26,6 +26,15 @@ class AuditLinkRegister extends Base foreach ($collections as $collection) { $publications = array_merge($publications, $collection->getFluidbooksID()); } + + // Add fluidbooks that have enabled linkShortener + foreach (DB::table('fluidbook_publication')->get() as $p) { + $s = json_decode($p->settings); + if (isset($s->linkShortener) && $s->linkShortener && $s->linkShortener !== 'none') { + $publications[] = $s->id; + } + } + // Nécessaire pour vérifier si la liste des fluidbooks fourni par les collections // existent vraiment ou s'ils ont été supprimé sans être supprimé dans la collection $publications = FluidbookPublication::whereIn('id', $publications)->pluck('id'); @@ -84,7 +93,7 @@ class AuditLinkRegister extends Base if (count($externalLinks) > 0) { FluidbookAuditLink::insert($externalLinks); } - Log::info('Parsed fluidbook ' . $publication . ' : found ' . count($externalLinks) . ' links'); + //Log::info('Parsed fluidbook ' . $publication . ' : found ' . count($externalLinks) . ' links'); } // Delete links that are not anymore in the fluidbooks @@ -94,9 +103,7 @@ class AuditLinkRegister extends Base FluidbookAuditLink::where('fluidbook_id', $e[0])->where('link_id', $e[1])->delete(); } - Log::info('Deleted ' . count($missing) . ' links'); - - - Log::info('Job exécuté avec succès'); + //Log::info('Deleted ' . count($missing) . ' links'); + //Log::info('Job exécuté avec succès'); } } -- 2.39.5