Fatal error: Call to undefined method stdClass::id() in modules/webform/src/Controller/WebformController.php on line 39

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jithinantony’s picture

Assigned: Unassigned » jithinantony

Replace line 39 of modules/webform/src/Controller/WebformController.php with below code:

$node = Node::load($node->nid);

DanChadwick’s picture

Category: Bug report » Task

We're using "Task" for D8 issues because, well, we're not expecting that there aren't bugs. :)

fenstrat’s picture

Assigned: jithinantony » Unassigned

Yeah 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.

sumitmadan’s picture

Seems error is gone now. Can anyone please close this?

DanChadwick’s picture

@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.

sumitmadan’s picture

Status: Active » Closed (cannot reproduce)

@DanChadwick hehehe.. I meant with the maintainers. I am closing this issue now. :)

dswier’s picture

@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.

DanChadwick’s picture

Status: Closed (cannot reproduce) » Needs review

Seems odd. Why doesn't the accessor id() function work?

safetypin’s picture

The 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.

dswier’s picture

@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.

dswier’s picture

  • fenstrat committed e6e8db6 on 8.x-4.x authored by dswier
    Issue #2503495 by dswier: Fixed fatal error on admin/content/webform...
fenstrat’s picture

Status: Needs review » Fixed

Committed 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.