Answers.Body: <p>Often JS errors after an upgrade are caused by needing to clear the browser cache. Give that a go and retry.</p>
  
  <p>Another approach to resolving this is to try to create new equivalents of those fields once the upgrade has run, and see if they behave in the same way. This is distinct from what you did in your subsequent comment.</p>
  
  <p>John </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-03T14:43:45.857Z
Answers.Text: Thanks, John.  But neither option helps, unfortunately.  I've cleared history, cache, everything.  Used a different browser as well.  I also created a similar custom field, and put it at the top of the list, and it's the same error, now pointing at the new custom field.  In addition, the Preview Field Display has the same behavior (js doesn't run on it), and I can't even disable the custom fields at all.  Seems like something is broken in my environment with custom fields. I even tried to upgrade to 4.5 first (same issue), and straight to 4.7 (same issue).  Any other suggestions?
Answers.UserDisplayName: Paul B
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-03T11:01:12.240Z
Answers.LastActivityDate: 2017-04-03T11:01:12.240Z
Answers.UserDisplayName: JohnFF
Body: <p>I'm trying to upgrade our site from 4.4.21 to 4.6.27 (latest LTS).  The upgrade process, following the guide, worked as expected and everything looked ok initially.  However, when I try to create a new Event, several custom fields don't work and don't look right.</p>
  
  <p>The contact reference autocomplete-select fields don't auto-complete (nor do they load the little icon next to the field, the js isn't loading).  And the date fields look really off, with two fields and the calendar icon doesn't pop up a calendar.</p>
  
  <p>This is only on custom fields for events.  Standard date fields are fine, it seems.</p>
  
  <p>The only error I could find was in the Console, with this message right as it's loading the custom fields.  I don't see any errors in the apache logs nor on screen (I have debugging turned on).  So I'm at a bit of a loss on how to debug this.</p>
  
  <blockquote>
    <p>Error: cannot call methods on autocomplete prior to initialization;
    attempted to call method
    '/civicrm/ajax/contactref?context=customfield&amp;id=129'</p>
  </blockquote>
  
  <p>I thought it might be some custom module I have, but I've disabled everything and still get these odd custom fields.  Would appreciate help in figuring this out.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-03T00:38:45.513Z
Comments.Text: If it somehow helps, this has something to do with the database, I think.  I decided to drop my db and the modules/civicrm folder completely.  I then did a fresh install of 4.6.27 (using the install script).  This is on drupal 7.  From the fresh install, I created a couple of custom fields and everything worked fine.  I then took my 4.4 database and restored it (dropped 4.6, imported 4.4).  Then ran the upgrade script.  Once the script finished, I'm back with issues with the custom fields.  Date fields show two boxes, no pop-up.  And contact reference fields don't work, same error. Any help?
Comments.UserDisplayName: Paul B
Tags: <custom-fields><4.6>
Title: Event Custom Fields not Looking Right with 4.6.27 Upgrade
ThreadText: # Event Custom Fields not Looking Right with 4.6.27 Upgrade
  
  (Asked by: username_0 on 2017-04-02)
  
  I'm trying to upgrade our site from 4.4.21 to 4.6.27 (latest LTS). The upgrade process, following the guide, worked as expected and everything looked ok initially. However, when I try to create a new Event, several custom fields don't work and don't look right.
  
  The contact reference autocomplete-select fields don't auto-complete (nor do they load the little icon next to the field, the js isn't loading). And the date fields look really off, with two fields and the calendar icon doesn't pop up a calendar.
  
  This is only on custom fields for events. Standard date fields are fine, it seems.
  
  The only error I could find was in the Console, with this message right as it's loading the custom fields. I don't see any errors in the apache logs nor on screen (I have debugging turned on). So I'm at a bit of a loss on how to debug this.
  
  > Error: cannot call methods on autocomplete prior to initialization;
  > attempted to call method
  > '/civicrm/ajax/contactref?context=customfield&id=129'
  
  I thought it might be some custom module I have, but I've disabled everything and still get these odd custom fields. Would appreciate help in figuring this out.
  
  **Tags:** custom-fields, 4.6
  
  > **Comments:**
  > **username_0**: If it somehow helps, this has something to do with the database, I think.  I decided to drop my db and the modules/civicrm folder completely.  I then did a fresh install of 4.6.27 (using the install script).  This is on drupal 7.  From the fresh install, I created a couple of custom fields and everything worked fine.  I then took my 4.4 database and restored it (dropped 4.6, imported 4.4).  Then ran the upgrade script.  Once the script finished, I'm back with issues with the custom fields.  Date fields show two boxes, no pop-up.  And contact reference fields don't work, same error. Any help?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-04-03. Score: 1
  
  Often JS errors after an upgrade are caused by needing to clear the browser cache. Give that a go and retry.
  
  Another approach to resolving this is to try to create new equivalents of those fields once the upgrade has run, and see if they behave in the same way. This is distinct from what you did in your subsequent comment.
  
  John
  
  > **Comments:**
  > **username_0**: Thanks, John.  But neither option helps, unfortunately.  I've cleared history, cache, everything.  Used a different browser as well.  I also created a similar custom field, and put it at the top of the list, and it's the same error, now pointing at the new custom field.  In addition, the Preview Field Display has the same behavior (js doesn't run on it), and I can't even disable the custom fields at all.  Seems like something is broken in my environment with custom fields. I even tried to upgrade to 4.5 first (same issue), and straight to 4.7 (same issue).  Any other suggestions?  
  
  ---
  
  