This error happens on the view page at: /admin/structure/views/nojs/config-item/search_results/page/filter/search_api_views_fulltext

Call Stack
#	Time	Memory	Function	Location
1	0.0135	637096	{main}( )	../index.php:0
2	0.0611	1433048	drupal_bootstrap( $phase = 7, $new_phase = ??? )	../index.php:20
3	0.5011	14340192	_drupal_bootstrap_full( )	../bootstrap.inc:2218
4	3.6487	77867224	menu_set_custom_theme( )	../common.inc:5139
5	3.6487	77867272	menu_get_custom_theme( $initialize = TRUE )	../menu.inc:1770
6	3.7093	80082656	menu_get_item( $path = ???, $router_item = ??? )	../menu.inc:1755
7	3.7094	80083520	menu_rebuild( )	../menu.inc:459
8	3.7109	80084432	menu_router_build( )	../menu.inc:2713
9	4.5668	111963200	call_user_func ( 'profile2_page_menu' )	../menu.inc:2744
10	4.5668	111963200	profile2_page_menu( )	../menu.inc:2744
11	4.5670	111963416	profile2_get_types( $type_name = ??? )	../profile2_page.module:19
12	4.5670	111963592	entity_load_multiple_by_name( $entity_type = 'profile2_type', $names = FALSE, $conditions = ??? )	../profile2.module:152
13	4.5670	111963808	entity_load( $entity_type = 'profile2_type', $ids = FALSE, $conditions = array (), $reset = ??? )	../entity.module:212
14	4.5670	111963856	entity_get_controller( $entity_type = 'profile2_type' )	../common.inc:7776
Variables in local scope (#14)
$class =
null
$controllers =
&
array (size=0)
  empty
$entity_type =
string 'profile2_type' (length=13)
$type_info =
null

Related:
#1388158: Profile2 module creates "Fatal Error"

Comments

heylookalive’s picture

Just had this error come up myself.

It would seem profile2 is passing entity_get_controller() an NULL string instead of a valid class name. That or something else is altering the info and messing with it.

Drupa1ish’s picture

Status: Active » Needs review
StatusFileSize
new978 bytes

#1388158: Profile2 module creates "Fatal Error" states the upgrading profile2 fixed the issue ( in dec 2011), but the error stil exists in version 7.x-1.3, of dec 2012

The patch works, but I wasn't happy with the hacking core.
After further investigation, google criteria "Class name must be a valid object or a string" , a relevant comment of @Fago #1313088-5: Fatal error: Class name must be a valid object or a string in drupal/includes/common.inc on line 7522, leads me first to #1325126: uninstallation troubles due to outdated entity info , then to the root issue #996236: drupal_flush_all_caches() does not clear entity info cache

@Sun enlightened me: "Yes, this patch is known to only improve the situation. The issue merely got lengthy as we were discussing what the actual root cause and "proper" approach/solution would be. This patch here is a stop-gap fix. The major API change to fix it properly happens over in #1404198: Separate database cache clearing from static cache clearing and data structure rebuilding"

  • drupal_flush_all_caches() clears caches, but also issues several kind of rebuilds.
  • There are many interdependencies between the caches and rebuilds.
  • Rebuilds may be based on other stale/old/invalid cached data, which hasn't been cleared yet.
  • In turn, rebuilt data can be entirely bogus or incomplete.

#1404198: Separate database cache clearing from static cache clearing and data structure rebuilding doesn't even try to backport to D7, because of majore API changes required.

So, I am not guilty anymore for fixing the issue by hacking core :)

Status: Needs review » Needs work

The last submitted patch, 2: class_name_must_be_a_valid_object_profile2-2085113-2.patch, failed testing.

Drupa1ish’s picture

Drupa1ish’s picture

kenorb’s picture

You have to check the debug_backtrace() and track the problem in Profile 2, as it doesn't make sense to hack the core, if there is something fishy going on with Profile 2.
Secondly this patch won't be committed into Drupal core without any reproducible steps. So if you need this fix to be maintainable, you need to fix it against Profile 2 module.

Drupa1ish’s picture

@kenorb, Of course fixing in profile2 is the right way, but the bug is perverse , as stated in #996236: drupal_flush_all_caches() does not clear entity info cache, sometimes hard to reproduce ( after cache clearing magically fixed for good). In our use case, we needed to revert to a previous database dump to debug the error (btw occurs only via drush). Unfortunately, our project deadline doesn't allow us to dive to deep into this.

Just before your post, we ran #2611370: Test for Class name must be a valid object in includes/common.inc profile2 with very few failures, but closed as won't fix, because is so obvious that this won't be committed to core.

kenorb’s picture

@Drupa1ish If you think it's caching, probably memcached (if you're using it)? Or some other over-aggressive cache? Check if you're using any external caches, make sure the prefixes are different for each environment.

If you're using Devel, I would add dd() into the core and track that down.

For example:

  if (!isset($entity_info['profile2_type'])) {
    dd($entity_info); dd(debug_backtrace());
  }

and see if that would help. Or something similar, for 2nd part of your code (in cache section) if that's the better place to place it.

Drupa1ish’s picture

@kenorb, the testing is done with Drupal core database cache. Devel is good, but for deep debugging we use Phpstorm/Xdebug.
The symptoms described in #1404198: Separate database cache clearing from static cache clearing and data structure rebuilding are discouraging, it's seems that is a real mess there.

  • drupal_flush_all_caches() clears caches, but also issues several kind of rebuilds.
  • Rebuilds may be based on other stale/old/invalid cached data, which hasn't been cleared yet.
  • In turn, rebuilt data can be entirely bogus or incomplete.

The main issue, as always, is time budget. Sorry we won't dive deeper, we stick it to the superficial fix.

rickj’s picture

Is anyone still experiencing this issue?

There have been several updates to core since the last comment, and this may not be a bug in profile2 at all.

I've recently joined the project as a maintainer, and trying to clear up some of the the old issues! If this is not a problem any more I'll close it.

Thanks

rickj’s picture

Status: Needs work » Closed (outdated)