"Content Language Negotiation" + "Missing Memory Cache" = Fatal Error

4 views
Skip to first unread message

Alexander Obuhovich

unread,
Nov 4, 2010, 4:46:31 PM11/4/10
to In-Portal Bugs
I have "Content Language Negotiation" and memory caching enabled. When I restarted Memcached server and then visited Front-end with empty url, e.g. http://www.site.com/ then redirect was made, since my "Accept-Language" header matched non-default language.

Because I have no cache, then kApplication::RewriteListeners array was empty and attempt to build redirect link resulted in fatal error listed below:


Notice: Undefined index: m in ...\core\kernel\application.php on line 1953

Fatal error: Method name must be a string in .../core/kernel/application.php on line 1955

Alexander Obuhovich

unread,
Nov 4, 2010, 5:26:48 PM11/4/10
to In-Portal Bugs
I think, that we should delay any redirects until kApplication::Init method is done, since redirecting from middle of application init doesn't bring any good things to the page.

Dmitry Andrejev

unread,
Nov 4, 2010, 5:34:53 PM11/4/10
to in-port...@googlegroups.com
Hi Alex,

How do we manage these type of URLs then?

DA


--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.



--


Best regards,

Dmitry A.

Alexander Obuhovich

unread,
Nov 5, 2010, 4:43:48 AM11/5/10
to in-port...@googlegroups.com
As I said before - we could schedule redirect to be performed later, when application initialization is completed.

This problem has larger impact on the system, then it seems at first. Since it's a problem when one code wants to get data, that is prepared by other code, that is not yet executed. This is so called tight binding problem, when some system components too heavily depend on each other to work properly when someone of them is changed.

Alexander Obuhovich

unread,
Mar 13, 2011, 8:40:49 AM3/13/11
to in-port...@googlegroups.com
Here are the places, when redirects happen:
  • Redirect on Session Expiration
  • Redirect on non-rewritten url
  • Redirect on language negotiation
  • Redirect on missing item’s view permission
  • Redirect on category import completion
  • Redirect on module install finished
  • Redirect on site domain mismatch
  • Redirect on category cache updated finish
  • Redirect on request event processed
  • Redirect on CSV import complete
  • Redirect on install complete
  • Redirect on login required template
  • Redirect on SSL mode mismatch
  • Redirect on email queue processing finished
  • Redirect on url ending mismatch
  • Redirect on template compilation finished

Pretty lot actually. So I suggest following approach:
  • place return ; after each kApplication::Redirect method call
  • when !$this->InitDone and redirect attempt is made, then schedule redirect, but don't perform
  • when init finishes and there is a scheduled redirect, then perform it

Dmitry A.

unread,
Mar 13, 2011, 7:19:22 PM3/13/11
to in-port...@googlegroups.com
Thanks for researching!

I have nothing against performing the Redirects after the INIT phase so I vote for a new Task here. Please create one, would you?


DA

Alexander Obuhovich

unread,
May 4, 2011, 4:41:56 PM5/4/11
to in-port...@googlegroups.com
Here is the task: http://tracker.in-portal.org/view.php?id=1048


--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.
Reply all
Reply to author
Forward
0 new messages