Commit 611a29b6 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Vue du différentiel d'une synchro : suppression du warning PHP 'Undefined array key'.

parent 8786f439
Loading
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ Changelog
- [FIX] Remplacement de classes Doctrine obsolètes dans SourceListener
- [FIX] DatabaseService::populateDestinationTableFromSource() : beginTransaction() doit être dans le try-catch.
- [FIX] AbstractColumnValueFilter::setParams() : les paramètres spécifiés s'ajoutent aux existants et ne les remplacent plus.
- [FIX] Vue du différentiel d'une synchro : suppression du warning PHP 'Undefined array key'. 
- Dans la table SOURCE, un nouveau flag indique si dans le cadre d'une synchro l'opération 'delete' est interdite. L'interdire est utile lorsque les données sources sont obtenues de façon incrémentale au fil du temps (et non pas de façon exhaustive en une seule fois).
- Suppression de 2 lignes intruses dans la config
- DatabaseService::truncateDestinationTable() : on vérifie désormais que les données contiennent un source_id, sinon le vidage partiel est inopérant.
+14 −0
Changes for src/UnicaenDbImport/Formatter/SynchroDiffFormatter.php: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace UnicaenDbImport\Formatter;

use UnicaenDbImport\Domain\Operation;
use UnicaenDbImport\Domain\Synchro;

class SynchroDiffFormatter
@@ -43,6 +44,19 @@ class SynchroDiffFormatter
            $result[$operation][] = $data;
        }

        // comblement en cas de clé/opération absente
        $operations = [
            Operation::OPERATION_INSERT,
            Operation::OPERATION_UPDATE,
            Operation::OPERATION_DELETE,
            Operation::OPERATION_UNDELETE,
        ];
        foreach ($operations as $operation) {
            if (!array_key_exists($operation, $result)) {
                $result[$operation] = [];
            }
        }

        return $result;
    }
}
 No newline at end of file
+0 −5
Changes for view/unicaen-db-import/synchro/diff.phtml: 0 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -32,11 +32,6 @@ $lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::L
<?php
$f = new SynchroDiffFormatter();
$formattedDiff = $f->format($diff);

$formattedDiff[$o = Operation::OPERATION_INSERT] || $formattedDiff[$o] = [];
$formattedDiff[$o = Operation::OPERATION_UPDATE] || $formattedDiff[$o] = [];
$formattedDiff[$o = Operation::OPERATION_DELETE] || $formattedDiff[$o] = [];
$formattedDiff[$o = Operation::OPERATION_UNDELETE] || $formattedDiff[$o] = [];
?>

<?php foreach ($formattedDiff as $operation => $data): ?>