Fix install AdvancedSubscription plugin - refs BT#9413

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent a93ed4834c
commit 63c8489590
  1. 15
      plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php

@ -78,17 +78,12 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
private function addAreaField()
{
$result = Database::select(
'variable',
'user_field',
array(
'where'=> array(
'variable = ? ' => array('area')
)
)
);
$extraField = new ExtraField('user');
$extraFieldHandler = $extraField->get_handler_field_info_by_field_variable('area');
$areaExists = $extraFieldHandler !== false;
if (empty($result)) {
if (!$areaExists) {
$extraField = new ExtraField('user');
$extraField->save(array(
'field_type' => 1,

Loading…
Cancel
Save