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) »
  • CRM-7445 | Adding clients when multiclient is enabled doesn't work
Pages: [1]

Author Topic: CRM-7445 | Adding clients when multiclient is enabled doesn't work  (Read 2774 times)

jakedaynes

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.0.1
  • CMS version: Drupal 7
  • MySQL version: MySQL 5.5.9
  • PHP version: 5.3.5
CRM-7445 | Adding clients when multiclient is enabled doesn't work
May 30, 2011, 10:39:32 pm
Hey, just wondering if anybody else is experiencing the issue from CRM-7445? - Add client to the case (for multiclient) in CiviCase doesn't work

I'm in Drupal 7 with CiviCRM 4.0.1 running php 5.3.5 on a backend of MySQL 5.5.9

I grabbed the updated files from CRM-7445 for the Case module, but even that hasn't helped fix the issue.

It doesn't give me any errors, or else I'd debug myself(I'm new to CiviCRM, but not to coding in general - I just don't know where to begin with this one)

sushant

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 8
  • CiviCRM version: v3.2.x,v3.3.x v4.0.x, v4.x,trunk
  • CMS version: Drupal 6/7 ,joomla 1.5,1.6
  • MySQL version: 5.1.51
  • PHP version: 5.3.3
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
May 31, 2011, 02:46:01 am
Hi jakedaynes
IMO
There is setting to enable MultipleCaseClients feature in 
CRM/Case/xml/configuration/Settings.xml.
set AllowMultipleCaseClients to true .

I think its false by default.

Hth,
Sushant.
CiviCRM Priority Support
http://support.civigardens.com/
http://osseed.com

jakedaynes

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.0.1
  • CMS version: Drupal 7
  • MySQL version: MySQL 5.5.9
  • PHP version: 5.3.5
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
May 31, 2011, 08:59:17 am
Sushant, I'm aware, I've got it turned on, but when you select a contact, it repeatedly asks you to select one - it isn't accepting the fact that the contact has been selected

jakedaynes

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.0.1
  • CMS version: Drupal 7
  • MySQL version: MySQL 5.5.9
  • PHP version: 5.3.5
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
June 02, 2011, 07:24:52 pm
Nobody has gotten this issue in CiviCRM 4 on D7? Really?

jklee@slighpcs.com

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7.4
  • MySQL version: 5.1.58
  • PHP version: 5.2.17
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 21, 2011, 12:04:04 pm
bump bump - We are also experiencing this same issue.  Based on our use case, this may prevent us from deploying civicase altogether..  same as CRM-7445 but is an ongoing problem in 4.0.4

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: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 21, 2011, 12:47:29 pm

Would be great if you can help civicase and the community by looking at the code and potentially submitting a patch for it. Seems like we could not reproduce this issue. Alternatively can you try reproducing this on demo

thanx

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

jklee@slighpcs.com

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7.4
  • MySQL version: 5.1.58
  • PHP version: 5.2.17
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 21, 2011, 02:03:54 pm
Thank you for the reply, but it seems that multiclient is not enabled on the demo site.  when multiclient is enabled on our test server, we are able to autocomplete more than one client name during case creation but save always returns "Please select a contact or create new contact" even with only one contact.  (*All seems to function properly if a new client is created at the time of the case creation.)  We have been trying to track this issue down but cannot seem to find where the problem lies.

If AllowMultipleCaseClients is set to 0 (off) in the XML settings, it functions exactly as the demo site, and hence no multiclient functionality.  it seems that the select client autocomplete field even changes its appearance once AllowMultipleCaseClients is set to 1, but does not work.  Any advice to where to start looking would be greatly appreciated.

Thank you
« Last Edit: July 21, 2011, 04:19:47 pm by jklee@slighpcs.com »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 21, 2011, 05:21:20 pm
I tested this on my local 4.0 and it worked but I got a notice about an undefined constant which led me to the problem (pretty sure). I've filed an issue and a fix for the next release - you can patch your install using the info there to make sure it's fixed for you:

http://issues.civicrm.org/jira/browse/CRM-8549
Protect your investment in CiviCRM by  becoming a Member!

jklee@slighpcs.com

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7.4
  • MySQL version: 5.1.58
  • PHP version: 5.2.17
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 22, 2011, 01:29:52 pm
Thanks for your reply Dave, it appears that this prevents any php notices from being displayed, but still does not allow multiple clients to be added to a case.  Upon further investigation we have come up with the following solution:
Code: [Select]
        $errors = array( );
        //check if contact is selected in standalone mode
        if ( !isset( $fields['contact_select_id'][1] ) && !$fields['contact_select_id'][1] ) {
            $errors['contact[1]'] = ts('Please select a contact or create new contact');
        }
        //check selected contact for multi client option
        if ( $form->_allowMultiClient && isset( $fields['contact'][1] ) && !$fields['contact'][1] ) {
            $errors['contact[1]'] = ts('Please select a valid contact or create new contact');
        }

        return $errors;
    }

the relevant piece being

Code: [Select]
!isset

This allows us to insert multiple clients during a case creation, along with all other multi client case functionality remaining intact.  It seems logical to us that contact_select_id wouldn't be set until one was selected, but we are wondering if there are any potential caveats to this approach down the line?

Many thanks for all your help!

UPDATE:  We found that this caused errors elsewhere, however simply commenting out the following seems to have worked without causing problems anywhere else that we could discern. 
Code: [Select]
     

$errors = array( );
        //check if contact is selected in standalone mode
//        if ( !isset( $fields['contact_select_id'][1] ) && !$fields['contact_select_id'][1] ) {
//            $errors['contact[1]'] = ts('Please select a contact or create new contact');
//        }
        //check selected contact for multi client option
        if ( $form->_allowMultiClient && isset( $fields['contact'][1] ) && !$fields['contact'][1] ) {
            $errors['contact[1]'] = ts('Please select a valid contact or create new contact');
        }

        return $errors;


again, the same question applies, is this going to blow something else up down the line?
« Last Edit: July 22, 2011, 03:11:51 pm by jklee@slighpcs.com »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 22, 2011, 03:43:16 pm
I've asked the author of that part of the code to review and comment. Quite puzzled that the existing code is working fine for me on both my 3.4.4 and 4.0.4 installs?? Just to be perfectly clear, you're getting this error when you try to save a New Case - and you're accessing the new case form from a URL like this:

http://<your site>/civicrm/case/add?reset=1&action=add&atype=13&context=standalone
Protect your investment in CiviCRM by  becoming a Member!

jklee@slighpcs.com

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7.4
  • MySQL version: 5.1.58
  • PHP version: 5.2.17
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 23, 2011, 11:52:31 am
Exactly.  and the url is like:
http://civi.slighpcs.com/index.php?q=civicrm/case/add&reset=1&action=add&atype=13&context=standalone

however, we have tested on a default installation with sample case data installed.  Using the url you provided produces the same behavior.  Commenting the code as in the previous post has the same effect, allowing a successful multiclient case save.

I could pm you with login details if you would like to test it.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 25, 2011, 03:08:00 pm
Ok figured out the 'confusion'. The needed conditionality for this was added on July 14 for the upcoming 3.4.5 release. The code should be checking one condition or the other depending on whether multi-client is enabled. Here's what's in the repository now (and will be in the 3.4.5 / 4.0.5 release):

Code: [Select]
        if ( !$form->_allowMultiClient ) {
            //check if contact is selected in standalone mode
            if ( isset( $fields['contact_select_id'][1] ) && !$fields['contact_select_id'][1] ) {
                $errors['contact[1]'] = ts('Please select a contact or create new contact');
            }
        } else {
            //check selected contact for multi client option
            if ( isset( $fields['contact'][1] ) && !$fields['contact'][1] ) {
                $errors['contact[1]'] = ts('Please select a valid contact or create new contact');
            }
        }

Would be great if you could try that out (altho pretty sure it's on target - and it works for me) :-)
Protect your investment in CiviCRM by  becoming a Member!

jklee@slighpcs.com

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7.4
  • MySQL version: 5.1.58
  • PHP version: 5.2.17
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 25, 2011, 05:09:47 pm
Just to confirm, the code from your last post does fix the issue.  Once again, thank you for all your help on this!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CRM-7445 | Adding clients when multiclient is enabled doesn't work
July 26, 2011, 09:13:50 am
Thx for report back. Please take a few minutes to post on the forum showcase (or even better - a blog post on civicrm.org) about your project / CiviCase implementation.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CRM-7445 | Adding clients when multiclient is enabled doesn't work

This forum was archived on 2017-11-26.