fix: Update beforeSave hook in CDokumente to ensure hash calculation on file changes; adjust microtime values in state file
This commit is contained in:
@@ -8,10 +8,11 @@ class CDokumente extends \Espo\Core\Hooks\Base
|
||||
{
|
||||
public function beforeSave(Entity $entity, array $options = [])
|
||||
{
|
||||
// Nur berechnen, wenn die Datei geändert wurde oder neu
|
||||
if (!$entity->isNew() && !$entity->isAttributeChanged('dokument')) {
|
||||
return;
|
||||
}
|
||||
// Problem: isAttributeChanged('dokument') erkennt Datei-Änderungen nicht,
|
||||
// da EspoCRM Datei-Uploads nicht als Feld-Änderung markiert.
|
||||
// Daher läuft der Hook bei jeder beforeSave mit dokument-Feld,
|
||||
// um sicherzustellen, dass Hashes bei Datei-Änderungen berechnet werden.
|
||||
// Optimierung wäre wünschenswert, aber nicht möglich mit aktueller API.
|
||||
|
||||
$dokument = $entity->get('dokument');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
return [
|
||||
'cacheTimestamp' => 1772523049,
|
||||
'microtimeState' => 1772523049.722855,
|
||||
'cacheTimestamp' => 1772528140,
|
||||
'microtimeState' => 1772528140.645177,
|
||||
'currencyRates' => [
|
||||
'EUR' => 1.0
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user