I have a view with a custom argument validator that's similar to views_plugin_argument_validate. If, from this validator, I return FALSE, I end up with a white screen instead of an actual Page not found, as I would expect. Running through the execution in my step debugger, when I return from my validation function I end up on line 411 of _menu_load_objects().

        // If callback returned an error or there is no callback, trigger 404.
        if ($return === FALSE) {      // When I return FALSE from my function $return === NULL
          $item['access'] = FALSE;
          $map = FALSE;
          return FALSE;
        }

When the validator function returns FALSE, $return ends up being NULL in the code above, not FALSE. It seems that this is due to line 198 of views.module in the views_arg_load() function, where it's transforming my FALSE return value into NULL.

    if (isset($indexes[$index])) {
      if (isset($view->argument[$indexes[$index]])) {
        return $view->argument[$indexes[$index]]['handler']->validate_argument($value) ? $value : NULL;  // <--- this line
      }
    }

If I change the NULL to FALSE, I get the actual Page not found page instead of a white screen.

Is this a bug, or do you think I'm doing something wrong? I can paste my actual function and/or exported view if you don't think this is a views bug.

Thanks

Comments

merlinofchaos’s picture

Status: Active » Fixed

I think you're right. I admit I'm not 100% sure, but it makes enough sense that I'm committing.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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