Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Fatal error: Call to undefined method stdClass::id() in modules/webform/src/Controller/WebformController.php on line 39
Comment | File | Size | Author |
---|---|---|---|
#11 | fatal_error_admin_content_webform-2503495-7.patch | 669 bytes | dswier |
#7 | fatal_error_admin_content_webform-2503495-7.patch | 669 bytes | dswier |
Comments
Comment #1
jithinantony CreditAttribution: jithinantony commentedReplace line 39 of modules/webform/src/Controller/WebformController.php with below code:
$node = Node::load($node->nid);
Comment #2
DanChadwick CreditAttribution: DanChadwick commentedWe're using "Task" for D8 issues because, well, we're not expecting that there aren't bugs. :)
Comment #3
fenstratYeah I've not looked at the admin/content/webform controller for some time.
As the comment at the top of WebformController::contentOverview() says:
@todo This needs to be removed and the view webform_webforms used instead.
. So anyone feel free to work on fixing the controller, but keep in mind the goal is to remove it once views support is back up and running.@jithinantony please reassign yourself if you're actively working on this.
Comment #4
sumitmadan CreditAttribution: sumitmadan at QED42 commentedSeems error is gone now. Can anyone please close this?
Comment #5
DanChadwick CreditAttribution: DanChadwick commented@sumitmadan -- anyone can close an issue. You should read the status page of the issue queue handbook to make sure you know what all the status options are.
Comment #6
sumitmadan CreditAttribution: sumitmadan at QED42 commented@DanChadwick hehehe.. I meant with the maintainers. I am closing this issue now. :)
Comment #7
dswier CreditAttribution: dswier commented@jithinantony, your fix solved this for me. Thanks! I'm attaching it in patch form. I believe the reason it looked like the issue had resolved itself was because you actually need to have created a webform node before the error will occur.
Comment #8
DanChadwick CreditAttribution: DanChadwick commentedSeems odd. Why doesn't the accessor id() function work?
Comment #9
safetypinThe really strange thing is, on another line (41) the accessor id() function works correctly. When line 39 is replaced, the node title gets linked correctly to the node.
Comment #10
dswier CreditAttribution: dswier commented@safetypin, id() works on line 41 because the node has been fully loaded at that point. On line 39 the Node::load is still happening so id() is not yet a part of $node.
Comment #11
dswier CreditAttribution: dswier commentedComment #13
fenstratCommitted and pushed #11 to 8.x-4.x. Thanks!
admin/content/webform still needs a lot of work, but at least this stops the fatal error that was stopping it from displaying.