Problem/Motivation
I get the following error resulting in a page that is not working, Call to a member function toUrl() on null in Drupal\view_mode_page\Controller\MainController->displayEntity() this is because the code always thinks the entity is of type EntityInterface but it could also be the case where it is now referencing an removed entity resulting in NULL, and then resulting in an error when trying to fetch on to URL on null.
Steps to reproduce
Make sure that the entity referenced is invalid. Then get the error stating Call to a member function toUrl() on null in Drupal\view_mode_page\Controller\MainController->displayEntity()
Proposed resolution
Apply patch making sure that it can never break.
Remaining tasks
Review the code see if everthing keeps working as aspected.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| added-fix-for-view-mode.patch | 1.05 KB | remco hoeneveld |
Issue fork view_mode_page-3460119
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
Comment #4
rishabjasrotia commented