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) »
  • Possible Bug in Profile Rendering??
Pages: [1]

Author Topic: Possible Bug in Profile Rendering??  (Read 564 times)

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Possible Bug in Profile Rendering??
December 30, 2010, 04:52:19 am
I am working on an event that needs some conditional fields which requires a little javascript. As I was working on determining the jquery selectors I would need to show/hide various options, I noticed that the fields should render in a div with a class named '$fieldname-section'. That holds true for html select and text box fields, but fields rendered as checkboxes or radio buttons were rendering as just ' -section'.

I took a look at the smarty debug output and the template file and found that the template was looking for an id attribute on the field object which doesn't exist for the items that will be rendered as checkboxes or radio buttons.

In the template we have
Code: [Select]
{assign var=n value=$field.name} and the id is grabbed as the field is being rendered
Code: [Select]
<div class="crm-section {$form.$n.id}-section">
I changed the rendered div to simply
Code: [Select]
<div class="crm-section {$n}-section"> which works fine on my single form for now. Is there any danger in just using the name attribute? It appears to be the same value as the id attribute, but there may be cases when this is not true.

Should this be filed as a (very minor) bug?
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Possible Bug in Profile Rendering??
February 15, 2011, 12:29:49 pm
I just wanted to bump this again since it still appears to be a problem in the latest release. I am still using my simple fix in a custom CRM/UF/Block.tpl file to resolve it, but it would be great to get into core.

Thanks,
Quint
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Possible Bug in Profile Rendering??

This forum was archived on 2017-11-26.