Creating CCK type with CiviCRM Contact Reference and/or CiviCRM Group Reference generates the following fatal error:

PHP Fatal error: Call to undefined function civinode_get_current_target_groups() in /var/www/dev/sites/default/modules/civinode/civinode_utils.inc on line 611, referer: http://dev.cctv.org/admin/node/types/content_test/fields

Comments

Torenware’s picture

Emily,

Sorry for the delay on this; I've been out a few days sick.

Your bug is, of course a real bug, and I'll post a fix in the next day or so.

Rob

Anonymous’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

I have almost the same error (different line) while creating a CiviCRM Relationship Reference with version 5.x-1.x-dev

Fatal error: Call to undefined function civinode_get_current_target_groups() in /home/mnadvies/public_html/drupal/sites/evenementen-verkeersregelaars.nl/modules/civinode/civinode_utils.inc on line 607

thanks,
Martin

nedjo’s picture

Status: Active » Needs review

It looks at first glance like the function civinode_get_current_target_groups() was mistakenly deleted during the last update to civinode_utils.inc (in which many functions were deleted). Attached patch simply reinstates the deleted function. Untested.

nedjo’s picture

StatusFileSize
new1.59 KB

With patch.

Torenware’s picture

Sorry folks, I've been away net access for a few days.

Yeah, I am aware about the missing function. But the solution is not to restore it, but reimplement it. Now that I have my laptop working again and have net access, I should have the patch up in a couple of hours.

Torenware’s picture

StatusFileSize
new945 bytes

Here's how I'd recommend patching this. It's much simpler for now, especially since we are no longer doing access control on nodes.

If a couple of you will try this to see if it works for 5.x, I'll take this patch and commit it.

I'm going to post a similar patch for 4.7 in just a sec.

Torenware’s picture

StatusFileSize
new918 bytes

Here's the 4.7 version of the same patch. If you've seen the problem, please apply the patch and make sure that things are happier now.

Thanks,
Rob

Anonymous’s picture

I did a fast and little test with rhe 5.1 patch: looks good!!

Torenware’s picture

Assigned: Unassigned » Torenware
Status: Needs review » Fixed

OK, since I haven't gotten a lot more response, let's check this in (I'm doing both HEAD and DRUPAL_4_7 branches).

I'm closing this bug for now. If the problem persists, I'll reopen it later.

Torenware’s picture

Forgot to push this to DRUPAL_5. Doing it now.

emilyf’s picture

StatusFileSize
new26.87 KB

Thanks, this patch does fix that undefined function call for 4.7....i may have read wrong, but it sounded like you had commited this to the 4.7 head, but it's actually not in there yet.

However, now it's working, except when I make a cck field type for contact reference, and I attach it to a profile that is just the first and last name, and I choose to display as select list, when I go to create that content type, the select list shows up but all the "entries" in it are completely blank.

Am I just doing something stupid here? See screenshot....

Thanks,
Emily

Anonymous’s picture

Status: Fixed » Closed (fixed)
emilyf’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

So...is this closed? Is this something on my end? Any amount of information would be greatly appreciated! I am confused since this issue appears to have been closed by an anon user. Thanks.

Torenware’s picture

Hm... don't know how I closed it and got labeled "Anonymous".

Yes, this *should* be fixed, and I've posted the fix to both HEAD and the 5.x branch.

If you're still seeing this, tell me and I'll investigate it further.

nedjo’s picture

A cron script (run by hook_cron, hence as anon) changes all issues from 'fixed' to 'closed' after they've been fixed for a certain period. So this is normal drupal.org behaviour--all issues get closed after a certain amount of time.

emilyf’s picture

Version: 5.x-1.x-dev » 4.7.x-1.x-dev

Thanks for getting back to me...has this been incorporated into 4.7 (I am running 4.7, am confused at how this thread ended up being 5)? I tried getting the HEAD, but it looks like that's 5 too (it gives me php fatal errors when I try to install it).

Thanks

Torenware’s picture

Emily,

This should be fixed in the 4.7 branch. I did the check-in on 27 February, which I see is the date of the latest 4.7 build.

Sorry for the confusion; I had to read the CVS logs myself to be sure.

Rob

emilyf’s picture

Status: Postponed (maintainer needs more info) » Fixed

Rob,

Thanks! I didn't realize that the module had incorporated CiviCRMData, so I was making a rookie mistake and only enabling CiviNode.

This looks beautiful!
Emily

Torenware’s picture

closing this one out.

Anonymous’s picture

Status: Fixed » Closed (fixed)