I'm not sure what is causing this, but after updating to the latest dev an existing View of mine is dying with a fatal error. Specifically:

Fatal error: Class 'EntityReference_SelectionHandler_Broken' not found in /home/crell/public_html/webbspace7/sites/all/modules/entityreference/entityreference.module on line 159

What confuses me is that class does exist, and is in plugins/selection/abstract.inc. That file is listed in the files[] array in the info file, as it should be. I have flushed and reloaded the registry and all caches, yet that class is not showing up in the registry for some reason. In fact, the entire plugin directory is missing from the registry.

I suspect some bizarre ctools interaction, since I know it does funky things with the registry in the name of DX, but I'm not sure what or why.

Comments

damien tournoud’s picture

Status: Active » Postponed (maintainer needs more info)

There seems to be two issues here:

- the selection handler you are using failed to load (probably because our CTools classes were not named properly)
- the broken handler also failed to load

The first issue should be fixed in the current dev version. I have no idea why you are bumping in the second. I did check and the broken handler is properly registered in the registry on my current install.

Could you check if the current 7.x-1.x branch fixes the issue(s) for you?

shendric’s picture

Hello,

I'm just seconding this issue. I just tried to install the latest dev version and I got that same error when I tried to create an Entity Reference field on a content type.

Crell’s picture

I just tried again with today's dev snapshot. Same problem. Complete error message follows:

Edit: I tried this with the last stable ctools and with today's ctools dev snapshot. No change.

Fatal error: Class 'EntityReference_SelectionHandler_Broken' not found in /home/crell/public_html/webbspace7/sites/all/modules/entityreference/entityreference.module on line 164

Call Stack:
    0.1081     644032   1. {main}() /home/crell/public_html/webbspace7/index.php:0
    0.3527   39456176   2. menu_execute_active_handler(???, ???) /home/crell/public_html/webbspace7/index.php:21
    0.3530   39457368   3. call_user_func_array(???, ???) /home/crell/public_html/webbspace7/includes/menu.inc:503
    0.3530   39457984   4. page_manager_page_execute(???, ???) /home/crell/public_html/webbspace7/includes/menu.inc:0
    0.3561   39688744   5. ctools_context_handler_render(???, ???, ???, ???) /home/crell/public_html/webbspace7/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc:321
    0.3653   40067648   6. ctools_context_handler_render_handler(???, ???, ???, ???, ???, ???) /home/crell/public_html/webbspace7/sites/all/modules/ctools/includes/context-task-handler.inc:44
    0.3656   40067728   7. panels_panel_context_render(???, ???, ???, ???) /home/crell/public_html/webbspace7/sites/all/modules/ctools/includes/context-task-handler.inc:103
    0.3760   40495760   8. panels_render_display(???, ???) /home/crell/public_html/webbspace7/sites/all/modules/panels/plugins/task_handlers/panel_context.inc:287
    0.3761   40495920   9. panels_display->render(???) /home/crell/public_html/webbspace7/sites/all/modules/panels/panels.module:1057
    0.3763   40496056  10. panels_renderer_standard->render() /home/crell/public_html/webbspace7/sites/all/modules/panels/panels.module:729
    0.3764   40499368  11. panels_renderer_standard->render_layout() /home/crell/public_html/webbspace7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php:349
    0.3846   41349840  12. panels_renderer_standard->render_panes() /home/crell/public_html/webbspace7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php:378
    0.3846   41350808  13. panels_renderer_standard->render_pane(???) /home/crell/public_html/webbspace7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php:457
    0.3846   41350808  14. panels_renderer_standard->render_pane_content(???) /home/crell/public_html/webbspace7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php:476
    0.3847   41351280  15. ctools_content_render(???, ???, ???, ???, ???, ???, ???) /home/crell/public_html/webbspace7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php:541
    0.3869   41433736  16. views_content_views_panes_content_type_render(???, ???, ???, ???, ???) /home/crell/public_html/webbspace7/sites/all/modules/ctools/includes/content.inc:278
    0.5064   52178184  17. view->preview(???, ???) /home/crell/public_html/webbspace7/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc:291
    0.5380   55106056  18. views_plugin_display->preview() /home/crell/public_html/webbspace7/sites/all/modules/views/includes/view.inc:1153
    0.5380   55106136  19. view->render(???) /home/crell/public_html/webbspace7/sites/all/modules/views/plugins/views_plugin_display.inc:2594
    0.5380   55106216  20. view->execute(???) /home/crell/public_html/webbspace7/sites/all/modules/views/includes/view.inc:1004
    0.5682   56429568  21. view->_post_execute() /home/crell/public_html/webbspace7/sites/all/modules/views/includes/view.inc:985
    0.5682   56431200  22. views_handler_field_field->post_execute(???) /home/crell/public_html/webbspace7/sites/all/modules/views/includes/view.inc:602
    0.5739   56510808  23. views_handler_field_field->set_items(???, ???) /home/crell/public_html/webbspace7/sites/all/modules/views/modules/field/views_handler_field_field.inc:613
    0.5740   56516536  24. field_view_field(???, ???, ???, ???, ???) /home/crell/public_html/webbspace7/sites/all/modules/views/modules/field/views_handler_field_field.inc:770
    0.5753   56530512  25. _field_invoke_default(???, ???, ???, ???, ???, ???) /home/crell/public_html/webbspace7/modules/field/field.module:934
    0.5753   56531296  26. _field_invoke(???, ???, ???, ???, ???, ???) /home/crell/public_html/webbspace7/modules/field/field.attach.inc:375
    0.5755   56536144  27. field_default_view(???, ???, ???, ???, ???, ???, ???, ???) /home/crell/public_html/webbspace7/modules/field/field.attach.inc:198
    0.5755   56537040  28. entityreference_field_formatter_view(???, ???, ???, ???, ???, ???, ???) /home/crell/public_html/webbspace7/modules/field/field.default.inc:210
    0.5756   56537352  29. entityreference_get_selection_handler(???, ???) /home/crell/public_html/webbspace7/sites/all/modules/entityreference/entityreference.module:852
Crell’s picture

And I have no clue what I did, but I just spent the last hour stepping through the registry rebuild process in ctools in a debugger without changing anything. And now it does work. I haven't a clue how or why, since I'd cleared all my caches before multiple times.

amitaibu’s picture

@Crell,I definitely think magic is somehow related :)

mrconnerton’s picture

I've upgraded to the latest dev and have the same error. Attempting to find the magic.

mrconnerton’s picture

I went back to 7.x-1.0-beta3 and stepped up one commit at a time. I got up to d9a914dbb8c176b04b6326260cc3565cd8c47e49 which was the last commit before stuff started to break for me.

d9460f8c0633ccbfdad8c0cf9914f7e312282ee4 is when things got hinky. Every commit after this tossed errors.

# git checkout d9460f8c0633ccbfdad8c0cf9914f7e312282ee4; drush sql-query "truncate cache"; drush cc all;
Previous HEAD position was d9a914d... Issue #1319040 follow up: update the field's indexes on update, to prevent WSOD when editing an existing field.
HEAD is now at d9460f8... Issue #1422580: Implement CTools class support properly to get automatic autoloading of the class plugins.

require_once(/*/sites/all/modules/contrib/entityreference/plugins/selection/base.class.php): failed to open stream: No such file or directory      [warning]
bootstrap.inc:3004
PHP Fatal error:  require_once(): Failed opening required '/*/sites/all/modules/contrib/entityreference/plugins/selection/base.class.php' (include_path='.:/usr/share/php:/usr/share/pear') in /*/includes/bootstrap.inc on line 3004
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                     [error]
Error: require_once(): Failed opening required '/*/sites/all/modules/contrib/entityreference/plugins/selection/base.class.php'
(include_path='.:/usr/share/php:/usr/share/pear') in /*/includes/bootstrap.inc, line 3004

I have the latest dev of ctools and field_collection modules in addition to the working commit above of this.

micheas’s picture

This may or may not help as a clue to what is going on, but I "fixed" this on two sites by running 'drush cache-clear'. On one site I had to clear the cache twice.

I don't understand drupal's caching well enough to know what the problem was.

mrfelton’s picture

I also get this error when trying to edit a node that has an entityreference field with no value set. entityreference-7.x-1.0-beta5 and latest ctools dev. Clearing the cache, or registry has no effect.

creativenode’s picture

I had this error and fixed it by clearing each cache separately via Drush. If I cleared all caches I got some error messages (see below) but after clearing them individually all worked fine. Subsequent clearing of all caches work without a problem.

WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: [error]
1146 Table 'db.field_data_field_feed_item_description'
doesn't exist: SELECT COUNT(*) AS expression
FROM 
(SELECT DISTINCT field_data_field_feed_item_description0.entity_type
AS entity_type, field_data_field_feed_item_description0.entity_id AS
entity_id, field_data_field_feed_item_description0.revision_id AS
revision_id, field_data_field_feed_item_description0.bundle AS
bundle, 1 AS expression
FROM 
{field_data_field_feed_item_description}
field_data_field_feed_item_description0
WHERE  (field_data_field_feed_item_description0.deleted =
:db_condition_placeholder_0) 
LIMIT 1 OFFSET 0) subquery; Array
(
    [:db_condition_placeholder_0] => 0
)
 in field_sql_storage_field_storage_query() (line 577 of
httpdocs/modules/field/modules/field_sql_storage/field_sql_storage.module).
Cannot modify header information - headers already sent by (output   [warning]
started at /usr/share/pear/drush/commands/core/clear.cache.inc:2)
bootstrap.inc:1239
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'iscore-drupal7-v3.field_data_field_feed_item_description' doesn't exist: SELECT COUNT(*) AS expression
FROM 
(SELECT DISTINCT field_data_field_feed_item_description0.entity_type AS entity_type, field_data_field_feed_item_description0.entity_id AS entity_id, field_data_field_feed_item_description0.revision_id AS revision_id, field_data_field_feed_item_description0.bundle AS bundle, 1 AS expression
FROM 
{field_data_field_feed_item_description} field_data_field_feed_item_description0
WHERE  (field_data_field_feed_item_description0.deleted = :db_condition_placeholder_0) 
LIMIT 1 OFFSET 0) subquery; Array
(
    [:db_condition_placeholder_0] => 0
)
 in field_sql_storage_field_storage_query() (line 577 of httpdocs/modules/field/modules/field_sql_storage/field_sql_storage.module).
Drush command terminated abnormally due to an unrecoverable error.   [error]
DizzyC’s picture

Had the same issue with beta-5.
I have just updated to rc1 and the problem has gone away.

This issue might be fixed.

Can anyone confirm that the problem is gone with rc1?

mrfelton’s picture

Status: Postponed (maintainer needs more info) » Active

Still get the problem with rc1.
EDIT: Actually, after flushing the caches with a call to drupal_flush_all_caches(), the problem has gone away.

Joel MMCC’s picture

Version: 7.x-1.x-dev » 7.x-1.0-rc1
Priority: Normal » Major

@mrfelton (re: #12), I, too, still have the same problem with rc1.

I’ve not yet tried clearing all caches with rc1 in place, since it was a production site and had to be back up ASAP so I restored beta3 (the last working version for us) from the drush-backups folder before finding this Issue.

But since “drush pm-update” includes “drush updatedb” which clears all caches after applying the pending database updates (if any — it still clears the caches even if there are no pending updates, and there were some in this case for other modules that got updated in the same pass), I’d’ve thought that this would’ve worked, and come to think of it, I did check the View after doing the update a couple days ago, and things were working fine.

Yet a couple days later, they’re not. So, apparently, if there is any caching going on, it breaks again, even if it was working fine before. Methinks that clearing the caches is only a temporary solution, a band-aid that needs to be applied repeatedly.

Since this completely disables sites that use certain key modules, I think that this should at least be “major,” if not “critical.”

damien tournoud’s picture

Status: Active » Postponed (maintainer needs more info)

Does anyone know how to reproduce the problem? Only a fraction of people seem to be affected by the problem. Could anyone give more details here (especially the versions of Drupal core, contributed modules and Drush affected by the problem)?

Joel MMCC’s picture

@Damien (#14), I suspect now that it may be the Calendar module and its related Date module. A few releases ago, KarenS deprecated the Calendar Items Views Format, and replaced it with Calendar Entities. For awhile there, these were not working correctly (#1394108: New Calendar Entities Format not working!), but are now.

However, anyone who’d set up their Calendar using the Date Tools Wizard (highly recommended as it automates a lot of drudge work in setting up the necessary Views) until relatively recently had their Calendar set up to use the now-deprecated Calendar Items for all View Displays except Upcoming (which just uses Fields from the calendar Event node type) and RSS (which uses a special Date Feed API). The latest versions of the modules now includes an updated Date Tools with a new Wizard that builds the Calendar View Displays (Master, Day, Week, Month, Year, Block, etc.) using Calendar Entities instead of Calendar Items, and since the old Views can no longer be deleted from the Views listing, the Date Tools also provides a user interface for deleting old Wizard-built Calendar Views.

Basically, if you have Calendar, you should Export your existing Calendar View(s) (especially if you’ve customized them), then use the Date Tools to delete it/them, then the Date Tools Wizard to recreate it/them, then re-apply any customizations manually by using the Export info to remind you of them.

I suspect that having an old-format Calendar using Items instead of Entities may be interacting with Entity Reference to cause the error message. For me, it happened with the Front page that has a Block displaying the Upcoming Events (from the Upcoming Display of the old Wizard-built View, customized by me) that was set to appear only on the Front page. That was the only page that gave the error (I never tried it with an actual Calendar View Display [Day, Week, Month, or Year] page, though I suspect that it would’ve happened then as well). The Upcoming Display does not use Items nor Entities, but it would still reference the Master Display, which did use Calendar Items, and so if there was an interaction with Entity Reference involving Calendar Items, then it could conceivably still be triggered by even the Upcoming or RSS Displays.

I have since converted the View to use Entities on all Displays (except Upcoming and RSS, the latter of which I also upgraded to use the latest Date Feed API instead of the now-deprecated Calendar Feed API), so that should be the same as if I had deleted the old View and re-built it using the new Wizard. When I get a chance (this is a production site so I don’t want to risk the error coming up on the home page for any longer than I absolutely have to), I’ll re-update to rc1 and see if that fixes it. If not, I’ll try using the new Date Wizard and re-applying my customizations and see if that fixes it. In both cases, I’ll do several views of several pages to build the cache back up.

At any rate, this would explain why it only happens to some people: those who had Calendars still using the now-deprecated Calendar Items (and other Modules that use now-deprecated techniques), and only on pages using those.

joachim’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active

I am seeing this error, and I don't have Calendar module installed. I do have Date module though.

The error was introduced somewhere between betas 3 and 4. Git bisect says:

7457a9dc05f2cfb10e040ab3c59cfaa115d2e34c is the first bad commit
commit 7457a9dc05f2cfb10e040ab3c59cfaa115d2e34c
Author: fabsor
Date: Thu Jan 26 17:52:13 2012 +0200

Issue #1412572: Fixed No access check when referred items are being viewed.

:100644 100644 bb66503fb0f241fad88856f5801a78490eb30a85 e0efa7efcf3a3e69e2a781afd63afab0f1cedfa0 M entityreference.module

davidwhthomas’s picture

I'm getting a related error:

PHP Fatal error: Interface 'EntityReference_SelectionHandler' not found in .../sites/all/modules/contrib/entityreference/plugins/selection/EntityReference_SelectionHandler_Generic.class.php on line 9

entityreference 7.x-1.0-rc1
ctools 7.x-1.0

I notice the Interface is defined in abstract.inc and included in
entityreference.info files[] = plugins/selection/abstract.inc

I'm able to clear a couple of caches with drush, but can't clear the class registry without the fatal error above.

The error occurs when loading any entity with an entityreference field on it.

Perhaps it's an issue with module weight and ctools loading the plugins before entityreference has loaded?

Update:

Perhaps it's an issue with module weight and ctools loading the plugins before entityreference has loaded?

Bingo, I adjusted the weight of entityreference module to come before ctools ( both were weight 0 )

update system set weight = -1 where name = 'entityreference';

and that fixed the issue for me.

Hopefully it's ok to keep that weighting... a different fix would be preferable.

davidwhthomas’s picture

Perhaps it's an issue with module weight and ctools loading the plugins before entityreference has loaded?

Bingo, I adjusted the weight of entityreference module to come before ctools ( both were weight 0 )

update system set weight = -1 where name = 'entityreference';

and, after drush cc registry, that fixed the issue for me.

However, I then found the error on the entityreference field settings form

"The selected selection handler is broken."

I then reverted the entityreference module weight back to default 0

update system set weight = 0 where name = 'entityreference';

and cleared all caches

drush cc all

All all was well again.

In summary the steps were

  1. SQL update system set weight = -1 where name = 'entityreference';
  2. Cache clear: drush cc all ( or perhaps you can clear all caches from admin > config > performance )
  3. SQL update system set weight = 0 where name = 'entityreference';
  4. Cache clear: drush cc all ( or perhaps you can clear all caches from admin > config > performance )

Shenanigans, but it fixed the issue for me.

I hope that helps.

DT

jonathan_hunt’s picture

FWIW, I just got this error on Drupal 7.14 (Commerce Kickstart 7.x-1.8). running Entity Reference 7.x-1.0-rc1. After drush dl, I entered drush en --yes entityreference and got "Fatal error: Interface 'EntityReference_SelectionHandler' not found in /Sites/commerce_kickstart-7.x-1.8/sites/commerce.local/modules/entityreference/plugins/selection/EntityReference_SelectionHandler_Generic.class.php on line 9"

No Date module in this install. I tried to install EntityReference because Commerce Coupon now uses it. Clearing cache fails with the same error. Following @davidwhthomas's steps 1-4 above cleared the error.

BJ___’s picture

I had the same error in combination with Commerce Coupon. "drush dis entityreference" says that it disables Entity Reference and Commerce Coupon related modules however Entity Reference remains enabled.

-"Drush cc all"
-Enable Commerce Coupon and friends again.
-"Drush cc all"

And it works ....total Voodoo...

spineless’s picture

I am getting the following error when I attempt to update the scripts for the database.

Fatal error: Interface 'EntityReference_SelectionHandler' not found in /home/www/sites/all/modules/entityreference/plugins/selection/EntityReference_SelectionHandler_Generic.class.php on line 9

I recently had to update the following modules.

addressfield-7.x-1.0-beta3.tar
commerce_coupon-7.x-1.0-beta5.tar
commerce_features-7.x-1.0-alpha1.tar
devel-7.x-1.3.tar
entity-7.x-1.0-rc3.tar
entityreference-7.x-1.0-rc3.tar
features-7.x-1.0-rc3.tar
privatemsg-7.x-1.3.tar
title-7.x-1.0-alpha3.tar

I am running Drupal 7.14.

I am not sure why I am getting this error. My site appears to work other then this one error.

Is someone working on this?

Thanks,

Spineless

spineless’s picture

So I ran the database script again and got a different type of error which crashed the update script routine.

Fatal error: Interface 'EntityReference_SelectionHandler' not found in /home/www/sites/all/modules/entityreference/plugins/selection/EntityReference_SelectionHandler_Generic.class.php on line 9

I did not make any changes but redid the script again. Then the script succeeded but I go thits error as a result.

Update #7004
Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'site.commerce_coupon_log' doesn't exist: SELECT * FROM {commerce_coupon_log}; Array ( ) in commerce_coupon_update_7004() (line 225 of /home/www/sites/all/modules/commerce_coupon/commerce_coupon.install).

Hope this helps,

Spineless

davidwhthomas’s picture

@spineless,

Did you try my workaround from #18

Re: the coupon_log error looks like your db is in an odd state, you could try wrapping that update hook in if(db_table_exists()) and running again.

// commerce_coupon.install update_7004 line 230
if (db_table_exists('commerce_coupon_log')) {
  // Migrate all coupon log references to the field in the order.
  $logs = db_query('SELECT * FROM {commerce_coupon_log}')->fetchAllAssoc('log_id', PDO::FETCH_ASSOC);
  foreach ($logs as $log) {
    if ($order = commerce_order_load($log['order_id'])) {
      $order->commerce_coupon_order_reference[LANGUAGE_NONE][]['target_id'] = $log['coupon_id'];
      commerce_order_save($order);
    }
  }
}
spineless’s picture

This is interesting......

I am not using drush. Not sure what it does really.... I upload my files via filezilla and access the files via SSH.

I attempted to run the commands you mentioned in #18 but of course they are not standard linux commands so they did not work.

Where would I put the code you have written. Which file? and which line?

Thanks,

Spineless

davidwhthomas’s picture

Where would I put the code you have written. Which file? and which line?

Check the comment above the code, the file / line number info is there. ( // commerce_coupon.install update_7004 line 230 )

P.S If you're on linux, you should find out about drush.

spineless’s picture

I was able to install drush. I will look into how it works. Thanks a lot. this looks useful.

I updated the code in the commerce coupon.install and the error still exists.

I attempted to do the steps in step 18 above but I am unsure how to do the first couple of steps.

How do I update

mysql update system set weight = -1 where name = 'entity reference';

I typed this is the command line on the server but Ubuntu does not recognize the command update.

I get the error

mysql: unknown option '-1'

chrisschaub’s picture

I'm getting this error ...

Error: Cannot redeclare class EntityReference_BehaviorHandler_Broken in .../modules/entityreference/plugins/behavior/abstract.inc, line 187

I'm trying to clone the site with aegir. I was able to clone (make a copy) in the past ( a day ago), but now drush is complaining. The workarounds in #18 did not help. I am using date and calendar, but the latest versions, the new approach to calendars using templates and entities.

Also, using Drupal 7.14, entityref 7.1-dev from 7/8. I am also seeing this in the wathdog log:

Notice: Undefined index: controller class in entity_get_controller() (line 7655 of includes/common.inc).

Very weird. Aegir just uses drush to make a copy of the site under a different url. It seems that there is some module weight / registry issue. I've tried all of the stuff above, no workaround works. Drush 4.5.

bendev’s picture

Version: 7.x-1.x-dev » 7.x-1.0-rc3

I have a similar error and the above proposals didn't help

I tried to disable uninstall and reinstall coupon but it didn't help

EntityMetadataWrapperException : Unknown data property commerce_coupon_order_reference. dans EntityStructureWrapper->getPropertyInfo() (ligne 339 dans /sites/all/modules/entity/includes/entity.wrapper.inc).

any idea ?

drupal 7.15
coupon : beta 6
entity reference 7.x-1.0-rc3

thanks a lot !

plonk’s picture

Status: Active » Needs work

adding a

require_once('abstract.inc');

at the top of the plugins/selection/EntityReference_SelectionHandler_Generic.class.php file fixed the issue for me. It is a dirty hack, but seemingly including through the files[] array does not work. Core bug?

joachim’s picture

> It is a dirty hack, but seemingly including through the files[] array does not work

You may need http://drupal.org/project/registry_rebuild.

grasmash’s picture

@ #29

Along those lines, I added:

    module_load_include('inc', 'entityreference', 'plugins/behavior/abstract');

To entityreference.module, just before the offending line (175). So, it ends up being:

    module_load_include('inc', 'entityreference', 'plugins/behavior/abstract');
    $class = class_exists($class) ? $class : 'EntityReference_BehaviorHandler_Broken';

Not sure if this is a hint, but I saw this error immediately after clearing cache:

WD ctools: Invalid plugin module/type combination requested: module      [error]
entityreference and type behavior

Seems like CTOOLs might load the entity reference plugin BEFORE Drupal has finished bootstrapping file includes for the entityreference module.

socialnicheguru’s picture

thanks madmatter23.

your one line addition allowed me to continue with the install and I did get the same errors.

plonk’s picture

Status: Needs work » Needs review
StatusFileSize
new626 bytes

Made a patch from #31

plonk’s picture

EDIT: Oops, forgot to type somthing in the edit field.
@maddmatter23: You may have a different error if I'm not mistaken. Does you Error say something about the BehaviorHandler or the SelectionHandler? On that note, a patch for #29

marc angles’s picture

I had problem cloning my site in aegir.

In short, it was firing this error

Cannot redeclare class EntityReference_SelectionHandler in modules/entityreference/plugins/selection/abstract.inc, line 10

I applied this patch on 7.x-1.0 and the site is cloning. Thanks a lot

Paul B’s picture

I get the error from #17 (Class 'EntityReference_SelectionHandler_Generic' not found) with Organic Groups. It works if I add the line

module_load_include('php', 'entityreference', 'plugins/selection/EntityReference_SelectionHandler_Generic.class');

to OgSelectionHandler.class.php.

drvdt’s picture

Before every thing are well with me. But It appears again with version 7.x-1.1
Any help?

marcoscano’s picture

Same problem here, although in my case none of the solutions indicated above worked. The problem appeared when upgrading from 7.x-1.1 to latest -dev version and running update.php

marc angles’s picture

Trying to clone a site in aegir I had this error :

Error: Cannot redeclare class SelectionHandler in EntityReference_entityreference/plugins/selection/abstract.inc, line 10

#18 did the trick. Thanks a lot.

psynaptic’s picture

We came across this problem and discovered that the entityreference module was disabled without deleting the associated fields.

ndenhild’s picture

Issue summary: View changes

#18 did it for me, thanks davidwhthomas, you saved my day!

robloach’s picture

Version: 7.x-1.0-rc3 » 7.x-1.1
StatusFileSize
new1.56 KB

Cleaned up the changes, and included them with __FILE__ rather than module_include, as that wasn't available so early though Drush.

Source: https://github.com/RobLoach/entityreference/tree/patch-1

kclarkson’s picture

yeah @RobLoach

thanks for the patch love!

confirming that patch from #42 worked for me

socialnicheguru’s picture

42 worked for me also.

ezoulou’s picture

Great :-)
Patch #42 work just fine.
I'm using Drupal 7.50 + EntityReference 7.x-1.2.
Thanks for the patch.

tjcvd’s picture

I have this error Fatal error: Call to undefined function ctools_include() in /home/sarelres/public_html/sarel/sites/all/modules/contrib/entityreference/entityreference.module on line 194

chris matthews’s picture

Version: 7.x-1.1 » 7.x-1.x-dev

#43 -

confirming that patch from #42 worked for me

#43 -

42 worked for me also.

#44 -

Patch #42 work just fine.

I believe @tjcvd's error is unrelated to this issue.

Ready for RTBC status?

elusivemind’s picture

Patch 42 works. I think we can reliably say it is RTBC

nwom’s picture

Patch #42 worked great. I had the same error when importing an Aegir backup into a new site.

This fixes a long lasting related issue here as well #1680000: Drush / Aegir broken with latest entityreference

irinaz’s picture

Status: Needs review » Reviewed & tested by the community
joseph.olstad’s picture

StatusFileSize
new1.56 KB

Straight up reroll, just for fuzz and to satisfy the cicd.

alex.skrypnyk’s picture

StatusFileSize
new1.57 KB

Updated patch in #51 with a check for the $class as it may be NULL

joseph.olstad’s picture

Thanks to:
plonk,
RobLoach,
alex.skrypnyk,
joseph.olstad,
spineless,
davidwhthomas,
Crell,
Marc Angles,
mrfelton,
Joel MMCC,
SocialNicheGuru,
joachim,
mrconnerton,
Damien Tournoud,
jonathan_hunt,
irinaz, DizzyC,
BJ
shendric
amitaibu
micheas
creativenode
NWOM
tjcvd
psynaptic
ndenhild
Chris Matthews
ezoulou
kclarkson
marcoscano
drvdt
chrisschaub
bendev
ElusiveMind
Paul B
grasmash
Alex Skrypnyk

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

joseph.olstad’s picture