I have set up a view to list a cck content type using the argument Node: Created Year. The path is set to blog/%. The Live Preview shows my list of nodes perfectly as expected when I enter 2011 or 2010 into the Arguments box. My view gives the following output:

SELECT node.nid AS nid,
   node.created AS node_created
 FROM node node 
 WHERE (node.status <> 0) AND (node.type in ('blog')) AND (EXTRACT(YEAR FROM((FROM_UNIXTIME(node.created) + INTERVAL -14400 SECOND))) = '2011')
   ORDER BY node_created DESC

It lists the path as blog/2011, which is as I expect and desire. The View has been saved multiple times, yet every time I try to visit the page on my site, I get a Page Not Found error. Any idea what I'm doing wrong? I have cleared my cache, both Drupal and browser, multiple times. I have tried loading the page in Chrome and Firefox.

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Can you show an export of your view, please?

In general you should better choose "blog" instead of "blog/%" as path.

Additonal also always fill out the right version, please.

Anthony Pero’s picture

Version: 6.x-2.9 » 6.x-2.12
StatusFileSize
new1.66 MB
new484.47 KB

Thank you for taking a look at this. I didn't realize I selected the wrong version of Views. Below is the export code. The Page View I am specifically asking about is titled Archive Listings. I can't make the path blog, as that is the path to the main blog, which I have working. What I am trying to get working is the Archive Listings, which are monthly archives, so I need to use arguments of Created Year and Created Month to get these. First, I'm trying to get a yearly listing to show up, such as blog/2011 (which follows my pathauto rules). However, my end game is to have a path like blog/2011/january, which lists all the posts from January 2011.

Once again, when I use the Live Preview, my settings work to list blog/2011. But when I click on the link provided by the live preview under path: blog/2011, it doesn't work, and gives me a Page Not Found error. I am also uploading a screenshot of the Views Configuration Page so you can see the live preview I am seeing, as well as a screenshot of the Page Not Found message.

$view = new view;
$view->name = 'blog';
$view->description = 'Blog';
$view->tag = 'blog';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 1,
    'exclude' => 1,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'view_node' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'text' => 'continue reading',
    'exclude' => 1,
    'id' => 'view_node',
    'table' => 'node',
    'field' => 'view_node',
    'relationship' => 'none',
  ),
  'teaser' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 0,
      'ellipsis' => 0,
      'html' => 0,
      'strip_tags' => 1,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 1,
    'id' => 'teaser',
    'table' => 'node_revisions',
    'field' => 'teaser',
    'relationship' => 'none',
  ),
  'created' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'date_format' => 'custom',
    'custom_date_format' => 'F jS, Y',
    'exclude' => 1,
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'relationship' => 'none',
  ),
  'tid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'type' => 'separator',
    'separator' => ' | ',
    'link_to_taxonomy' => 1,
    'limit' => 1,
    'vids' => array(
      '3' => 3,
      '1' => 0,
      '2' => 0,
      '4' => 0,
      '5' => 0,
    ),
    'exclude' => 1,
    'id' => 'tid',
    'table' => 'term_node',
    'field' => 'tid',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'name' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_user' => 1,
    'overwrite_anonymous' => 0,
    'anonymous_text' => '',
    'exclude' => 1,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'none',
  ),
  'nothing' => array(
    'label' => '',
    'alter' => array(
      'text' => '<div class="teaser-listing">
  <h3 class="title">[title]</h3>
  <span class="submitted">Submitted by [name] on [created] in [tid]</span>
  <p class="teaser-content">[teaser]&hellip; [view_node]</p>
</div>',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'nothing',
    'table' => 'views',
    'field' => 'nothing',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'created' => array(
    'order' => 'DESC',
    'granularity' => 'second',
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'blog' => 'blog',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('items_per_page', 5);
$handler->override_option('use_pager', '1');
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
  'relationship' => 'none',
  'build_mode' => 'teaser',
  'links' => 1,
  'comments' => 1,
));
$handler = $view->new_display('page', 'Trip Sports Blog', 'page_1');
$handler->override_option('fields', array());
$handler->override_option('path', 'blog');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'Blog',
  'description' => 'Trip Sports travel blog',
  'weight' => '0',
  'name' => 'menu-other-links',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler = $view->new_display('page', 'Blog Categories', 'page_2');
$handler->override_option('arguments', array(
  'tid' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => 'Category - %1',
    'breadcrumb' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'taxonomy_term',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'add_table' => 0,
    'require_value' => 0,
    'reduce_duplicates' => 0,
    'set_breadcrumb' => 0,
    'id' => 'tid',
    'table' => 'term_node',
    'field' => 'tid',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '3' => 0,
      '4' => 0,
    ),
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_fixed' => '',
    'default_argument_user' => 0,
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'blog' => 0,
      'game' => 0,
      'header_image' => 0,
      'news' => 0,
      'page' => 0,
      'team' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '7' => 7,
      '1' => 0,
      '4' => 0,
      '5' => 0,
      '3' => 0,
    ),
    'validate_argument_type' => 'convert',
    'validate_argument_transform' => 1,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('path', 'blog/%');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler = $view->new_display('page', 'Archive Listings', 'page_3');
$handler->override_option('arguments', array(
  'created_year' => array(
    'default_action' => 'not found',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'id' => 'created_year',
    'table' => 'node',
    'field' => 'created_year',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '3' => 0,
      '4' => 0,
    ),
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_fixed' => '',
    'default_argument_user' => 0,
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'blog' => 0,
      'game' => 0,
      'header_image' => 0,
      'news' => 0,
      'page' => 0,
      'team' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '7' => 0,
      '1' => 0,
      '4' => 0,
      '5' => 0,
      '3' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('path', 'blog/%');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler = $view->new_display('block', 'Recent Posts Block', 'block_1');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '40',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
  'created' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'date_format' => 'time ago',
    'custom_date_format' => '',
    'exclude' => 0,
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('title', 'Recent Blog Posts');
$handler->override_option('items_per_page', 3);
$handler->override_option('use_pager', '0');
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
));
$handler->override_option('row_plugin', 'fields');
$handler->override_option('row_options', array(
  'inline' => array(),
  'separator' => '',
  'hide_empty' => 0,
));
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
dawehner’s picture

Wait, your second images shows a search on /search

Do you expect to find the view there?

Anthony Pero’s picture

The 404 Search Module redirects all Page Not Founds and does an automatic search of the parts of the URL. The pertinent info on that screen shot is the error message.

Anthony Pero’s picture

Status: Postponed (maintainer needs more info) » Active

Any help on this?

alliax’s picture

I'm also having the same problem, everything works perfectly in view UI but all pages are not found, even as admin.. proper permissions for access all views have been set.. I'll be looking more for a solution, maybe something I've done incorrectly, but I did views before, only first time I use two arguments and now get this problem..

Anthony Pero’s picture

I never did get this solved, please report back if you find a solution.

alliax’s picture

Now I have solved it but it's a pity because I'm not sure why, because I did several things.
First in each argument I reverted from saying that if argument was empty it should give a 404 page to saying that it should give the value of all (display everything)
Then secondly, my path was like this.. blabla/word-%-word-%.htm
now I put it very simply like this.. blabla/%/%
that's it, and then it worked, so I moved on to other things.

Joe_Smith’s picture

Version: 6.x-2.12 » 7.x-3.0-beta3

I am having a similar problem. What I've found is that if the path is set to "%/blabla" you get the same "page not found" issue. However, if you set the path as "blabla/%" it works. Also, if I use "blablaone/%/blablatwo" it works.

dawehner’s picture

Version: 7.x-3.0-beta3 » 6.x-2.x-dev

%/blablabla basically can't work because the drupal menu-api doesn't support this.
Move to 6.x-2.12 again.

spgd01’s picture

Title: Argument / Path combination works in Views UI but gives Page Not Found Error when visited » /blog path with arguments works in Views UI but gives Page Not Found Error when visited on site
Category: support » bug

This is a bug specifically with the "/blog" path. If you use "/blog" then arguments do not work on the site and you will get a "page not found" If you use "/blogs" or "/blog-archive", or anything else then arguments work.

I changes the title to better reflect the issue.

merlinofchaos’s picture

Category: bug » support
Status: Active » Fixed

If you have the 'blog' module active, then this would be because that module defines the path 'blog/%' which is more specific than 'blog' if you have an argument and it will try to process it. This is the most likely scenario.

spgd01’s picture

Category: support » bug
Status: Fixed » Active

OK after testing more, I found the issue may have to do with the Blog module or path auto. In path auto you cannot use the same pattern path "/blog" for the

"blog path > Pattern for blog page paths:"

as you do for
"node paths>Pattern for all Blog entry paths:"

If you do then breadcrumbs and views will break. Unfortunately this means we have two urls now: "Blog" for "blog path" and "blog-archive" or "path-you-chose" for "Node path>blog entry paths".

Is this a views bug or a blog or a path auto bug?

spgd01’s picture

merlinofchaos,
Then how do we override the blog module with views?

merlinofchaos’s picture

You should just turn off blog.module.

It doesn't actually provide anything once you override its paths with Views, except maybe the "so-and-so's blog" link in the node links, which can probably be added with custom links module.

spgd01’s picture

thanks Merlinofchaos,
So you are saying multi user blog module is stuck as it is and it is not possible to create a hackable blog archive as outlined here:

http://drupal.org/node/247205

So I need to create a multi user block from scratch with views?

dawehner’s picture

Status: Active » Fixed

Really the blog module isn't that much more then a node type + a list of blogs per user + breadcrumb.

You can do this with cck, custom breadcrumbs and views.

spgd01’s picture

Category: bug » support

Thanks for the help. I am trying to get the handle of views and I will be creating a custom blog then rather than using the blog module.

I am figuring out that views cannot override core paths such as:

blog/%
admin/*
user/%
Etc....

So how does one control the output and design of those pages? If you could point me to some documentation that would be great.

dawehner’s picture

The default page display can't do this but have a look at the one used in admin_views which is part of the admin_menu module.
There you can override existing pages

Status: Fixed » Closed (fixed)

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