Problem/Motivation

When Author field in Publisher is excluded from export for contents (/admin/structure/types/manage/[content-type]/contenthub) and a Proxy User is selected in Subscriber end with Disable User Syndication option turned on, after importing, content author becomes empty (for new content) or same as Publisher (for existing content), instead of the proxy user selected.

Steps to reproduce

  1. Configure user/author field (uid, revision_uid etc for less entity dependency and faster export-import processing) to be excluded from export in Publisher (/admin/structure/types/manage/[content-type]/contenthub)
  2. Enable the "Disable User Syndication" option in Subscriber Import settings (/admin/config/services/acquia-contenthub/import-queue)
  3. Set a Proxy User to be author of contents
  4. Export-Import content
  5. Notice author becomes empty for new content after sync
  6. Notice author remains same as Publisher
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

supreetam09 created an issue. See original summary.

supreetam09’s picture

Issue summary: View changes
supreetam09’s picture

Issue seems to be happening because Drupal\acquia_contenthub_subscriber\EventSubscriber\UnserializeContentEntityField\ReplaceAuthorWithProxyUser depends on the fields that are being imported, instead of working at an entity level.

When author fields are excluded from export from Publisher, ReplaceAuthorWithProxyUser is not getting triggered for the author field and failing at ReplaceAuthorWithProxyUser::shouldSkip in $this->shouldSkip($current_field_name, $uid_field) as $current_field_name is never having the author field, since omitted from export.

Instead of field level, we can address this proxy user change at an entity level, like a pre-entitysave event.