Clicking on node preview without configuring nextjs entity types throws error

Created on 20 February 2023, over 1 year ago
Updated 20 July 2023, over 1 year ago

While clicking on node-preview on node page throws a error page.
Error: Call to a member function getSiteResolver() on null in Drupal\next\Controller\SitePreviewController->nodePreview() (line 71 of /Users/ankit.pathak/Documents/Projects/FeatureRepo/testacms/docroot/modules/contrib/next/src/Controller/SitePreviewController.php).

Suggestion: Can we do something where clicking on node-preview without configuring on nextjs entity types will redirect the user to 'admin/config/services/next/entity-types' page, Where user can configure the nextjs entity type.

🐛 Bug report
Status

Closed: won't fix

Version

1.6

Component

Code

Created by

🇮🇳India ankitv18

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ankitv18
  • Issue was unassigned.
  • Status changed to Closed: won't fix over 1 year ago
  • 🇮🇳India ankitv18

    Closing this one as we are shipping this feature for Acquia CMS headless so planning to move the site preview patch within acquia cms.

  • Status changed to Needs review over 1 year ago
  • 🇩🇪Germany yannickoo Berlin

    When trying to disable the previewer (because you might want to check how the content could look like on Drupal) you just get get

    Uncaught PHP Exception Error: "Call to a member function getSitesForEntity() on null" at web/modules/contrib/next/src/Render/MainContent/HtmlRenderer.php line 115 
    

    A simple check to check if the site resolver exists can fix the problem, see patch attached.

  • Status changed to Closed: won't fix over 1 year ago
  • 🇩🇪Germany yannickoo Berlin

    There is this pull request which can be used instead of this patch here, so closing again.

Production build 0.71.5 2024