Problem

When updating Open Outreach, or when updating one or more of the modules shipped with Open Outreach, an error message appears: "Warning: class_exists() expects parameter 1 to be string, array given in the function _views_create_handler()"

Cause

This error appears to originate with the moving of a views handler from debut_media to file_entity when #1215712: Add a views field handler for displaying the rendered file was committed. See #1845132: Duplicate class views_handler_field_file_rendered with latest file_entity module. Since two handlers are registered with the same name, their data are appended to an array rather than a string.

Solution

To solve this error, first make sure that you don't have duplicate versions of the handlers. If you updated debut_media, ensure you delete the file debut_media/views/views_handler_field_file_rendered.inc. After doing so you will need to immediately flush your file registry. You can do so by flushing all caches. It's best to log into your site and be prepared to flush caches before you delete the file.

If the error persists, you may need to "revert" one or more features or views.

Before reverting, keep in mind that, if you have made customizations to the site, you can lose them by reverting.

Start with Views. If not already enabled, enable the Views UI module. Navigate to Structure > Views (admin/structure/views) and determine if any existing views show as overridden in database. For those views, consider reverting them. If you wish, you can first clone them so that you have a copy of a view with your customizations.

You can also use the Features interface to review and revert overrides. You may wish to install the Diff module, which allows you to individually review customizations made to components of features.

To revert: under Structure > Features, find the feature you want to revert. Under the State column, click the "Overridden" or "Needs review" link. This will show you a list of what's overridden and let you revert it. See the documentation here: http://drupal.org/node/582680.

Comments

nedjo’s picture

Status: Active » Fixed

See the documentation on updating Open Outreach here: http://openoutreach.org/section/updating-your-open-outreach-site.

nedjo’s picture

Category: bug » support
wusel’s picture

Version: 7.x-1.0-rc6 » 7.x-1.x-dev
Category: support » bug
Priority: Normal » Major
Status: Fixed » Active

When I do a new install of "openoutreach-7.x-1.x-dev-core.zip" ("7.x-1.0-rc6+5-dev"), I get the error screen at the step "Prepare site" and the install stops:

    Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of ...\profiles\openoutreach\modules\contrib\views\includes\handlers.inc).
    Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of ...\profiles\openoutreach\modules\contrib\views\includes\handlers.inc).
    Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of ...\profiles\openoutreach\modules\contrib\views\includes\handlers.inc).
    Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of ...\profiles\openoutreach\modules\contrib\views\includes\handlers.inc).
    Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of ...\profiles\openoutreach\modules\contrib\views\includes\handlers.inc).
    Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of ...\profiles\openoutreach\modules\contrib\views\includes\handlers.inc).
    Notice: Undefined index: view file in user_role_grant_permissions() (line 3052 of ...\modules\user\user.module).
    Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of ...\profiles\openoutreach\modules\contrib\views\includes\handlers.inc).
    Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of ...\profiles\openoutreach\modules\contrib\views\includes\handlers.inc).
    Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of ...\profiles\openoutreach\modules\contrib\views\includes\handlers.inc).

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null 

Something is wrong. Please help. Thank you very much.

nedjo’s picture

We're working on updating the various features for a new OO release. You can help or follow along in the relevant Debut modules. The permissions issue for example is here: #1856108: Update file permissions to those provided in file_entity 7.x-2.0-unstable7.

sonicthoughts’s picture

This issue is quite prevalent:
Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler() (line 34 of /profiles/openoutreach/modules/contrib/views/includes/handlers.inc).

Try searching on google for this error and you can see who is using OpenOutreach!

http://bit.ly/YQjFU0

sonicthoughts’s picture

Just upgraded to latest dev and still have this issue!

nedjo’s picture

Title: Error "Warning: class_exists() expects parameter 1 to be string, array given in the function _views_create_handler()" » Error "Warning: class_exists() expects parameter 1 to be string, array given in _views_create_handler()"

@sonicthoughts: my advice remains the same: update contrib modules individually in Open Outreach only if there's some pressing need and you're prepared to do the sometimes extensive work that results. (And if you are prepared to do the work, please file patches!) Otherwise, wait for a new release of Open Outreach.

From what I can tell, this error results from updating individual modules in the distro. File entity in particular has changed radically since the release that's in Open Outreach RC6. To get an idea of the many hours of work that were required to update, see http://drupal.org/node/1855438, http://drupal.org/node/1856400, and http://drupal.org/node/1859002. So simply updating File entity because there's a new release available will break an Open Outreach RC6 site in many places.

I understand it's confusing to get update notices in an Open Outreach site. Following what's done in Commerce Kickstart, I've tried to address the update notifications issue in #1852898: Filter update messages to show updates for security issues, customized modules/themes, or the distro itself.

We're preparing a new release and it should be out today or tomorrow. I've just updated dev with the latest releases of the Debut features. A dev release including them will be available in a few hours. All going well, that will be the version we use for the next stable release.

All of that said, I've not seen this particular error. If you could test a clean install with the latest dev with the latest Debut releases for the issue, and if it appears give steps to reproduce, that would be great.

sonicthoughts’s picture

Ok - will test on new dev release.

BTW - I have seen some related errors w/ views. Wonder if I try to disable and reinstall views module. I have created some custom views so i thought I could try the following:
1. export custom views.
2. disable views module
3. uninstall views module
4. install views module

The question is: how do i get all the profile views from open-outreach if i uninstall (ie. wipe the views from db?)

Thanks.

vadbars@drupal.org’s picture

After install openoutreach 7.x-1.0-rc7 I again saw the same error message.

nedjo’s picture

Can you please provide exact steps to reproduce this error from a fresh install? Thanks.

vadbars@drupal.org’s picture

I again saw the error message: "openoutreach-7.x-1.0-rc7-core.tar.gz does not contain any .info files" on the /admin/modules/update.

Drush up command displays the message: "The openoutreach directory could not be found within the modules directory at /home/****/domains/*****/profiles/openoutreach, perhaps the project is enabled but has been deleted from disk".
All module files are in place.

nedjo’s picture

@vadbars@drupal.org: thanks for the additional details, but to help I need to know exactly what you're doing and how. Can you give exact steps that you have followed?

For Open Outreach udpate instructions, see http://openoutreach.org/section/updating-your-open-outreach-site.

vadbars@drupal.org’s picture

I just copy all files from openoutreach-7.x-1.0-rc7.tar.gz to the directory /profile/openoutreach/. And then run update. (I clear all caches too).
I read the page http://openoutreach.org/section/updating-your-open-outreach-site, thank you.

p.s. When I replace the files from the file_entity 7.x-2.0-unstable7 on the files from the file_entity 7.x-2.0-unstable6 , the error message disappears. Just disappear, like pictures on the pages /file/image/?page=xxx unfortunately.

sonicthoughts’s picture

I tried to run drush fu debut_media and drush fr debut_media but the issue persists. Also, when I look at the feature, it says that the fields are overwritten even though I have reverted!

nedjo’s picture

Typically you should't be running features update unless you're wanting to fork the feature. Are you running RC7? Can you reproduce the issue from a clean install (without manually updating modules)?

sonicthoughts’s picture

I reverted features and views and the problem went away.

nedjo’s picture

Status: Active » Fixed

Great!

memoday’s picture

How can you revert features and views? Steps please?

nedjo’s picture

@memoday: Under Structure > Features, find the feature you want to revert. Under the State column, click the "Overridden" or "Needs review" link. This will show you a list of what's overridden and let you revert it. See the documentation here: http://drupal.org/node/582680.

sonicthoughts’s picture

In my case I used drush

nedjo’s picture

Issue summary: View changes

Update summary.

vadbars@drupal.org’s picture

I'm sorry, but when i run update.php, i see this message:
"The following updates returned messages

file_entity module

Update #7201
Failed: DatabaseSchemaObjectExistsException: Table file_type already exists.. In function DatabaseSchema->createTable() (line 657 at file /home/.../domains/....ru/includes/database/schema.inc)."

What can I do?

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Add warning about reverting.

nedjo’s picture

Issue summary: View changes

Add info on reverting views.

Patricia_W’s picture

I just downloaded and installed RC11 and am getting this error. Is this a new occurrence or should I just follow the instructions above. I tried to revert debut media but was unable to do ... I also tried to recreate it but still no luck.

Patricia_W’s picture

Issue summary: View changes

Add info on source of error.