Problem/Motivation

As a developer who is using preview with the next-drupal-starter, I expect preview to function regardless of which path alias patterns I am using.

The FE preview API route assumes the the object name is the same as the first path argument, which may not be true as people customize sites. If preview passes this data, the API route will be able to more accurately validate preview routes.

Proposed resolution

* When Decoupled Preview redirects to the Next Starter Preview API endpoint, an objectName query string parameter is included in the request.

* The value should be entity type and bundle for the content being previewed, separated by -- - for example, node--article

Query params for the redirect look to be set in src/Form/EditPreviewForm.php

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

brianperry created an issue. See original summary.

abhisekmazumdar made their first commit to this issue’s fork.

abhisekmazumdar’s picture

Assigned: abhisekmazumdar » brianperry
Status: Active » Needs review

brianperry’s picture

Assigned: brianperry » Unassigned
Status: Needs review » Fixed

Merged and released as Alpha 2. Thanks @abhisekmazumdar!

Status: Fixed » Closed (fixed)

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