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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Address Custom Data as Autocomplete Select doesn't work in Contact's Form
Pages: [1]

Author Topic: Address Custom Data as Autocomplete Select doesn't work in Contact's Form  (Read 1201 times)

Luciano S.

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
  • iXiam Team Leader
  • CiviCRM version: 4.2+ / 4.3+ / 4.4+
  • CMS version: Drupal
  • MySQL version: 5.1+ / 5.5+
  • PHP version: 5.3+ / 5.4+
Address Custom Data as Autocomplete Select doesn't work in Contact's Form
February 18, 2011, 07:42:10 am
hi,

I'm facing an issue when I create a custom field for Contact's Address as an Autocomplete-select style, the field in the Create New Individual form doesn't have the autocomplete Behaviour. Actually a regular textbox is displayed (without the lens icon in the right side) and no options list is shown when you type in.

Weird but the same field in the Advanced search is displayed correctly.
It seems that doesn't work only in the main Contact form.

After debugging a little bit I found that the file "CRM/Custom/Form/AutoComplete.tpl" is included by "CRM/Contact/Form/Edit/Address/CustomField.tpl" and when I view the source code the javascript that enables the autocomplete for the textbox has the url variable empty, when for the rest of custom fields (Individual type, not Address) that variable is set and they work fine
Code: [Select]
cj( function( ) {
    --->  var url       = "";     <----
    var custom    = "#custom_36_-1";
    var custom_id = "input[name=custom_36_-1_id]";
 
    var customObj   = cj(custom);
    var customIdObj = cj(custom_id);
   
    if ( !customObj.hasClass('ac_input') ) {
        customObj.autocomplete( url,
            { width : 250, selectFirst : false, matchContains: true
            }).result(
                function(event, data ) {
                    customIdObj.val( data[1] );
                }
        );
        customObj.click( function( ) {
            customIdObj.val('');
    });
     }
});



I'm not sure if this empty variable is causing the bug, but for sure is part of it.
I will try to find out where to set it in the source code..

If anyone has an idea how to fix it, would be great


thanks guys!

Luciano

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Address Custom Data as Autocomplete Select doesn't work in Contact's Form
February 18, 2011, 08:31:26 am

can you reproduce this on our demo server and if so please file an issue along with a link to this forum topic. If so, we'll try to fix it for the 3.4 alpha release in the next few weeks

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Luciano S.

  • I post occasionally
  • **
  • Posts: 83
  • Karma: 2
  • iXiam Team Leader
  • CiviCRM version: 4.2+ / 4.3+ / 4.4+
  • CMS version: Drupal
  • MySQL version: 5.1+ / 5.5+
  • PHP version: 5.3+ / 5.4+
Re: Address Custom Data as Autocomplete Select doesn't work in Contact's Form
February 18, 2011, 08:45:45 am
Hi lobo,

I created an address custom field in the demo server (Street Type), autocomplete style and, yes, it has the same issue.
No automcomplete behaviour, just a flat textbox


I will fill in an issue with reporting this.


tx

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: Address Custom Data as Autocomplete Select doesn't work in Contact's Form
March 07, 2011, 10:44:48 pm
Issue http://issues.civicrm.org/jira/browse/CRM-7565 has been updated ( fix version from  civicrm3.4.beta to civicrm3.4.aplha) and fixed for version civicrm3.4.aplha.

Here is the change set:
https://fisheye2.atlassian.com/changelog/CiviCRM?cs=32870
https://fisheye2.atlassian.com/changelog/CiviCRM?cs=32879

Thanks,
Rajan

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Address Custom Data as Autocomplete Select doesn't work in Contact's Form

This forum was archived on 2017-11-26.