Skip to content

fix(aem-assets): reject unpublished assets - #834

Open
holtvogt wants to merge 2 commits into
adobe:mainfrom
holtvogt:fix-unpublished-aem-assets
Open

holtvogt wants to merge 2 commits into
adobe:mainfrom
holtvogt:fix-unpublished-aem-assets

Conversation

@holtvogt

@holtvogt holtvogt commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem

This fixes a production bug in every editor that inserts AEM Assets. Today, on every site with an author repository and no Dynamic Media, authors can insert an asset that was never published, was unpublished, or is only on preview. The editor accepts it without a warning and stores a publish URL that returns 404. Authors see a broken image in the editor, and once the page is previewed and published, visitors see it too. Nothing points to the cause, so the error is easy to miss until the page is live.

The publish check in isPublished read repo:scene7FileStatus. That is a Dynamic Media sync status. Without Dynamic Media it is never set, and a missing status counted as published.

Change

  • isPublished now reads aem:published from the selector payload.
  • false is refused with the existing PUBLISH_ERROR_MSG. true or a missing flag is inserted, which keeps today's behaviour for repositories that don't send it.
  • getScene7PublishStatus is replaced by getPublishedFlag. The scene7 check is dropped, not combined, because the inserted URL is a publish tier URL and does not depend on Dynamic Media sync.

How aem:published behaves

I compared real selector payloads on an author repository without Dynamic Media.

Asset state aem:published
Published to the publish tier true
Never published false
Unpublished after publish false
On preview only false

repo:scene7FileStatus was missing in every case.

Filtering unpublished assets out of the picker, like adobe/da-live#1223, is not possible. The selector ignores filters on aem:published and on the replication properties, while a filter on dc:format works.

Testing

Manual check in the classic editor or canvas and this branch served locally. Unpublished and preview-only images show the publish error. A published image is inserted.

Out of scope

Images that are unpublished after insertion still show as broken. A "Preview unavailable" state in canvas and the structured content image field should be a separate follow-up.

The publish check read repo:scene7FileStatus, which only Dynamic Media
sets. On author repositories without Dynamic Media the property is
missing, so every asset passed and editors inserted publish URLs that
return 404.

The asset selector payload carries aem:published, which reflects only
the publish tier. Refuse an asset when it is false and keep accepting
it when it is missing. Replace the scene7 check instead of combining
it, since the inserted URL does not depend on Dynamic Media sync.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 8, 2026 08:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maximilianvoss

Copy link
Copy Markdown

wouldn't this change break the whole dynamic media support? There you can have images on delivery tier without ever having to publish the image by just changing the approval status which will lead to the updated s7 properties

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants