[#42] fix for getProfile empty name
This commit is contained in:
parent
bf2a73f519
commit
b5b34ff678
1 changed files with 8 additions and 8 deletions
|
@ -366,19 +366,19 @@ class CRM_Twingle_Profile {
|
||||||
/**
|
/**
|
||||||
* Retrieves the profile with the given name.
|
* Retrieves the profile with the given name.
|
||||||
*
|
*
|
||||||
* @param $name
|
* @param string $name
|
||||||
*
|
*
|
||||||
* @return CRM_Twingle_Profile | NULL
|
* @return CRM_Twingle_Profile | NULL
|
||||||
*/
|
*/
|
||||||
public static function getProfile($name) {
|
public static function getProfile($name) {
|
||||||
|
if (!empty($name)) {
|
||||||
$profile_data = CRM_Core_DAO::singleValueQuery("SELECT config FROM civicrm_twingle_profile WHERE name = %1", [
|
$profile_data = CRM_Core_DAO::singleValueQuery("SELECT config FROM civicrm_twingle_profile WHERE name = %1", [
|
||||||
1 => [$name, 'String']]);
|
1 => [$name, 'String']]);
|
||||||
if ($profile_data) {
|
if ($profile_data) {
|
||||||
return new CRM_Twingle_Profile($name, json_decode($profile_data, 1));
|
return new CRM_Twingle_Profile($name, json_decode($profile_data, 1));
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue