I'm using content profile with a userreference cck field to capture a relationship to another user.
If user A sets B as this reference and then B reciprocates by specifying A, an infinite loop of loading users/profiles occurs when either of these users is loaded.

What is happening is that A tries to load B's real name when then tries to load A which then tries to load B, etc.

I did a quick hack in realname_user to work around this. I added another static variable to keep track of realnames that have been queried. I stopped the recursion by setting a pending status for the user in question before calling realname_make_name. Its not pretty and I'm sure there is a better of doing this but at least its gotten me over the hump.

CommentFileSizeAuthor
realname_recursion.patch973 bytesbkat
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kylex’s picture

I too have come across this issue of infinite loops, and the above patch did work.

Below is the infinite call loop up to 100 iterations, hopefully it'll help the maintainers track down the issue:

Call Stack
#	Time	Memory	Function	Location
1	0.0001	95568	{main}( )	                                ../index.php:0
2	1.3128	24214112	menu_execute_active_handler( )	../index.php:19
3	1.3128	24214392	call_user_func_array ( )	        ../menu.inc:349
4	1.3128	24214920	user_admin( )	                        ../menu.inc:349
5	1.3498	24635008	drupal_get_form( )	                ../user.admin.inc:22
6	1.3498	24637016	call_user_func_array ( )	        ../form.inc:103
7	1.3498	24637640	drupal_retrieve_form( )	        ../form.inc:103
8	1.3498	24639584	call_user_func_array ( )	        ../form.inc:377
9	1.3498	24640160	user_admin_account( )	        ../form.inc:377
10	1.4737	25154096	theme( )	                                ../user.admin.inc:182
11	1.4738	25155536	call_user_func_array ( )	        ../theme.inc:668
12	1.4738	25156160	realname_username( )	        ../theme.inc:668
13	1.4738	25158632	realname_make_name( )	        ../realname_theme.inc:47
14	1.4738	25158920	_realname_make_name( )	        ../realname.module:779
15	1.4738	25160488	content_profile_load_profile( )	../realname.module:840
16	1.4777	25231816	content_format( )	                ../realname_content_profile.inc:27
17	1.4778	25235120	theme( )	                                ../content.module:1886
18	1.4778	25237352	call_user_func_array ( )	        ../theme.inc:668
19	1.4778	25238016	theme_userreference_formatter_default( )	../theme.inc:668
20	1.4778	25238648	user_load( )	                        ../userreference.module:249
21	1.4781	25247496	user_module_invoke( )        	../user.module:184
22	1.4786	25266312	realname_user( )                	../user.module:21
23	1.4786	25266832	realname_make_name( )	        ../realname.module:436
24	1.4786	25267144	_realname_make_name( )	        ../realname.module:779
25	1.4786	25268728	content_profile_load_profile( )	../realname.module:840
26	1.4804	25302792	content_format( )	                ../realname_content_profile.inc:27
27	1.4805	25306152	theme( )	                                ../content.module:1886
28	1.4805	25308376	call_user_func_array ( )	        ../theme.inc:668
29	1.4805	25309040	theme_userreference_formatter_default( )	../theme.inc:668
30	1.4805	25309704	user_load( )	                        ../userreference.module:249
31	1.4807	25318512	user_module_invoke( )	        ../user.module:184
32	1.4811	25337320	realname_user( )	                ../user.module:21
33	1.4811	25337840	realname_make_name( )	        ../realname.module:436
34	1.4811	25338152	_realname_make_name( )	        ../realname.module:779
35	1.4811	25339760	content_profile_load_profile( )	../realname.module:840
36	1.4830	25373720	content_format( )	                ../realname_content_profile.inc:27
37	1.4831	25377088	theme( )	                                ../content.module:1886
38	1.4831	25379352	call_user_func_array ( )	        ../theme.inc:668
39	1.4831	25380000	theme_userreference_formatter_default( )	../theme.inc:668
40	1.4831	25380656	user_load( )	                        ../userreference.module:249
41	1.4834	25389576	user_module_invoke( )	        ../user.module:184
42	1.4837	25408376	realname_user( )	                ../user.module:21
43	1.4838	25408896	realname_make_name( )	        ../realname.module:436
44	1.4838	25409208	_realname_make_name( )	        ../realname.module:779
45	1.4838	25410816	content_profile_load_profile( )	../realname.module:840
46	1.4856	25445584	content_format( )	                ../realname_content_profile.inc:27
47	1.4857	25448944	theme( )	                                ../content.module:1886
48	1.4857	25451176	call_user_func_array ( )	        ../theme.inc:668
49	1.4857	25451840	theme_userreference_formatter_default( )	../theme.inc:668
50	1.4857	25452504	user_load( )	                        ../userreference.module:249
51	1.4860	25462592	user_module_invoke( )	        ../user.module:184
52	1.4863	25482080	realname_user( )	                ../user.module:21
53	1.4863	25482600	realname_make_name( )	        ../realname.module:436
54	1.4864	25482912	_realname_make_name( )	        ../realname.module:779
55	1.4864	25484584	content_profile_load_profile( )	../realname.module:840
56	1.4882	25519520	content_format( )	                ../realname_content_profile.inc:27
57	1.4883	25522912	theme( )	                                ../content.module:1886
58	1.4883	25525216	call_user_func_array ( )	        ../theme.inc:668
59	1.4883	25525888	theme_userreference_formatter_default( )	../theme.inc:668
60	1.4883	25526544	user_load( )	                        ../userreference.module:249
61	1.4886	25535568	user_module_invoke( )	        ../user.module:184
62	1.4890	25555016	realname_user( )	                ../user.module:21
63	1.4890	25555536	realname_make_name( )	        ../realname.module:436
64	1.4890	25555848	_realname_make_name( )	        ../realname.module:779
65	1.4890	25557520	content_profile_load_profile( )	../realname.module:840
66	1.4908	25594608	content_format( )	                ../realname_content_profile.inc:27
67	1.4909	25597992	theme( )	                                ../content.module:1886
68	1.4909	25600288	call_user_func_array ( )	        ../theme.inc:668
69	1.4909	25600960	theme_userreference_formatter_default( )	../theme.inc:668
70	1.4909	25601592	user_load( )	                        ../userreference.module:249
71	1.4912	25610664	user_module_invoke( )	        ../user.module:184
72	1.4916	25630112	realname_user( )	                ../user.module:21
73	1.4916	25630632	realname_make_name( )	        ../realname.module:436
74	1.4916	25630944	_realname_make_name( )	        ../realname.module:779
75	1.4916	25632616	content_profile_load_profile( )	../realname.module:840
76	1.4935	25667600	content_format( )	                ../realname_content_profile.inc:27
77	1.4935	25671008	theme( )	                                ../content.module:1886
78	1.4936	25673296	call_user_func_array ( )	        ../theme.inc:668
79	1.4936	25673944	theme_userreference_formatter_default( )	../theme.inc:668
80	1.4936	25674600	user_load( )	                        ../userreference.module:249
81	1.4938	25683688	user_module_invoke( )	        ../user.module:184
82	1.4942	25703136	realname_user( )	                ../user.module:21
83	1.4942	25703656	realname_make_name( )	        ../realname.module:436
84	1.4942	25703968	_realname_make_name( )	        ../realname.module:779
85	1.4943	25705616	content_profile_load_profile( )	../realname.module:840
86	1.4961	25740592	content_format( )	                ../realname_content_profile.inc:27
87	1.4962	25743984	theme( )	                                ../content.module:1886
88	1.4962	25746264	call_user_func_array ( )	        ../theme.inc:668
89	1.4962	25746936	theme_userreference_formatter_default( )	../theme.inc:668
90	1.4962	25747568	user_load( )	                        ../userreference.module:249
91	1.4965	25756632	user_module_invoke( )	        ../user.module:184
92	1.4968	25776080	realname_user( )	                ../user.module:21
93	1.4968	25776600	realname_make_name( )	        ../realname.module:436
94	1.4968	25776912	_realname_make_name( )	        ../realname.module:779
95	1.4969	25778584	content_profile_load_profile( )	../realname.module:840
96	1.4970	25809688	content_format( )	                ../realname_content_profile.inc:27
97	1.4971	25810376	content_access( )	                ../content.module:1846
98	1.4971	25811032	module_invoke_all( )	                ../content.module:2308
99	1.4971	25815648	call_user_func_array ( )	        ../module.inc:482
lukas.weber’s picture

this is still not fixed in 6.x-1.5.
the patch above worked for me

hass’s picture

Issue summary: View changes
Status: Active » Closed (outdated)