I've got it set to "Use administration theme for content editing". When I try to edit a node, I get:

Fatal error: Call to undefined function admin_navigation_primary() in /xx/xx/htdocs/sites/all/modules/admin/theme/page.tpl.php on line 30

Comments

jrb’s picture

Status: Active » Needs review

It looks like it's not checking the "node_admin_theme" setting when it does admin_init(). Here's a fix.

Around line 13 of admin.module, change this:

if (arg(0) == 'admin' && (arg(1) .'/'. arg(2) != 'build/block') && variable_get('admin_theme', 'admin') == 'admin') {
	module_load_include('inc', 'admin', 'admin.theme');
	_admin_init_theme();
}

To this:

if (((arg(0) == 'admin' && (arg(1) .'/'. arg(2) != 'build/block')) || (variable_get('node_admin_theme', 0) && (arg(1) == 'add' || (arg(2) == 'edit' && is_numeric(arg(1)) ))))  && variable_get('admin_theme', 'admin') == 'admin') {
	module_load_include('inc', 'admin', 'admin.theme');
	_admin_init_theme();
}
jacerider’s picture

I am also getting this error when I try editing a block.

Fatal error: Call to undefined function admin_navigation_primary() in /xx/xx/public_html/sites/all/modules/admin/theme/page.tpl.php on line 30

*Update*

Clearing Drupal cache took care of the issue. Strange.

yhahn’s picture

Assigned: Unassigned » yhahn
Status: Needs review » Fixed
Stephen’s picture

Status: Fixed » Needs review

I'm getting it when trying to edit a block as well and I applied the CVS and emptied the cache :/

yhahn’s picture

Want to give it another shot? This commit should make the check more robust:

http://drupal.org/cvs?commit=221106

mwoodwar’s picture

I applied the commit=221106 and unfortunately still got:

Fatal error: Call to undefined function admin_navigation_primary() in /home/wagg/public_html/talk/sites/all/modules/admin/theme/page.tpl.php on line 30

sun’s picture

StatusFileSize
new4.67 KB

Hard one.

1) For me, the fatal was caused by Panels' Delegator module, which alters the node edit page callback.

2) Additionally, I needed to configure the "Admin" theme as administration theme to get the fatal error. Using the site's default theme does not lead to the fatal error, but obviously, you won't get the "Admin" theme then.

3) Since, technically, any module can alter page callbacks in the menu system, Admin module can't rely on core's default values. Most probably, testing for $item['path'] instead could solve this in a more generic manner. Though that would not account for the case where a node edit form is displayed on a different path.

sun’s picture

Testing for $item['path'] instead.

yhahn’s picture

Status: Needs review » Fixed

This has effectively been committed as part of http://drupal.org/cvs?commit=225318, http://drupal.org/cvs?commit=225316. Please reopen if the problem continues to occur.

Status: Fixed » Closed (fixed)

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