Problem/Motivation

Error when trying to view a revision such as a URL like /node/16126/revisions/241361/view

The website encountered an unexpected error. Please try again later.
Error: Call to a member function isPublished() on string in Drupal\unpublished_404\EventSubscriber\NotFound->on403() (line 57 of modules/contrib/unpublished_404/src/EventSubscriber/NotFound.php).
Drupal\unpublished_404\EventSubscriber\NotFound->on403(Object) (Line: 109)

screenshot

Steps to reproduce

1. a content type that supports revisions
2. View a revision
3. See error

Proposed resolution

I guess in some instances the node ID can be a string so I think the right thing to do would be look up the node and return a node object?

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 2021-09-27_14-36-54.jpg59.17 KBnicholass
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

NicholasS created an issue. See original summary.

nicholass’s picture

Issue summary: View changes
StatusFileSize
new59.17 KB

gaurav.kapoor’s picture

@NicholasS Thanks for reporting this and working on it as well, but I couldn't reproduce the issue. I am not getting any errors when trying to view the revisions after enabling the module.

nicholass’s picture

@gaurav.kapoor So its been a while but I think I had a content type with revisions and the current state of the content was unpublished (someone had unpublished some previously published content). That or it was draft revisions and the content had never been published but just remined in draft with multiple revisions. Sorry I should have put better details in the description.

This also was back in Drupal 8, our site is on 9 so I am not able to preproduce it today. I tried a bunch of different combinations. So maybe core or some other module has changed and its fixed.

gaurav.kapoor’s picture

Status: Active » Closed (works as designed)

Thanks for clarifications @NicholasS. I also didn't see any errors, so I am closing this issue now. Please open the issue again if you again get such an error.