Spike: default value changes are saved to content history

Description

The problem

When a default value for a document is different from the value in the database, the content history detects this as a change. But Doctrine doesn't write the change to the database.

This means it keeps generating records in the content history.

Example 1: phone number in database doesn't have a type

Example 2: reference has wrong db (it would be better to turn storage of $db off, this will be the default in Doctrine ODM 2, http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/reference-mapping.html)

Note: also when the changeset is empty a record is sometimes written to the content history.

Technical tasks

None

Deployment actions

None

Activity

Show:
API
January 4, 2018, 2:03 PM

.Notificatie urenschatting gestuurd naar Integrated Marijn (marijn@e-active.nl)

API
January 5, 2018, 11:45 AM

.Schatting van 2.5 uur is geaccepteerd door Integrated Marijn.

Michael Jongman
February 22, 2018, 1:10 PM

There is no vagrant box available, is going to look into it,.

Koen Prins
March 15, 2018, 8:22 AM
  • $db

    • and/or ignore in ArrayComparer

  • Empty values

    • Values that are not set, are set with "null", so this problem is not present for the first level. This does however not work for values with multiple levels, so this check should be recursive.

  • Empty DateTime's

    • Things like empty endDate in PublishTime are stored as ISODate("9999-12-31T00:00:00.000000Z").

Jeroen van Leeuwen
March 21, 2018, 8:39 AM
Edited

thanks for looking into this. here some more input for the "problem definition":

  • $db agree

  • Empty values: agree

  • Empty DateTime: this issue is a bit more complex: the content history gets the "new" values on the onFlush event. In this event not all "new" values are computed: the preUpdate is event is preformed later on. I think this should be fixed so that all preUpdate values are compared.

Assignee

Unassigned

External issue ID

None

Client

Integrated Marijn

Min. hours

None

Dev hour estimate

None

Epic Link

Sprint

None

Fix versions

Configure