Overview

All page revisions are currently authored by anonymous user.

Proposed resolution

Revisions should be authored by the person who published the content.

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

penyaskito’s picture

Assigned: Unassigned » penyaskito

penyaskito’s picture

Assigned: penyaskito » wim leers
Status: Active » Needs review
tedbow’s picture

Assigned: wim leers » penyaskito
Status: Needs review » Needs work

see MR comment

tedbow’s picture

Issue summary: View changes
StatusFileSize
new54.37 KB

I am still getting the anonymous if I don't change the title. Also I do think we want

$use_existing_revision_id = AutoSaveManager::contentEntityIsConsideredNew($original_entity);

Because otherwise if you first create a page that hasn't been published and change the title it will never be considered new which I don't think is the intention

and that would leave the first revision showing as anonymous, which I don't think is the intention.

tedbow’s picture

I think I found a bug that is 0.x and this branch.

$use_existing_revision_id = AutoSaveManager::contentEntityIsConsideredNew($entity);

        if ($entity instanceof EntityPublishedInterface) {
          $entity->setPublished();
        }
        // If the entity is new, the autosaved data is considered to be part
        // of the first revision. Therefore, do not create a new revision
        // for new entities.
        if ($use_existing_revision_id) {
          $entity->setNewRevision(FALSE);
        }

Even if $use_existing_revision_id === true a new revision is always created.

I think the intention of this code, from reading the comment, is that if you

  1. create a new page inside XB
  2. make some changes to the page
  3. publish the page
  4. There should be only 1 revision in the log after publishing

The last item does not work. there are always 2 items. Presumably for every XB page there will always be the same first revision with the same data, excepted for created and changed timestamps, because no changes have been made for this revision.

I am not sure why this happens

This relates to this issue because that first revision will always show as "anonymous"

But that might be a bigger problem that we could fix in a follow-up. If someone one knows why this is happening it and it is a small fix it might make sense to fix it here

lauriii’s picture

I think that's a separate issue, good catch! Let's file another issue for that 👍

tedbow’s picture

Assigned: penyaskito » wim leers
Status: Needs work » Needs review
tedbow’s picture

re #8 I created #3535515: New XB pages also create a new revision on publish even though they are intended not to. I didn't add a todo in this issue's MR because I don't think we would change what we are doing here

isholgueras’s picture

StatusFileSize
new122.75 KB

I've tested it in this branch and in 0.x. In 0.x can reproduce the issue but in this branch the user is there. Even I created a new Content Editor user (nacho) with the right permissions and works well.

The code looks good to me too, so I think it's RTBC.

  • lauriii committed b62cbcf3 on 0.x authored by penyaskito
    Issue #3535457 by tedbow, penyaskito, lauriii, isholgueras: Page...
lauriii’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Fixed
mayur-sose’s picture

Tested following scenarios and changes are working as expected :

Scenario Response Status
  1. Log in as Content editor
  2. Edit a page.
  3. Publish changes.
  4. View the revision history log.
The new revision's author is shown as "Content editor", not "Anonymous". Pass
  1. User A publishes/edits page (generates revision).
  2. User B publishes/edits same page (new revision).
  3. View revisions.
Each revision shows the publishing user as author for that version (User A, then User B). Pass
  1. Log out or use anonymous user path (if allowed permissions).
  2. Publish/edit page.
  3. View revision history.
Revision author for this revision reads "Anonymous". Pass
  1. User A reverts to a revision originally made by User B.
  2. View the author for all revisions.
Reverted-to revision author stays as User B; the revert action is logged as a new revision by User A. Pass
  1. Authenticated user publishes a page.
  2. View revision log.
Revision "author" column/field does not display "Anonymous" for this revision. Pass

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.