I have a page view set up with two arguments

view/arg1/arg2

Both arguments have their own unique title to use.

If I visit the page with both arguments, the title of the page is set to that defined by the second argument as it should be.

If I visit the page with only the first argument, the title of the page is the core title set by the view itself. It should be displaying the title defined by the first argument.

In short, only the title of the highest numbered view is applied. If that argument is not defined, then it uses the title of the view rather than using the title of the last argument actually given by the url.

Comments

RoboPhred’s picture

I came up with a possible fix, although I am not sure if I might be breaking something else. Simple testing shows no other issues.

File: view.inc
view::_build_arguments()

In the foreach loop, if the argument is missing it executes the code

      else {
        // determine default condition and handle.
        return $argument['handler']->default_action();
      }

This causes it to bail out when it encounters an argument with no value, so it never gets a chance to execute the code imidiately after the foreach statement which sets the title.

As a possible fix, I came up with

      else {
        // determine default condition and handle.
        if($argument['handler']->default_action() == FALSE)
        {
          return FALSE;
        }
        break;
      }

This works for my purposes, and seems to deal with the actions properly.

merlinofchaos’s picture

Status: Active » Fixed

This is now fixed. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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