Skip to content

Introducing 'preview_enabled' on the next_entity_type_config entity#660

Merged
bojanbogdanovic merged 4 commits into
chapter-three:mainfrom
bojanbogdanovic:preview-enabled
Dec 25, 2025
Merged

Introducing 'preview_enabled' on the next_entity_type_config entity#660
bojanbogdanovic merged 4 commits into
chapter-three:mainfrom
bojanbogdanovic:preview-enabled

Conversation

@bojanbogdanovic

@bojanbogdanovic bojanbogdanovic commented Jan 18, 2024

Copy link
Copy Markdown
Contributor

This pull request is for: (mark with an "x")

  • examples/*
  • modules/next
  • packages/next-drupal
  • starters/basic-starter
  • starters/graphql-starter
  • Other

GitHub Issue: #496

Describe your changes

I have decoupled the site resolver from preview mode in the 'next_entity_type_config' and added a new 'preview_enabled' property. This property gives the ability to enable/disable the preview mode on specific entities. The site resolver is now also required, due the fact that it is needed for the preview mode and on demand revalidation.

Screenshot of the UI change:
Screenshot 2024-01-18 at 11 28 15

@vercel

vercel Bot commented Jan 18, 2024

Copy link
Copy Markdown

@bojanbogdanovic is attempting to deploy a commit to the Chapter Three Team on Vercel.

A member of the Team first needs to authorize it.

@jeffschuler

Copy link
Copy Markdown

This is working for us, and very much needed. Thanks @bojanbogdanovic!

Here are the changes as a patch for the Next module in Drupal:
next_drupal-660-5c0d143.patch

@JohnAlbin

Copy link
Copy Markdown
Contributor

Merge conflicts with a previous PR need to be resolved. Sorry about that!

@bojanbogdanovic

Copy link
Copy Markdown
Contributor Author

Bump! Merge conflict is resolved.

minnur
minnur previously approved these changes Apr 21, 2025

@minnur minnur left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me.

@timdiels1

Copy link
Copy Markdown

When using the PR, I get errors when switching the plugin:

Warning: Undefined array key "site_resolver_settings_container" in Drupal\next\Form\NextEntityTypeConfigForm->ajaxReplaceSiteResolverSettingsForm() (line 250 of /var/www/html/drupal/web/modules/contrib/next/src/Form/NextEntityTypeConfigForm.php)

Something went wrong with the rebase?

Because the code is not showing the text for preview but for draft mode?

@timdiels1

Copy link
Copy Markdown

I'm not sure that I can do the changes directly in the PR. So this is the patch file that can be used for 2.x if you install the module from Drupal.org
next_drupal-660-c8f3000.patch

@bojanbogdanovic

Copy link
Copy Markdown
Contributor Author

@timdiels1 I just pushed a fix, please take a look.

@timdiels1

Copy link
Copy Markdown

That will fix it yes, but then again I'm seeing still references to 'draft' in code while the screenshot you provided talks about the preview.

@bojanbogdanovic

Copy link
Copy Markdown
Contributor Author

Yea the PR is pretty old and same goes for the screenshot, preview mode got changed to draft mode, see: 11e108a

I updated the key/label to make it consistent.

@timdiels1

Copy link
Copy Markdown

I see, thank you so much for the changes and explanation. Anyone following, please ignore my patch then and use the code changes that are now available.

@lincoln-c-dev

Copy link
Copy Markdown

Could someone clear up something for me please? Based on @bojanbogdanovic's comment, the pr has the most recent changes for this issue but for me the patch posted by @timdiels1 actually applied onto my site but obviously that's a bit older.

So I'm wondering how do i apply the changes of the pr itself? I tried adding .patch to the end of the pr url and then adding the resulting url to my composer.json on my drupal site but that failed to apply, what’s the correct way of getting these changes?

@bojanbogdanovic bojanbogdanovic merged commit 95e7d7a into chapter-three:main Dec 25, 2025
13 of 16 checks passed
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.

6 participants