-
-
Notifications
You must be signed in to change notification settings - Fork 813
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
Renamed Mailing Component entity #12728
Conversation
(Standard links)
|
This looks like it makes sense. @pradpnayak Was this breaking something specific? @totten This is probably something you may understand/have a view on? |
Actually we have an extension that implements Component api and since the Component entity was over-ridden by Mailing Component it failed to retrieve results. |
@colemanw @mattwire @seamuslee001 what do you think. I feel a bit nervous about this just because of risks of unknown interactions but I feel like my concerns would be mitigated by keeping a copy of CRM_Mailing_DAO_Component that is an empty class extending the new one (& at some future point it could go) |
CRM/Mailing/BAO/Component.php
Outdated
@@ -50,7 +50,7 @@ public function __construct() { | |||
* @return CRM_Core_BAO_LocationType. | |||
*/ | |||
public static function retrieve(&$params, &$defaults) { | |||
$component = new CRM_Mailing_DAO_Component(); | |||
$component = new CRM_Mailing_BAO_Component(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we put the new DAO here - given the BAO needs renaming too but perhaps in a later iteration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. @pradpnayak can you update?
CRM/Mailing/BAO/Component.php
Outdated
@@ -71,7 +71,7 @@ public static function retrieve(&$params, &$defaults) { | |||
* true if we found and updated the object, else false | |||
*/ | |||
public static function setIsActive($id, $is_active) { | |||
return CRM_Core_DAO::setFieldValue('CRM_Mailing_DAO_Component', $id, 'is_active', $is_active); | |||
return CRM_Core_DAO::setFieldValue('CRM_Mailing_BAO_Component', $id, 'is_active', $is_active); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. @pradpnayak can you update?
CRM/Mailing/BAO/Component.php
Outdated
@@ -86,7 +86,7 @@ public static function setIsActive($id, $is_active) { | |||
*/ | |||
public static function add(&$params, $ids = array()) { | |||
$id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('id', $ids)); | |||
$component = new CRM_Mailing_DAO_Component(); | |||
$component = new CRM_Mailing_BAO_Component(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
I have updated the PR to also rename the BAO and to leave a deprecated copy of it to cover any backward-compat issue in extensions (although extensions really should not call BAOs directly for this reason). |
test fails unrelated |
Overview
Mailing component was using entity name as 'Component' which overrides CRM/Core/DAO/Component.php since both were using same entity name. This PR renames the Mailing Component entity from 'Component' to 'MailingComponent'