CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • List of Disabled groups, worked in 4.4, not in 4.5
Pages: [1]

Author Topic: List of Disabled groups, worked in 4.4, not in 4.5  (Read 233 times)

allenthehusband

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • PHP version: 5.3
List of Disabled groups, worked in 4.4, not in 4.5
November 05, 2014, 01:49:24 pm
Hi All,

We had created an additional listing on an individual's 'Groups' tab that displayed disabled groups to which an individual belongs (tracking the history of group membership even if the group has been disabled).  The code worked in 4.4.6 and is listedbelow.  It's not the prettiest code (and probably not all that efficient), but it worked.  :)

Code: [Select]
{crmAPI var='result' entity='Group' action='get' sequential=1 is_active=0 return='id,title'}
      {foreach from=$result.values item=Group}
      {assign var='disabledgroupid' value=$Group.id}
          {crmAPI var='result2' entity='GroupContact' action='get' sequential=1 group_id=$Group.id}
          {foreach from=$result2.values item=GroupContact}
              {if $contactId eq $GroupContact.contact_id}
                <tr id="grp_{$Group.id}" class="{cycle values="odd-row,even-row"}">
                  <td class="bold">
                    <a href="{crmURL p='civicrm/group/search' q="reset=1&force=1&context=smog&gid='$disabledgroupid'"}" title="{ts}View disabled group{/ts}">
                      {$Group.title}
                    </a>
                  </td>
                </tr>
              {/if}
          {/foreach}
      {/foreach}

However, now that we are in 4.5.2, the listing no longer shows results.  I'm wondering, was there perhaps a change in the API that would have affected the above?  The only thing I can think of is that now when I try API Explorer with the GroupContact entity, I am not allowed to enter the id of a disabled group into the group_id parameter.  Does the GroupContact entity no longer recognize disabled groups?  Thanks for any and all help!

Ah, almost forgot, the modified tpl file is: templates/CRM/Contact/Page/View/GroupContact.tpl
« Last Edit: November 05, 2014, 01:55:49 pm by allenthehusband »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • List of Disabled groups, worked in 4.4, not in 4.5

This forum was archived on 2017-11-26.