1

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.

1
  • 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?
    – Paul B
    Commented Apr 3, 2017 at 0:38

1 Answer 1

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

1
  • 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?
    – Paul B
    Commented Apr 3, 2017 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.