Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove campaign_id pseudoconstants #19463

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions CRM/Activity/DAO/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Activity/Activity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:20d5b91c29b14f4df12aabfc07c58e94)
* (GenCodeChecksum:e40c263d7d030dc0c6d6e714317a3970)
*/

/**
Expand Down Expand Up @@ -659,11 +659,6 @@ public static function &fields() {
'html' => [
'type' => 'Select',
],
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.4',
],
'activity_engagement_level' => [
Expand Down
7 changes: 1 addition & 6 deletions CRM/Campaign/DAO/CampaignGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Campaign/CampaignGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:88f73bc59595d75977b66fe76466a22c)
* (GenCodeChecksum:a10a2acb5e6198e023bf1b97883b16cf)
*/

/**
Expand Down Expand Up @@ -133,11 +133,6 @@ public static function &fields() {
'bao' => 'CRM_Campaign_DAO_CampaignGroup',
'localizable' => 0,
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.3',
],
'group_type' => [
Expand Down
7 changes: 1 addition & 6 deletions CRM/Campaign/DAO/Survey.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Campaign/Survey.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:03edb270b63048ec3aa9f36667548961)
* (GenCodeChecksum:8a55f06388a594dd78f397320b1b55a6)
*/

/**
Expand Down Expand Up @@ -270,11 +270,6 @@ public static function &fields() {
'bao' => 'CRM_Campaign_BAO_Survey',
'localizable' => 0,
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.3',
],
'activity_type_id' => [
Expand Down
7 changes: 1 addition & 6 deletions CRM/Contribute/DAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Contribute/Contribution.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:11b9f8bc6198e4338be2406de58b6723)
* (GenCodeChecksum:66fa0e83ae7eb57a3c2e515c8fdc371c)
*/

/**
Expand Down Expand Up @@ -843,11 +843,6 @@ public static function &fields() {
'html' => [
'type' => 'Select',
],
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.4',
],
'creditnote_id' => [
Expand Down
7 changes: 1 addition & 6 deletions CRM/Contribute/DAO/ContributionPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Contribute/ContributionPage.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:958ef76562a951e9f80b8e6f16afd6ee)
* (GenCodeChecksum:a8f42298c3fbe5b8c1986c81d77a8a0f)
*/

/**
Expand Down Expand Up @@ -1033,11 +1033,6 @@ public static function &fields() {
'bao' => 'CRM_Contribute_BAO_ContributionPage',
'localizable' => 0,
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.4',
],
'is_share' => [
Expand Down
7 changes: 1 addition & 6 deletions CRM/Contribute/DAO/ContributionRecur.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Contribute/ContributionRecur.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:5e2fa2241a3f8c014352d897be31fad1)
* (GenCodeChecksum:69bfc032333f519d938978caf8d9d7ec)
*/

/**
Expand Down Expand Up @@ -771,11 +771,6 @@ public static function &fields() {
'html' => [
'type' => 'Select',
],
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '4.1',
],
'is_email_receipt' => [
Expand Down
7 changes: 1 addition & 6 deletions CRM/Event/DAO/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Event/Event.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:8747fe6387fcdec07b14c8a72e35868b)
* (GenCodeChecksum:c4d88cf24f327dc7f2f303f316e200c7)
*/

/**
Expand Down Expand Up @@ -1637,11 +1637,6 @@ public static function &fields() {
'html' => [
'type' => 'EntityRef',
],
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.4',
],
'is_share' => [
Expand Down
7 changes: 1 addition & 6 deletions CRM/Event/DAO/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Event/Participant.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:a746f8f8a28c6f945abbba148794d2c2)
* (GenCodeChecksum:f9815c8a89ad1055602bed39a0f266e8)
*/

/**
Expand Down Expand Up @@ -495,11 +495,6 @@ public static function &fields() {
'bao' => 'CRM_Event_BAO_Participant',
'localizable' => 0,
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.4',
],
'discount_amount' => [
Expand Down
7 changes: 1 addition & 6 deletions CRM/Mailing/DAO/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Mailing/Mailing.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:e2de6d8875a7f838b190810bcec4e27e)
* (GenCodeChecksum:9e22faebb14e886d7a5b4382249a0da6)
*/

/**
Expand Down Expand Up @@ -968,11 +968,6 @@ public static function &fields() {
'html' => [
'type' => 'Select',
],
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.4',
],
'dedupe_email' => [
Expand Down
7 changes: 1 addition & 6 deletions CRM/Member/DAO/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Member/Membership.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:497f88dd714287acb6b42017dc0b7cd3)
* (GenCodeChecksum:614dc19edb8e63eb4a8a4c3523454511)
*/

/**
Expand Down Expand Up @@ -502,11 +502,6 @@ public static function &fields() {
'html' => [
'type' => 'Select',
],
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.4',
],
];
Expand Down
7 changes: 1 addition & 6 deletions CRM/Pledge/DAO/Pledge.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Pledge/Pledge.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:8a17ba664d9a2c65860be67652def7f5)
* (GenCodeChecksum:b7f0823c6d9fed7969a2734874ed20eb)
*/

/**
Expand Down Expand Up @@ -657,11 +657,6 @@ public static function &fields() {
'html' => [
'type' => 'Select',
],
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
],
'add' => '3.4',
],
];
Expand Down
53 changes: 0 additions & 53 deletions tests/phpunit/CRM/Core/PseudoConstantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ public function testOptionValues() {
];
$result = civicrm_api3('payment_processor', 'create', $api_params);

// Create a Campaign for testing.
$campaign_name = md5(microtime());
$api_params = [
'title' => $campaign_name,
'is_active' => TRUE,
'status_id' => 2,
];
$result = civicrm_api3('campaign', 'create', $api_params);

// Create a membership type for testing.
$membership_type = md5(microtime());
$api_params = [
Expand Down Expand Up @@ -243,10 +234,6 @@ public function testOptionValues() {
'fieldName' => 'medium_id',
'sample' => 'Phone',
],
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
],
'CRM_Campaign_DAO_Campaign' => [
[
Expand All @@ -261,21 +248,13 @@ public function testOptionValues() {
],
],
'CRM_Campaign_DAO_Survey' => [
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
[
'fieldName' => 'activity_type_id',
'sample' => 'Phone Call',
'max' => 100,
],
],
'CRM_Campaign_DAO_CampaignGroup' => [
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
[
'fieldName' => 'group_type',
'sample' => 'Include',
Expand Down Expand Up @@ -499,10 +478,6 @@ public function testOptionValues() {
'fieldName' => 'payment_instrument_id',
'sample' => 'Check',
],
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
],
'CRM_Pledge_DAO_PledgePayment' => [
[
Expand All @@ -525,10 +500,6 @@ public function testOptionValues() {
'fieldName' => 'frequency_unit',
'sample' => 'month',
],
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
],
'CRM_PCP_DAO_PCP' => [
[
Expand Down Expand Up @@ -778,10 +749,6 @@ public function testOptionValues() {
'sample' => ['USD' => 'US Dollar'],
'max' => 200,
],
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
],
'CRM_Event_DAO_Event' => [
[
Expand Down Expand Up @@ -809,10 +776,6 @@ public function testOptionValues() {
'sample' => ['USD' => 'US Dollar'],
'max' => 200,
],
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
],
'CRM_Core_DAO_Menu' => [
[
Expand All @@ -833,10 +796,6 @@ public function testOptionValues() {
'fieldName' => 'status_id',
'sample' => 'New',
],
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
],
'CRM_Member_DAO_MembershipStatus' => [
[
Expand Down Expand Up @@ -891,10 +850,6 @@ public function testOptionValues() {
'fieldName' => 'visibility',
'sample' => 'Public Pages',
],
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
],
'CRM_Mailing_DAO_MailingComponent' => [
[
Expand Down Expand Up @@ -967,10 +922,6 @@ public function testOptionValues() {
'fieldName' => 'contribution_page_id',
'sample' => $contribution_page,
],
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
],
'CRM_Contribute_DAO_PremiumsProduct' => [
[
Expand All @@ -992,10 +943,6 @@ public function testOptionValues() {
'sample' => ['USD' => 'US Dollar'],
'max' => 200,
],
[
'fieldName' => 'campaign_id',
'sample' => $campaign_name,
],
],
'CRM_Case_DAO_Case' => [
[
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Export/BAO/ExportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ public function testExportPseudoField() {
public function testExportPseudoFieldCampaign() {
$this->setUpContributionExportData();
$campaign = $this->callAPISuccess('Campaign', 'create', ['title' => 'Big campaign and kinda long too']);
$this->callAPISuccess('Contribution', 'create', ['campaign_id' => 'Big_campaign_and_kinda_long_too', 'id' => $this->contributionIDs[0]]);
$this->callAPISuccess('Contribution', 'create', ['campaign_id' => $campaign['id'], 'id' => $this->contributionIDs[0]]);
$selectedFields = [
['contact_type' => 'Individual', 'name' => 'gender_id'],
['contact_type' => 'Contribution', 'name' => 'contribution_campaign_title'],
Expand Down
5 changes: 0 additions & 5 deletions xml/schema/Activity/Activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,6 @@
<title>Campaign</title>
<import>true</import>
<comment>The campaign for which this activity has been triggered.</comment>
<pseudoconstant>
<table>civicrm_campaign</table>
<keyColumn>id</keyColumn>
<labelColumn>title</labelColumn>
</pseudoconstant>
<add>3.4</add>
<html>
<type>Select</type>
Expand Down
Loading