After updating Views from 7.x-3.0-rc1 to 7.x-3.0-rc3, the following errors appear in my views that have the "Workbench Moderation: Moderation History Link" field.
Error message
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /var/www/drupal-7.9/includes/entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /var/www/drupal-7.9/includes/entity.inc).
Recoverable fatal error: Object of class stdClass could not be converted to string in DatabaseStatementBase->execute() (line 2135 of /var/www/drupal-7.9/includes/database/database.inc).
The errors disappear when I remove the field, and re-appear when I add it again. The view doesn't come up at all.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | views_history_link-1350996.patch | 718 bytes | ccarigna |
| #6 | views_link-1350996.patch | 714 bytes | stevector |
Comments
Comment #1
kolafson commentedComment #1.0
kolafson commentedAdded message about updating views as well
Comment #2
kolafson commentedIt appears that the issue was related to location content on my sites. Still need to investigate the root cause, but if there are any problems with Workbench Moderation I will make another ticket with more detaiils.
Comment #3
kolafson commentedThe issue appeared again, so I set up a site from scratch and was able to reproduce it outside of my install profile.
Steps to reproduce:
1. Install a Drupal 7.9 site with the Standard profile
2. Download and enable the latest (non-dev) views, ctools, workbench and workbench moderation
3. Turn on moderation for the Basic Page content type
4. Make a view, table style
5. Try to add the Moderation History link field
6. You receive this error:
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/structure/views/view/test_view/preview/page/ajax
StatusText: Service unavailable (with message)
ResponseText: Recoverable fatal error: Object of class stdClass could not be converted to string in DatabaseStatementBase->execute() (line 2137 of /var/www/drupal-7.9/includes/database/database.inc).
Comment #4
stevectorI was not able to reproduce your error. In my testing the history link is simply broken and not rendering a link. I'm not seeing an error message.
I suspect this Views change is the reason: #1172970: provide a unified way to retrieve result entities
Comment #5
stevectorI was able to reproduce the error when building a View with {node} as the base table. I made my previous comment testing with {node_revision} as the base table.
Comment #6
stevectorThis issue also is in play here: #1270890: provide a way to provide entity-related views fields
I tried this but it didn't change the error.
Comment #7
ccarigna commentedThe issue is with the render_link function in workbench_moderation_handler_field_history_link.inc --
The latest version of Views has changed how the render_link function works (see views_handler_field_node_link_edit.inc for the latest example), no longer using $this->get_value($values, 'nid') to get a node ID. Instead, the node gets passed directly, replacing the $data argument.
Note that the changes in this patch will work for views RC3 or higher, but will give an error message when used with an older version of views.
Comment #8
stevectorThe patch in #7 does not change the end behavior I'm seeing. In my testing, the render() function is not being reached.
cwc, can you confirm this is working for you?
Comment #9
ccarigna commentedI can confirm that this is working for me. I went through the steps in #3 to reproduce the errors, and applying the patch fixed them.
The patch is changing code within the render_link() function. If the function isn't even being reached, would that be a different issue?
Comment #10
ccarigna commentedHere is the exported view I was using for testing:
Comment #11
kolafson commentedThe patch in #7 worked for me.
Comment #12
kolafson commentedUpgraded views to 3.1 and the link no longer appears.. no error though!
Comment #13
hass commentedWe are post views 3.5. is this still an issue?
Comment #14
stevectorComment #14.0
stevectorClarified issue - it is related only to the views update, not entity.