Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+22 -8
View File
@@ -27,12 +27,14 @@ class _Address extends FormAbstract
* @brief Default Options
* @code
$defaultOptions = array(
'minimize' => FALSE, // Minimize the address field until the user focuses?
'minimize' => FALSE, // Minimize the address field until the user focuses?
'requireFullAddress'=> TRUE, // Does this have to be a full address? Default is TRUE, may set to FALSE if a more generic location is acceptable
);
* @endcode
*/
protected $defaultOptions = array(
'minimize' => FALSE
'minimize' => FALSE,
'requireFullAddress' => TRUE,
);
/**
@@ -181,7 +183,7 @@ class _Address extends FormAbstract
}
/* Validate, return NULL if we have nothing */
if ( !$fullyCompleted )
if ( !$fullyCompleted and $this->options['requireFullAddress'] )
{
if ( $partiallyCompleted )
{
@@ -199,13 +201,25 @@ class _Address extends FormAbstract
return NULL;
}
}
/* Add in latitude and longitude if we can */
try
elseif( !$fullyCompleted )
{
$value->getLatLong();
/* If we don't have any country, region city AND postal code, return NULL, otherwise everywhere ends up storing empty
location arrays which makes it difficult to confirm if a location was actually set or not */
if( !$value->country AND !$value->region AND !$value->city AND !$value->postalCode )
{
return NULL;
}
}
/* Add in latitude and longitude if we can */
if ( $fullyCompleted )
{
try
{
$value->getLatLong();
}
catch( \BadFunctionCallException $e ){}
}
catch( \BadFunctionCallException $e ){}
/* Return */
return $value;