Singleton Last Modified irrated

Hallo,

habe eine Ungereimtheit beim “Last Modified” Date eines Singleton.
Diese gibt die letzte Änderung der Struktur an und nicht des Inhalts.

Bei Collection gibt das Feld “Last Modified” die letzte bearbeitung des Inhalts an.

Das “Last Modified” müsste doch auch bei den Singletons die letzte Bearbeitung des Contents, analog zur Revision anzeigen.

Cockpit v0.9.0

Hi @lammpee, can you repeat the question in a more universal language? :slight_smile:

Ooohh :slight_smile:

I have an inconsistency in a singleton’s last modified date.

This indicates the last change of the structure and not the content.

For Collection, the field “Last Modified” indicates the last modification of the content.

The “Last Modified” field should also indicate the last editing of the singletons, analogous to the revision.

Cockpit v0.9.0

That sounds a feature request, probably better to raise the request on github. I would say for now if you really need it, maybe you can get the latest revision date and inject it in the api response, something like below may work:

$app->on('singleton.getData.after.<singletonname>', function ($singleton, &$data) use ($app) {
  $revisions = $app->helper('revisions')->getList($singleton['_id']);
  if ($revisions) {
    $data['_modified'] = $revisions[0]['_created'];
  }
});