Notice: Undefined index: province in eval() (line 1 of /pathtomodule/views/plugins/views_plugin_argument_default_php.inc(49) : eval()'d code).
This error occurs when the array key province
does not exist. The PHP documentation goes into greater detail - http://www.php.net/manual/en/language.variables.basics.php
Relying on the default value of an uninitialized variable is problematic in the case of including one file into another which uses the same variable name... E_NOTICE level error is issued in case of working with uninitialized variables, however not in the case of appending elements to the uninitialized array. isset() language construct can be used to detect if a variable has been already initialized.
Instead of
return $_GET["province"];
Use isset() logic. Also, you shouldn't be directly accessing $_GET, $_POST or $_REQUEST; best practice is to use drupal_get_query_parameters()
$param = drupal_get_query_parameters();
if (isset($param['province'])) {
return $param['province'];
}
return NULL;
To address the problem in your comment:
But i receive: Notice: Undefined offset: 1 in location_handler_argument_location_proximity->query()
This is (for all intrinsic purposes) the same as the undefined index; location_handler_argument_location_proximity->query()
is expecting an array with at least two elements (offset 0 and 1), and that method expected, but did not receive an array with two elements. It might not even be getting an array.