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 = [])
|
public function beforeSave(Entity $entity, array $options = [])
|
||||||
{
|
{
|
||||||
// Nur berechnen, wenn die Datei geändert wurde oder neu
|
// Problem: isAttributeChanged('dokument') erkennt Datei-Änderungen nicht,
|
||||||
if (!$entity->isNew() && !$entity->isAttributeChanged('dokument')) {
|
// da EspoCRM Datei-Uploads nicht als Feld-Änderung markiert.
|
||||||
return;
|
// 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');
|
$dokument = $entity->get('dokument');
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
return [
|
return [
|
||||||
'cacheTimestamp' => 1772523049,
|
'cacheTimestamp' => 1772528140,
|
||||||
'microtimeState' => 1772523049.722855,
|
'microtimeState' => 1772528140.645177,
|
||||||
'currencyRates' => [
|
'currencyRates' => [
|
||||||
'EUR' => 1.0
|
'EUR' => 1.0
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user