DamienHarper/auditor-bundle

Viewer - More generic helper

JCH8731 opened this issue · 0 comments

Audit bundle is working well but I have got issue with Viewer due to the architecture of my project.

I got Entities where the identifier field is not called "id" and the twig Helper is working with 'target.id".

Exemple of audit "diffs":
{
"source": {
"id_facture": 180947,
"class": "Entity\Facturation\Facture\Prescription",
"label": "",
"table": "facture_prescription",
"field": "lignes"
},
"target": {
"id_facture_ligne": 385625,
"class": "Entity\Facturation\Prescription\Ligne",
"label": "Entity\Facturation\Prescription\Ligne#385625",
"table": "facture_ligne_prescription",
"field": "facture"
},
"is_owning_side": false
}

"Entity\Facturation\Facture\Prescription" has one to many "Entity\Facturation\Prescription\Ligne"
and "Entity\Facturation\Prescription\Ligne" extends "Entity\Facturation\Ligne" with "id_facture_ligne" identifier

The error when I want to open my "Facture\Prescription" audit view :
image

I haven't found a way to configure this specificity but maybe I missed something.
Is it possible to improve Helper to be more generic ?

Thanks for your time,
Regards,
Jeremy