next-drupal icon indicating copy to clipboard operation
next-drupal copied to clipboard

On-demand revalidation should be usable regardless of Preview Mode configuration

Open camilo-escobar opened this issue 2 years ago • 2 comments

Currently, the On-demand Revalidation cannot be used without enabling Preview Mode. You need to choose a Preview Mode plugin (e.g., "Site Selector") and check one of your Next.js sites in the entity type configuration to get revalidate working. Without selecting a site, revalidate will not work. I think the site selection setting should not be tied to the "Preview Mode" option. One should be able to select a site and then specify whether to use the preview feature, revalidate, or both.

image

Even though you might not be interested in enabling the Preview Mode, you would also have to set a "Preview URL" in the Next.js site configuration, in order to prevent the original error reported in https://github.com/chapter-three/next-drupal/issues/451: InvalidArgumentException: The URI '' is invalid. You must use a valid URI scheme. in Drupal\Core\Url::fromUri() (line 293 of /app/web/core/lib/Drupal/Core/Url.php).

image

Proposed solution: Detach the Site selection from the "Preview Mode" settings in the Entity Type config form. Allow the selection of a site and then permit the activation of "Preview Mode" and "On-demand Revalidation" independently.

camilo-escobar avatar May 04 '23 21:05 camilo-escobar

FYI I figured out how to get rid of the Iframe preview, see the workaround here https://github.com/chapter-three/next-drupal/issues/521#issuecomment-1698527916 🎉

yannickoo avatar Aug 30 '23 05:08 yannickoo

This also prevents editing existing menu entity-items, as the preview/draft iframe hijacks the menu edit-form. Screenshot is from /admin/structure/menu/item/{id}/edit Could be cool to get #660 merged

image

blyme avatar Jun 19 '24 12:06 blyme