Regenerate QR on print if invalid
This commit is contained in:
parent
bfea1f4dfe
commit
81fca09069
@ -197,6 +197,11 @@ class ItemController
|
|||||||
echo "Item not found";
|
echo "Item not found";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Ensure QR code exists
|
||||||
|
$qrFile = __DIR__ . '/../../public/uploads/qr/' . $item['id_code'] . '.svg';
|
||||||
|
if (!file_exists($qrFile) || strpos(file_get_contents($qrFile), 'data:image/svg+xml;base64,') === 0) {
|
||||||
|
self::generateQRCode($item['id_code']);
|
||||||
|
}
|
||||||
echo $twig->render('print_qr.twig', ['item' => $item]);
|
echo $twig->render('print_qr.twig', ['item' => $item]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user