From ad4f6a9c75ba3be6dfbf2e20d0d4b5796424b4c4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 12 Jan 2015 20:18:42 +1300 Subject: [PATCH] tidy-up - remove duplicate array keys --- CRM/ACL/BAO/ACL.php | 1 - CRM/Core/Block.php | 1 - CRM/Report/Form/Extended.php | 3 -- CRM/Report/Form/Member/Detail.php | 4 --- CRM/Report/Form/Member/Lapse.php | 4 --- CRM/Utils/Address.php | 1 - settings/Core.setting.php | 32 ------------------- settings/Mailing.setting.php | 14 -------- settings/Search.setting.php | 1 - tests/phpunit/CRM/Core/PseudoConstantTest.php | 6 ---- tests/phpunit/CiviTest/CiviUnitTestCase.php | 1 - .../Contribute/OfflineContributionTest.php | 1 - tests/phpunit/api/v3/MailingTest.php | 17 +++++----- .../api/v3/TaxContributionPageTest.php | 1 - tools/CRM/Touchstone/Task.php | 2 +- 15 files changed, 10 insertions(+), 79 deletions(-) diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 284b2bae30..ee5f7b2a7d 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -65,7 +65,6 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL { 'civicrm_contact' => ts('Contact'), 'civicrm_group' => ts('Group'), 'civicrm_saved_search' => ts('Contact Group'), - 'civicrm_admin' => ts('Administer'), 'civicrm_admin' => ts('Import'), ); } diff --git a/CRM/Core/Block.php b/CRM/Core/Block.php index f697b0f9aa..8f6a9d635f 100644 --- a/CRM/Core/Block.php +++ b/CRM/Core/Block.php @@ -269,7 +269,6 @@ class CRM_Core_Block { $block[$id] = array( 'info' => $value['info'], 'cache' => $value['cache'], - 'status' => $value['active'], 'region' => $value['region'], 'visibility' => $value['visibility'], 'pages' => $value['pages'], diff --git a/CRM/Report/Form/Extended.php b/CRM/Report/Form/Extended.php index 2ae6e145ef..f6f2227f54 100644 --- a/CRM/Report/Form/Extended.php +++ b/CRM/Report/Form/Extended.php @@ -760,21 +760,18 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { 'title' => ts($options['prefix_label'] . 'Street Number'), 'type' => 1, 'default' => CRM_Utils_Array::value('street_number', $options['defaults'], FALSE), - 'name' => 'street_number', ), $options['prefix'] . 'street_name' => array( 'name' => 'street_name', 'title' => ts($options['prefix_label'] . 'Street Name'), 'type' => 1, 'default' => CRM_Utils_Array::value('street_name', $options['defaults'], FALSE), - 'name' => 'street_name', ), $options['prefix'] . 'street_unit' => array( 'name' => 'street_unit', 'title' => ts($options['prefix_label'] . 'Street Unit'), 'type' => 1, 'default' => CRM_Utils_Array::value('street_unit', $options['defaults'], FALSE), - 'name' => 'street_unit', ), $options['prefix'] . 'city' => array( 'title' => ts($options['prefix_label'] . 'City'), diff --git a/CRM/Report/Form/Member/Detail.php b/CRM/Report/Form/Member/Detail.php index 19a7f4d684..40b45d5e74 100644 --- a/CRM/Report/Form/Member/Detail.php +++ b/CRM/Report/Form/Member/Detail.php @@ -86,10 +86,6 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { 'last_name' => array( 'title' => ts('Last Name'), ), - 'id' => array( - 'no_display' => TRUE, - 'required' => TRUE, - ), 'contact_type' => array( 'title' => ts('Contact Type'), ), diff --git a/CRM/Report/Form/Member/Lapse.php b/CRM/Report/Form/Member/Lapse.php index e71fe22cee..63b1a84049 100644 --- a/CRM/Report/Form/Member/Lapse.php +++ b/CRM/Report/Form/Member/Lapse.php @@ -86,10 +86,6 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { 'title' => ts('Last Name'), 'no_repeat' => TRUE, ), - 'id' => array( - 'no_display' => TRUE, - 'required' => TRUE, - ), 'contact_type' => array( 'title' => ts('Contact Type'), ), diff --git a/CRM/Utils/Address.php b/CRM/Utils/Address.php index b0fc937bf4..b6108b5e7d 100644 --- a/CRM/Utils/Address.php +++ b/CRM/Utils/Address.php @@ -146,7 +146,6 @@ class CRM_Utils_Address { 'contact.birth_date' => CRM_Utils_Array::value('birth_date', $fields), 'contact.gender' => CRM_Utils_Array::value('gender', $fields), 'contact.is_opt_out' => CRM_Utils_Array::value('is_opt_out', $fields), - 'contact.home_URL' => CRM_Utils_Array::value('home_URL', $fields), 'contact.preferred_mail_format' => CRM_Utils_Array::value('preferred_mail_format', $fields), 'contact.phone' => CRM_Utils_Array::value('phone', $fields), 'contact.home_URL' => CRM_Utils_Array::value('home_URL', $fields), diff --git a/settings/Core.setting.php b/settings/Core.setting.php index 4f461529ad..83310cadb1 100644 --- a/settings/Core.setting.php +++ b/settings/Core.setting.php @@ -466,7 +466,6 @@ return array( //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value 'type' => 'String', 'quick_form_type' => 'Element', - 'html_type' => 'text', 'html_attributes' => array( 'size' => 64, 'maxlength' => 256, @@ -490,7 +489,6 @@ return array( //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value 'type' => 'String', 'quick_form_type' => 'Element', - 'html_type' => 'text', 'html_attributes' => array( 'size' => 64, 'maxlength' => 64, @@ -514,31 +512,6 @@ return array( //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value 'type' => 'String', 'quick_form_type' => 'Element', - 'html_type' => 'text', - 'html_attributes' => array( - 'size' => 64, - 'maxlength' => 64, - ), - 'html_type' => 'Text', - 'default' => NULL, - 'add' => '4.3', - 'title' => 'Recaptcha Private Key', - 'is_domain' => 1, - 'is_contact' => 0, - 'description' => NULL, - 'help_text' => NULL, - ), - 'recaptchaPrivateKey' => array( - 'group_name' => 'CiviCRM Preferences', - 'group' => 'core', - 'name' => 'recaptchaPrivateKey', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent - 'config_only' => 1, - //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value - 'type' => 'String', - 'quick_form_type' => 'Element', - 'html_type' => 'text', 'html_attributes' => array( 'size' => 64, 'maxlength' => 64, @@ -562,7 +535,6 @@ return array( //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value 'type' => 'Integer', 'quick_form_type' => 'Element', - 'html_type' => 'text', 'html_attributes' => array( 'size' => 3, 'maxlength' => 5, @@ -584,7 +556,6 @@ return array( // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Integer', 'quick_form_type' => 'Element', - 'html_type' => 'text', 'html_attributes' => array( 'size' => 2, 'maxlength' => 8, @@ -605,7 +576,6 @@ return array( 'prefetch' => 0, 'type' => 'String', 'quick_form_type' => 'Element', - 'html_type' => 'text', 'html_attributes' => array( 'size' => 64, 'maxlength' => 128, @@ -626,7 +596,6 @@ return array( 'prefetch' => 0, 'type' => 'String', 'quick_form_type' => 'Element', - 'html_type' => 'text', 'html_attributes' => array( 'size' => 64, 'maxlength' => 128, @@ -650,7 +619,6 @@ return array( //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value 'type' => 'String', 'quick_form_type' => 'Element', - 'html_type' => 'text', 'html_attributes' => array( 'size' => 16, 'maxlength' => 16, diff --git a/settings/Mailing.setting.php b/settings/Mailing.setting.php index 4b47d07ecb..3d4e27a2b5 100644 --- a/settings/Mailing.setting.php +++ b/settings/Mailing.setting.php @@ -108,20 +108,6 @@ return array( 'description' => NULL, 'help_text' => NULL, ), - 'profile_double_optin' => array( - 'group_name' => 'Mailing Preferences', - 'group' => 'mailing', - 'name' => 'profile_double_optin', - 'type' => 'Integer', - 'html_type' => 'checkbox', - 'default' => 0, - 'add' => '4.1', - 'title' => 'Enable Double Opt-in for Profile Group(s) field', - 'is_domain' => 1, - 'is_contact' => 0, - 'description' => 'When CiviMail is enabled, users who "subscribe" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.', - 'help_text' => NULL, - ), 'profile_add_to_group_double_optin' => array( 'group_name' => 'Mailing Preferences', 'group' => 'mailing', diff --git a/settings/Search.setting.php b/settings/Search.setting.php index 9afb730287..b883870054 100644 --- a/settings/Search.setting.php +++ b/settings/Search.setting.php @@ -81,7 +81,6 @@ return array( 'prefetch' => 0, 'type' => 'String', 'quick_form_type' => 'Element', - 'html_type' => 'text', 'html_attributes' => array( 'size' => 64, 'maxlength' => 64, diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index eee51b14b7..e0327a41fd 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -237,12 +237,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'sample' => 'Unsupervised', ), ), - 'CRM_Mailing_Event_DAO_Subscribe' => array( - array( - 'fieldName' => 'group_id', - 'sample' => $group_name, - ), - ), 'CRM_Activity_DAO_Activity' => array( array( 'fieldName' => 'activity_type_id', diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 596bf3b53f..ba2f62e639 100755 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -1212,7 +1212,6 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @throws Exception */ public function contactTypeDelete($contactTypeId) { - require_once 'CRM/Contact/BAO/ContactType.php'; $result = CRM_Contact_BAO_ContactType::del($contactTypeId); if (!$result) { throw new Exception('Could not delete contact type'); diff --git a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php index 3f49498757..b4b3cbb66d 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php @@ -176,7 +176,6 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { $expected = array( 'Soft Credit To 1' => "{$softCreditFname} {$softCreditLname}", 'Soft Credit To 2' => "{$softCreditSecondFname} {$softCreditSecondLname}", - 'Amount (Soft Credit Type)' => '50.00 (Solicited)', 'Amount (Soft Credit Type)' => '100.00 (In Honor of)', ); diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index 9a2b682c9f..c95fe661f7 100755 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -86,7 +86,6 @@ class api_v3_MailingTest extends CiviUnitTestCase { )); $contactIDs['b'] = $this->individualCreate(array( 'email' => 'exclude.me@example.org', - 'last_name' => 'Excluder', 'last_name' => 'Excluder' )); $this->callAPISuccess('GroupContact', 'create', array( @@ -184,8 +183,7 @@ class api_v3_MailingTest extends CiviUnitTestCase { )); $contactIDs['excludeme'] = $this->individualCreate(array( 'email' => 'exclude.me@example.org', - 'last_name' => 'Excluder', - 'last_name' => 'Excluder' + 'last_name' => 'Excluder', )); $this->callAPISuccess('GroupContact', 'create', array( 'group_id' => $groupIDs['inc'], @@ -303,6 +301,9 @@ class api_v3_MailingTest extends CiviUnitTestCase { $this->assertEquals(array('alice@example.org', 'bob@example.org', 'carol@example.org'), $deliveredEmails); } + /** + * @return array + */ public function submitProvider() { $cases = array(); // $useLogin, $params, $expectedFailure, $expectedJobCount $cases[] = array( @@ -416,7 +417,7 @@ SELECT event_queue_id, time_stamp FROM mail_{$type}_temp"; */ public function testMailerDeleteSuccess() { $result = $this->callAPISuccess($this->_entity, 'create', $this->_params); - $jobs = $this->callAPIAndDocument($this->_entity, 'delete', array('id' => $result['id']), __FUNCTION__, __FILE__); + $this->callAPIAndDocument($this->_entity, 'delete', array('id' => $result['id']), __FUNCTION__, __FILE__); $this->assertAPIDeleted($this->_entity, $result['id']); } @@ -438,7 +439,7 @@ SELECT event_queue_id, time_stamp FROM mail_{$type}_temp"; 'body' => 'Body...', 'time_stamp' => '20111109212100', ); - $result = $this->callAPIFailure('mailing_event', 'bounce', $params, + $this->callAPIFailure('mailing_event', 'bounce', $params, 'Queue event could not be found' ); } @@ -459,7 +460,7 @@ SELECT event_queue_id, time_stamp FROM mail_{$type}_temp"; 'event_subscribe_id' => '123', 'time_stamp' => '20111111010101', ); - $result = $this->callAPIFailure('mailing_event', 'confirm', $params, + $this->callAPIFailure('mailing_event', 'confirm', $params, 'Confirmation failed' ); } @@ -482,7 +483,7 @@ SELECT event_queue_id, time_stamp FROM mail_{$type}_temp"; 'replyTo' => $this->_email, 'time_stamp' => '20111111010101', ); - $result = $this->callAPIFailure('mailing_event', 'reply', $params, + $this->callAPIFailure('mailing_event', 'reply', $params, 'Queue event could not be found' ); } @@ -504,7 +505,7 @@ SELECT event_queue_id, time_stamp FROM mail_{$type}_temp"; 'email' => $this->_email, 'time_stamp' => '20111111010101', ); - $result = $this->callAPIFailure('mailing_event', 'forward', $params, + $this->callAPIFailure('mailing_event', 'forward', $params, 'Queue event could not be found' ); } diff --git a/tests/phpunit/api/v3/TaxContributionPageTest.php b/tests/phpunit/api/v3/TaxContributionPageTest.php index 5ff39b9dbb..ec1ba0bf33 100644 --- a/tests/phpunit/api/v3/TaxContributionPageTest.php +++ b/tests/phpunit/api/v3/TaxContributionPageTest.php @@ -165,7 +165,6 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { 'financial_account_id' => 12, 'is_active' => 1, 'is_default' => 1, - 'is_default' => 1, 'user_name' => 'dummy', 'url_site' => 'http://dummy.com', 'url_recur' => 'http://dummyrecur.com', diff --git a/tools/CRM/Touchstone/Task.php b/tools/CRM/Touchstone/Task.php index dea3955e04..1e63e1ca9e 100644 --- a/tools/CRM/Touchstone/Task.php +++ b/tools/CRM/Touchstone/Task.php @@ -70,7 +70,7 @@ class CRM_Touchstone_Task { if (!(self::$_tasks)) { self::$_tasks = array( 1 => ts('Perform First Task'), - 1 => ts('Perform Second Task'), + 2 => ts('Perform Second Task'), 5 => ts('Perform Third Task'), ); } -- 2.25.1