Closed (duplicate)
Project:
Subdomain
Version:
7.x-2.0-beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2011 at 18:09 UTC
Updated:
5 Jul 2012 at 20:45 UTC
Each time after pushing "Install" button at new module or theme install drupal report following error on blank screen:
Fatal error: Call to undefined function menu_get_ancestors() in /home3/ruspolei/public_html/sites/all/modules/subdomain/subdomain.module on line 636
Comments
Comment #1
abacs commentedi also have this problem, in csae of module update too
Comment #2
netikseo commentedYep, have the same issue. But when I disable subdomain module I can install modules without this error. Still a bit annoying if I have to do it every time. Please fix it.
Comment #3
inventlogic commentedIn the subdomain.module file the function _subdomain_id_from_path on line 594 (approximately) is attempting to use functions and constants defined in the menu.inc include.
I think it is producing errors because the _subdomain_id_from_path is not a hook function so it cannot depend on automatic includes from the underlying main drupal functions the hook is calling.
I tried to fix this error by doing the following:
Edit the subdomain.module file and add after
function _subdomain_id_from_path($type, $path) {the following line:
require_once('includes/menu.inc');I think this works ok but I am not sure it is the correct Drupal way of accessing the menu.inc functions and constants.
The code from the function that is causing the problem is the following
It seems to have been partly snagged from the menu_get_item function
So I suppose the question is can the value of the $router_item be gotten through standard Drupal hook functions?
Any help comments appreciated.
Comment #4
inventlogic commentedThis is a duplicate of https://drupal.org/node/1326274
Comment #5
ionut.stan commented#3 worked for me too. I only added require_once('includes/menu.inc');
Thanks :)