I've got a block view set up to get the latest 3 blog posts by term. I'm providing the default argument with the following:
$path = drupal_get_path_alias($_GET['q']);
$path = explode('/', $path);
if($path[0] == 'laws' || $path[0] == 'issues' || $path[0] == 'culprits' || $path[0] == 'themes' :
return $path[1];
endif;
Using dpm on $path[1] gives me the term alias and I assumed that the Argument validator for Taxonomy Terms, which is set to "Term Name converted to Term ID", would get me the ID, but maybe not?
Works fine in views preview with arguments entered, but on an actual page it returns nothing. Never had a problem with this before in 6.x. Is there something new I'm completely missing? I've read through docs and tried a few different ways to return the default arg, but no luck.
Any help would be appreciated.
Thanks
Edited to fix code