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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.5 Release Testing »
  • [FIXED] Option to add a Contact during back end Event Registration missing
Pages: [1]

Author Topic: [FIXED] Option to add a Contact during back end Event Registration missing  (Read 1243 times)

lsmithgo

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
    • Soirees at Breinton
  • CiviCRM version: 4.5 beta 7
  • CMS version: Joomla 3.3.3
  • MySQL version: MySQLi 5.5.37-percona-sure1-log
  • PHP version: PHP 5.3.28
[FIXED] Option to add a Contact during back end Event Registration missing
August 25, 2014, 03:25:33 am
At this link to add an Event Registration via the backend
http://sandbox.joomla.civicrm.org/administrator/?option=com_civicrm&task=civicrm/participant/add&reset=1&action=add&context=standalone

a dropdown is showing that allows user to type part of the name of a contact or add a contact - see 'capture1'.

On my site - using beta7 on Joomla 3.3.3 - the dropdown is missing the three options for adding a new contact.  See 'capture2'

The prinicipal difference here is Joomla 2.5 v Joomla 3?  I have noticed other unusual behaviour and will add additional posts.
« Last Edit: September 02, 2014, 04:50:34 am by Coleman Watts »

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Option to add a Contact during back end Event Registration missing
August 27, 2014, 09:21:27 am
Based on your screenshot it looks like it is trying to add the icons but they are not appearing for some reason.
Are you familiar enough with firebug/chrome console to inspect the elements and see if they are there but hidden by some interfering css rule?
Try asking your question on the new CiviCRM help site.

lsmithgo

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
    • Soirees at Breinton
  • CiviCRM version: 4.5 beta 7
  • CMS version: Joomla 3.3.3
  • MySQL version: MySQLi 5.5.37-percona-sure1-log
  • PHP version: PHP 5.3.28
Re: Option to add a Contact during back end Event Registration missing
August 27, 2014, 09:46:32 am
I am. I did. And they're not there.

This is sandbox on Joomla 2.5:

Code: [Select]
<ul id="select2-results-7" class="select2-results" role="listbox">

    <li class="select2-no-results">

        Start typing a name or email... or

        <br></br>
        <a class="crm-add-entity crm-hover-button" href="/administrator/?option=com_civicrm&task=civicrm/profile/create&reset=1&context=dialog&gid=4"> … </a>
        <a class="crm-add-entity crm-hover-button" href="/administrator/?option=com_civicrm&task=civicrm/profile/create&reset=1&context=dialog&gid=5"> … </a>
        <a class="crm-add-entity crm-hover-button" href="/administrator/?option=com_civicrm&task=civicrm/profile/create&reset=1&context=dialog&gid=6"> … </a>
    </li>

</ul>

This is my site on Joomla 3.3:

Code: [Select]
<ul id="select2-results-7" class="select2-results" role="listbox">

    <li class="select2-no-results">

        Start typing a name or email... or

        <br></br>
    </li>

If I do a regular 'view source' on the sandbox site, the code looks like this:

Code: [Select]
<input class="crm-form-entityref required" placeholder="- select contact -" data-select-params="[]" data-api-params="{&quot;extra&quot;:[&quot;email&quot;]}" data-api-entity="contact" data-create-links="true" name="contact_id" type="text" id="contact_id" />
But on my site it is:

Code: [Select]
<input class="crm-form-entityref required" placeholder="- select contact -" data-select-params="[]" data-api-params="" data-api-entity="contact" data-create-links="true" name="contact_id" type="text" id="contact_id" />
The JSON parameters seem lost?

Perhaps a problem in the Renderer....?  Bit beyond my intelligence at this point...

Incidentally, this behaviour occurs anywhere the Contact search widget is used, not just Event Registration.  eg also 'New Contribution'

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Option to add a Contact during back end Event Registration missing
August 27, 2014, 11:53:54 am
Good I'm glad you know what you're doing, this will go much quicker :)

In your javascript console, type in CRM.profileCreate and it should spit out an array (try it on the sandbox to see what it's supposed to look like).

If you don't see it, then something is wrong. Check your page source for the string "dynamic/l10n" which should turn up a script tag. Click on the src link and in there somewher you should see the profile data needed to create a new contact. It looks kind of like this:
Code: [Select]
  // Contact create links
  if (CRM.profileCreate !== false) {
    CRM.profileCreate = [{"label":"New Individual","url":"\/civicrm\/profile\/create?reset=1&context=dialog&gid=4","type":"Individual"},{"label":"New Organization","url":"\/civicrm\/profile\/create?reset=1&context=dialog&gid=5","type":"Organization"},{"label":"New Household","url":"\/civicrm\/profile\/create?reset=1&context=dialog&gid=6","type":"Household"}];
  }
Try asking your question on the new CiviCRM help site.

lsmithgo

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
    • Soirees at Breinton
  • CiviCRM version: 4.5 beta 7
  • CMS version: Joomla 3.3.3
  • MySQL version: MySQLi 5.5.37-percona-sure1-log
  • PHP version: PHP 5.3.28
Re: Option to add a Contact during back end Event Registration missing
August 27, 2014, 03:20:54 pm
Code: [Select]
> CRM.profileCreate
< []

So an empty array

The dynamic/l10n script only contains this

Code: [Select]
// Contact create links
  if (CRM.profileCreate !== false) {
    CRM.profileCreate = [];
  }

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Option to add a Contact during back end Event Registration missing
August 27, 2014, 03:42:48 pm
In that case I'd say that your CiviCRM install is missing the reserved "New Individual" "New Household" and "New Organization" profiles.
Try asking your question on the new CiviCRM help site.

lsmithgo

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
    • Soirees at Breinton
  • CiviCRM version: 4.5 beta 7
  • CMS version: Joomla 3.3.3
  • MySQL version: MySQLi 5.5.37-percona-sure1-log
  • PHP version: PHP 5.3.28
Re: Option to add a Contact during back end Event Registration missing
August 27, 2014, 03:56:14 pm
I appear to have them, and they look the same as the ones in the sandbox (although IDs are different).  Do they need to be 4, 5 and 6?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Option to add a Contact during back end Event Registration missing
August 28, 2014, 04:51:34 am
They are looked up by name, not id, so that shouldn't matter.
Want to put a debug statement in CRM_Core_BAO_UFGroup::getCreateLinks() to see what's happening there?
Note: to make this function run you probably have to clear your cache - its output is cached in the semi-static l10n js file so it doen't run on every page.
Try asking your question on the new CiviCRM help site.

lsmithgo

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
    • Soirees at Breinton
  • CiviCRM version: 4.5 beta 7
  • CMS version: Joomla 3.3.3
  • MySQL version: MySQLi 5.5.37-percona-sure1-log
  • PHP version: PHP 5.3.28
Re: Option to add a Contact during back end Event Registration missing
August 28, 2014, 02:42:05 pm
I found the cause, without resorting to debugging, once you showed me the way!

In getCreateLinks() in line 3277 of UFGroup.php, it prepares an array to look up on the database with the values:
Code: [Select]
array('new_individual', 'new_organization', 'new_household')
The values in my database are in camel case, eg New_Individual

If I change the values in the database, and flush the cache, the drop-down immediately works.

So... the question is, which literal values are correct?  I suspect that my values come from my original Civi install many moons ago.  May be they are 'correct'?  What do you think?   [I note that ucfirst() is used later in the code to convert 'new_'].

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Option to add a Contact during back end Event Registration missing
September 02, 2014, 04:50:21 am
Nice detective work. Let's just standardize those names why don't we?
https://issues.civicrm.org/jira/browse/CRM-15218
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.5 Release Testing »
  • [FIXED] Option to add a Contact during back end Event Registration missing

This forum was archived on 2017-11-26.