Bonjour,

I have this message when I try to use view for the taxonomy administration page.
To reproduce : (I'm not sure of the exact words, as I use a french translation)
-> admin -> structure -> view
Administration: Taxonomy terms -> activate
Administration: Taxonomy terms -> Modify -> Advanced -> admin path settings : click on the link, then Apply (without changes)
Save
got the message :

Notice : Undefined index: admin/structure/taxonomy/% dans views_plugin_display_system->execute_hook_menu() (ligne 132 dans /htdocs/public/www/V2/sites/all/modules/admin_views/plugins/views_plugin_display_system.inc).

When I go to this page : ("departements" is a vocabulary I have defined)
?q=admin/structure/taxonomy/departements I have theses messages (repeated several times):

Notice : Undefined offset: 0 dans _menu_check_access() (ligne 632 dans /htdocs/public/www/V2/includes/menu.inc).
Notice : Undefined offset: 1 dans _menu_check_access() (ligne 632 dans /htdocs/public/www/V2/includes/menu.inc).
Notice : Trying to get property of non-object dans  _admin_vocabulary_title_callback() (ligne 381 dans /htdocs/public/www/V2/modules/taxonomy/taxonomy.module).

Below, the view is displayed as expected, but in the menu, I lose the items under Structure -> Taxonomy. (I'm using admin_menu, but I tried without this module, and the messages are still displayed)

Something to do ?

Comments

damiankloip’s picture

Do you have the most recent version of the dependent modules? I am not seeing this. Step to reproduce do not give this error for me.

jlea9378’s picture

I'm also seeing a lot of pesky notices in my dblog and on the db updater (update.php):

Notice: Undefined index: access arguments in views_plugin_display_system->execute_hook_menu() (line 132 of /var/www/html/drupal_test/sites/all/modules/admin_views/plugins/views_plugin_display_system.inc).
Notice: Undefined offset: 0 in _menu_check_access() (line 632 of /var/www/html/drupal_test/includes/menu.inc).
Notice: Undefined offset: 1 in _menu_check_access() (line 632 of /var/www/html/drupal_test/includes/menu.inc).

I'm using the latest stable versions of everything:
Drupal 7.15
Administration Views 7.x-1.0
ctools 7.x-1.2
entity 7.x-1.0-rc3+10-dev (2012-Sep-06)
views_bulk_operations 7.x-3.0
Views 7.x-3.5

alextataurov’s picture

It seems that it breaks calculation of access arguments in the execute_hook_menu function. It may return NULL, though "user_access" callback function demands an array even with one element.

$items[$path] = array(
    // default views page entry
    'page callback' => 'views_page',
    'page arguments' => $page_arguments,
    // Take over the access definition from the original router item.
    // @see option_definition()
    // @see views_plugin_access_menu
    'access callback' => !empty($callbacks[$path]['access callback']) ? $callbacks[$path]['access callback'] : 'user_access',
    'access arguments' => $callbacks[$path]['access arguments'],
    // Identify URL embedded arguments and correlate them to a handler
    'load arguments' => array($this->view->name, $this->display->id, '%index'),
);
damiankloip’s picture

Have you tested this theory out? I thought the main issue was that 'file' is being wrongly inherited.

dafreak’s picture

Is there a cure for this yet? I'm having the same issue.

digibrill’s picture

Just to let you know, I have the same problem when activating Administration:Taxonomy terms

damiankloip’s picture

Status: Active » Needs review
StatusFileSize
new865 bytes

This patch fixes the issue for me.

I think the access arguments won't always be set, like the access callback (which has a default), so we should do the same for the 'access arguments'.

When this is resolved I will roll out a new 7.x-1.1 release.

damiankloip’s picture

Version: 7.x-1.0 » 7.x-1.x-dev

Bah, Didn't see this hadn't been moved to dev!

damiankloip’s picture

#7: admin_views-1787078.patch queued for re-testing.

damiankloip’s picture

Status: Needs review » Active

Committed that fix to 7.x-1.x branch.

damiankloip’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

stuwat’s picture

Version: 7.x-1.x-dev » 7.x-1.1
Status: Closed (fixed) » Active

Hi. This doesn't appear to have been fixed in 7.x-1.1. I'm using that and the latest recommended releases of the modules it is dependent upon, but I get the same notices on the Administration:Taxonomy terms view, as described by #2.

damiankloip’s picture

Is your view overridden at all? If so, I would definitely revert this, so you don't have a database version.

stuwat’s picture

Hi Damian. The view was not overridden. The errors occurred right out of the box, after enabling the view.

damiankloip’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.77 KB

Yeah, I think the original fix was a bit basic and wish washy :)

What would be better is if we checked the parent too to inherit there THEN the fallback. This adds a bit more logic around this but I think this is ultimately the correct way to deal with this.

Would be grateful if you could test and let me know!

stuwat’s picture

Thanks for the patch. It appears to work great. I enabled the Administration:Taxonomy terms view and also added a field for Bulk operations: Taxonomy term, enabling the delete term option. Does just what I needed.

damiankloip’s picture

Status: Needs review » Fixed

Ok, let's get this committed in that case. Thanks for testing!

Status: Fixed » Closed (fixed)

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