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 »
  • Using Profiles (Moderator: Dave Greenberg) »
  • addToGroupId in profile template (Form/Dynamic.tpl)
Pages: [1]

Author Topic: addToGroupId in profile template (Form/Dynamic.tpl)  (Read 1584 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
addToGroupId in profile template (Form/Dynamic.tpl)
August 26, 2009, 09:12:48 am
CRM/Profile/Form/Dynamic.tpl contains the following line:

Code: [Select]
{if $addToGroupId}
        <tr><td class="label">{$form.group[$addToGroupId].label}</td><td>{$form.group[$addToGroupId].html}</td></tr>
        {/if}

The variable ($addToGroupId) appears to be generated if the profile is configured to add submissions to a group (profile advanced setting). No corresponding label/html field is added to the script and/or available to the smarty template. And I don't know why you'd want it to anyway. So the code above results in an empty table row and cells.

1) What is the reasoning/purpose behind that line?
2) If it has a purpose that I'm not aware of, I think it needs to be reworked so that it's correctly hidden when the values are not present. Maybe just something like:

Code: [Select]
{if $addToGroupId && $form.group[$addToGroupId]}
...to ensure it only displays if there's a value.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: addToGroupId in profile template (Form/Dynamic.tpl)
August 27, 2009, 03:06:17 am
It was redundant code, so I have removed it. ( http://fisheye.civicrm.org/changelog/CiviCRM?cs=23462 )
There is already hidden element added for this functionality and no need to explicitly add it in template.

thanks

kiran
« Last Edit: August 27, 2009, 03:27:29 am by Kurund Jalmi »
You Are Designed To Choose... Defined By Choice.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • addToGroupId in profile template (Form/Dynamic.tpl)

This forum was archived on 2017-11-26.