I am running 4.7.3 and the latest Views Module.

If I create a view to override the system path taxonomy/term/n with n being a term id argument, I cannot get the custom view to display. I still get the default taxonomy overview page.

If I change the URL in the view to something like tax/term/n and hit the page that way, the view works as expected.

Any reason (a conflict with another module perhaps) why Views Module isn't overriding the system path as it should?

Comments

pete@fiddley.com’s picture

Attached is the export of the view:

$view = new stdClass();
$view->name = 'taxonomy_term';
$view->description = 'The taxonomy view with a depth of 0.';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'taxonomy';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'list';
$view->url = 'taxonomy/term';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'sticky',
'sortorder' => 'DESC',
'options' => '',
),
array (
'tablename' => 'node',
'field' => 'created',
'sortorder' => 'DESC',
'options' => '',
),
);
$view->argument = array (
array (
'type' => 'taxid',
'argdefault' => '2',
'title' => '',
'options' => '0',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'node_feed',
'argdefault' => '2',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
),
array (
'tablename' => 'node',
'field' => 'created',
'label' => '',
'handler' => 'views_handler_field_date_custom',
'options' => 'l, F j, Y',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
);
$view->exposed_filter = array (
);
$view->requires = array(node);
$views[$view->name] = $view;

pete@fiddley.com’s picture

This view seems to work if the taxonomy module is disabled. This defeats the purpose of overriding a system view however as now now taxonomy links, breadcrubms, etc are no longer automatically generated with links to the taxonomy pages.

Isn't the point of the Views override of system paths so that this very case is handled?

pete@fiddley.com’s picture

merlinofchaos responded to an email offline:

It probably has to do with module weight. In the system table give views
a weight of 10.

I made the change and it worked. Not sure why this isn't the default case when the module installs though. Does this need to be addressed in the module specifically or is this a problem elsewhere?

drawk’s picture

Just wanted to say thanks for posting the email here online. I was having the same trouble.

Do I understand correctly that we need to modify this directly in the SQL rather than through the regular Drupal admin menus?

merlinofchaos’s picture

Priority: Critical » Normal

It is not the default because when I was experimenting it never really seemed to need to be. In a future version I will make the installer/updater do this. For now I leave this issue open with the workaround available.

merlinofchaos’s picture

Status: Active » Fixed

Views 1.1 will update the module weight properly when update.php is run.

Anonymous’s picture

Status: Fixed » Closed (fixed)