I am trying to use views to create a searchable page of webform results. However, soon as I create a view using type of webform I keep getting this error message.

Fatal error: Class name must be a valid object or a string in /var/www/docroot/includes/common.inc on line 8048

Anyone have any idea whats causing this and how it can be fixed?

Comments

phelix created an issue.

Liam Morland’s picture

Please provide steps to reproduce this issue, including expected and actual results.

digitaltodd’s picture

I get this too. On two similar sites clicking the webform link in the admin menu (path=/admin/content/webform) gives the same error. This just started after some module updates.

Clicking edit on the webforms view gives a 200 error.
Path /home2/admin/structure/views/webform_webforms/preview/default/ajax
StatusText: parse error
ReposeText: Fatal error class name must be a valid object or string in ..../includes/common.inc line 8048

Further debugging in the view. Remove the node relationship, delete title and postdate and errors go away. Re-add the node relationship, page loads. Add a title, which uses the node relationship and the view breaks as described.

Liam Morland’s picture

On my test site when I visit admin/content/webform, I see a list of the Webforms. If I click "edit", I go to node/<nid>/edit. Ajax doesn't come into play here. Do you have another module installed that is causing this? As well, in HTTP 200 status isn't an error, it's success, so it would be strange to see an error message reporting HTTP 200.

digitaltodd’s picture

I think the ajax is related to the view page preview. The real error is ReposeText: Fatal error class name must be a valid object or string in ..../includes/common.inc line 8048

admin/content/webform - which calls the view is giving me the fatal error. Hope that helps.

Also I can repeat the above by creating a fresh view of webform nodes - as soon as I make the webform node relationship, and add the content title. I get the error.

And, as a work around we can use the content browser - admin/content and filter on type webform. Clicking a webform's link we get the form page and the tabs needed to edit, see results ... So, were not dead in the water.

And, I can also use the content type view to recreate the webform list with links to edit and results, which is also a work around. Hoping someone has insights on the webform node view with the node relationship because that is a little disturbing, but we can manage.

Liam Morland’s picture

I'm not seeing this error. Can you give me step to reproduce the problem, e.g. visit this URL, click here, etc.?

eahonet’s picture

We just updated an existing Drupal7 site (core and modules). We are now experiencing the error

PHP Fatal error: Class name must be a valid object or a string in /home//public_html/includes/common.inc on line 8051

When we try to access /admin/content/webform

We are using the work around of accessing webforms via Content + filtering.

I tried what I saw on similar reports of clearing cache, truncating cache_ tables. I changed PHP version from 5.6 to 7 and 5.5. All had the issue.

These are the webform modules that are installed

  1. clientside_validation_webform
  2. commerce_webform
  3. permissions_per_webform
  4. webform
  5. webform2pdf
  6. webform_constant_contact
  7. webform_multiple_file
  8. webform_reply_to
  9. webform_rules
Liam Morland’s picture

Can you try downgrading Webform to your previous version to see if that make the issue go away? If it does, git bisect can be used to determine exactly which commit caused the problem. admin/content/webform displays properly for me with no errors.

steven_kropp’s picture

Having the same problem as well.
When trying to go here: /admin/content/webform

I'm getting this error...
Fatal error: Class name must be a valid object or a string in .../www/includes/common.inc on line 8051

scottbedmonds’s picture

I am having this same error after updating to Drupal 7.59 and Webform 7.x-4.17

I create a new view webform submissions (tried both page & block) and when I save and continue to edit the view, it gives me that there is an ajax error 500 preview block ajax Service unavailable.

Checking the logs:

  • In my error logs I get the following Notice first:
    Notice: Trying to get property of non-object in webform_component_list() (line 1048 of ...modules/webform/includes/webform.components.inc).
  • Then I get: Warning: Invalid argument supplied for foreach() in webform_component_list() (line 1051 ...modules/webform/includes/webform.components.inc).
  • Then I get: Error: Class name must be a valid object or a string in entity_get_controller() (line 8052 .../includes/common.inc). This happens at this location: admin/structure/views/view/test/preview/block/ajax

Error: Class name must be a valid object or a string in entity_get_controller() (line 8052 of

Liam Morland’s picture

Does the error go away with Webform 7.x-4.16?

scottbedmonds’s picture

@liam-morland No, I have another install with 7.x-4.16 and Drupal 7.56 and it has the same issues. I am about to delete all of my webforms just to see if there is perhaps some corrupt data somewhere, but I can confirm in on both environments

Liam Morland’s picture

You can enable the devel module and add some calls to dpm() so that you can see what the non-object is in the first error message, then work backwards to see where it came from.

scottbedmonds’s picture

Liam, you lost me there. I do have devel installed, but am not sure what to do with dpm in specific, especially since this happens in the views UI...

I can confirm that when I delete all of my webforms this error goes away.

Liam Morland’s picture

Add a call to dpm() near line 1048 of webform.components.inc to see what the non-object is that the code is trying to get a property on. Then trace backwards to see where it comes from.

scottbedmonds’s picture

Liam, I think I have a solution to my problem. Thank you for the dpm() advice. It showed me that when I create a new view as a webform submission that by default it changes Display Format to: Unformatted List of "Calendar Entities", rather than say: Fields. The illegal action was on Calendar Entities, perhaps because they are not allowed in WebForms, I'm not sure. But, changing this to Fields removes the error.

Thank you again. I hope this may help someone who might be experiencing a similar issue.