[Apostrophe versions] authorId and author fields is null for aposDocVersions
See original GitHub issueTo Reproduce
Step by step instructions to reproduce the behavior:
- Download and install the Apostrophe Open Museum project from: https://github.com/apostrophecms/apostrophe-open-museum
- Add various content types from the back end modal using the open museum project.
- Edit any content type and click on More/Versions:
- Few versions are missing the user title and instead of displaying the message: _ admin made changes on DD/MM/YYYY_ it display as: made changes on DD/MM/YYYY
Expected behavior
The user title should always be displayed for each content type in the versions modal as only logged in users should be allowed to edit and make changes to the back end content using the modal
Describe the bug
The authorId
and author
fields are not always saved as the current logged in user and in many instances they are instead saved as null
in the aposDocVersions
collection for many documents:
Details
Version of Node.js: v12.14.0
Server Operating System: Linux (Ubuntu 18x) while no Docker is installed
Additional context:
The same issue can be replicated across different browsers and different devices (OS)
Screenshots
Mongo DB Dump
This DB dump shows all aposDocVersions
documents where the authorId
and author
fields is null
for out of the box Git Hub Apostrophe boiler plate installation and no extra configuration. So far there are about 20 reported entries while in some other Prod sites the number of authorId
and author
fields null
records can reach +200k entries.
Also this dump has more recent entries than the one showed in the screen shot.
Attached:
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Changing all the calls to
getReq
would be a big task, but changinggetReq
to include atitle
for its simulateduser
object would make a great PR. getAnonReq could return a different title.On Tue, Jul 14, 2020 at 12:39 PM Omar notifications@github.com wrote:
–
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his
Okay thanks for the update though don’t you think that as version log it should show all users making any changes to the back end content? These users don’t have to be always logged in users but they can be 3rd party APIs or command line tasks
I think it would be much much better user experience that if no actual user is present in the context it would default to the name of the task that created that content so per say it could be (command line task, API request…etc) and that could be overridden on project level code to include any custom name and that would only be the case as well if there was no actual user object
Also back end users will never know why the user title was missing besides this would be very good thing to narrow down the scope of the issue as I can’t tell now for sure if this is a bug or it is just code improvement/tweak?