Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8628

Rules E-notice - need to standardise function names & object names

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 3.4.5, 4.0.5
    • Fix Version/s: 4.4.0
    • Labels:
      None

      Description

      I am hitting E-Notices in the Rules module & it seems to me to about a standard that we should get in place now. It's definitely one of those things that will be trickier the longer it is left.

      The E-Notice I see is
      Notice: Undefined index: type in rules_core_action_transform_info() (line 329 of C:\webroot\egw\sites\all\modules\rules\rules\modules\rules.rules.inc).

      I'm not seeing it happening for the actions I have been creating (on my local machine) and the difference appears to be whether the action name correlates to the data type name

      e.g
      rules_action_civicrm_add_to_group
      will give a notice but
      rules_action_contact_add_to_group
      is OK ('contact' is the name of the datatype)

      A related issue is that in some cases the civicrm entity is prefaced by 'civicrm_' & in others it isn't.
      So the data type is : 'mailing'
      but there are functions such as 'rules_action_civicrm_mailing_send_email'

      I think we DO need to preface our entities as entities like 'event', 'group' and 'phone' will otherwise conflict with other Drupal modules & this was the primary reason I set up the functions I added in a separate file - because I didn't know how to deal with what was there already.

      Ideally we would rename them all to one convention but this will break existing implementations so I think we need to
      1) agree the standard (my vote is 'civicrm_contact', civicrm_mailing', 'civicrm_participant')
      2) change functions like
      function rules_action_civicrm_add_to_group_form(){
      blah
      }
      to be

      function rules_action_civicrm_add_to_group()

      { //I'm now a wrapper function rules_action_civicrm_contact_add_to_group(); } }

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: