DamienHarper / auditor

auditor, the missing audit log library
MIT License
164 stars 53 forks source link

Incorrect primary key name on render #112

Closed GityaMan closed 2 years ago

GityaMan commented 2 years ago

vendor/damienharper/auditor/src/Provider/Doctrine/Auditing/Transaction/AuditTrait::summarize the method uses the actual name of the primary key (in my case the "code" field - $pkName variable)

vendor/damienharper/auditor-bundle/src/Resources/views/Audit/helpers/helper.html.twig:58-59 {% set subject = target.class~'#'~target.id %} {{ direction }} <code><a href="{{ path('dh_auditor_show_entity_history', { 'entity': helper.namespaceToParam(target.class), 'id': target.id }) }}">{{ subject }}</a></code> but when rendering, we use the "id" field, but in my case it is not there, there is a "code" field

dmitryuk commented 2 years ago

Exception message is Key "id" for array with keys "class, label, primaryKey, table" does not exist.

DamienHarper commented 2 years ago

https://github.com/DamienHarper/auditor-bundle/pull/328 has to be merged