Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

[SRM-702] Fix for revision loading throws error on illegal offset type. #120

Conversation

MdNadimHossain
Copy link
Contributor

@MdNadimHossain MdNadimHossain commented Mar 2, 2023

JIRA

https://digital-vic.atlassian.net/browse/SRM-702

Issue

Some of the $vid values returned as object and which causes illegal offset type error when calling the loadRevision function.
Scenario - Go to a node in any CMS and click on the revision tab. Then click on any previous revision and then the CMS will throw error.

Changes

9.4 returns the vid directly from here - $revision = $this->routeMatch->getParameter('node_revision');
#121

Copy link
Contributor

@mayurngondhkar mayurngondhkar left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -234,8 +234,7 @@ protected function getCurrentNode() : ?NodeInterface {
if ($route_name === 'entity.node.revision') {
try {
$vid = $this->routeMatch->getParameter('node_revision');

Choose a reason for hiding this comment

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

This will directly return the node revision entity post Drupal 9.3.x

Copy link
Contributor Author

@MdNadimHossain MdNadimHossain Mar 3, 2023

Choose a reason for hiding this comment

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

@govindmaloo just saw your PRs, make sense, thanks for the change. I will put them in testing and merge them for the next release

@MdNadimHossain
Copy link
Contributor Author

Hey @govindmaloo I have updated the code, please have a look

@MdNadimHossain MdNadimHossain requested review from mayurngondhkar and govindmaloo and removed request for govindmaloo March 7, 2023 04:15
Copy link
Collaborator

@vincent-gao vincent-gao left a comment

Choose a reason for hiding this comment

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

LGTM.
We may replace the node logic by using context further.

@MdNadimHossain MdNadimHossain merged commit e1fa0f5 into develop Mar 7, 2023
@MdNadimHossain MdNadimHossain deleted the bug/SRM-702-revision-throws-error-illegal-offset-type-fix branch March 7, 2023 04:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants