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

Smarty API insists I use a field that doesn't exist

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 4.7.15
    • Fix Version/s: None
    • Component/s: CiviCRM API
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds
    • Verified?:
      No

      Description

      The following smarty code was tried and trusted in the Phone Number Validator:

      {crmAPI var="OptionValues" entity="OptionValue" action="get" sequential="1" option_group_name="phone_type" option_sort="weight"}

      As of version 4.7.15 it stopped working and generated this error:

      User warning: Smarty error:

      {crmAPI}

      DB Constraint Violation - option_group_id should possibly be marked as mandatory for OptionValue,get API. If so, please raise a bug report. in Smarty->trigger_error() (line 1094 of /srv/www/dmaster/sites/all/modules/civicrm/packages/Smarty/Smarty.class.php).

      When you change it to

      {crmAPI var="OptionValues" entity="OptionValue" action="get" sequential="1" option_group_id="phone_type" option_sort="weight"}

      You get the same error.

      When you change it to

      {crmAPI var="OptionValues" entity="OptionValue" action="get" sequential="1" option_group_id="31" option_sort="weight"}

      I get a no such field error.

        Attachments

          Activity

            People

            • Assignee:
              colemanw Coleman Watts
              Reporter:
              johnff John Kirk
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: