Closed (fixed)
Project:
CiviNode And Civinode CCK
Version:
master
Component:
CCK Integration
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 May 2006 at 18:44 UTC
Updated:
23 May 2006 at 22:04 UTC
With Drupal 4.7 and the latest CVS version of CCK, I cannot select a contact when creating a CCK type with the civinode field. The field is there, but the selection list is blank (using the admin account). I'm not surre if this is a bug or a configuration issue. It looks like all three modules (civicrm, cck, and civinode) are correctly installed.
Comments
Comment #1
Torenware commentedMark Fredrickson's probably the best person to look at this one. I've "pinged" him, and I suspect he'll have at least a suggestion how to deal with this.
Comment #2
mfredrickson commentedThis is a "known" bug. When I wrote the original code, I used the default CiviCRM/Drupal API to check for permissions. When Rob decided to include this code in CiviNode, he asked me to use the CiviNode ACL system instead. This was a good suggestion, but there are a couple of small bugs from the transition.
The fix will be in civinode_utils.inc, but I don't know what it is yet. I need to understand the CiviNode ACL system better first before I can suggest a patch.
(PS. I've subscribed to all the CiviNode issues, so I will get new CiviCRMdata.module issues, as they emerge.)
Comment #3
bomarmonk commentedThanks for your response to this issue. Integrating civicrm with cck has a great deal of potential, expecially if you can expose an entire group of contacts to a node. Thanks for your work so far and I will be following your progress (I'll test new developments as they become available).
Comment #4
Torenware commentedI'm debugging this now, and we're going to have to decide how this *should* behave. Here's the problem.
The admin user should access to *all* contacts. This means creating a pop-up menu that might have thousands of items. this is probably not a good idea.
Currently, the call
civinode_get_drupal_allowed_groups()does not return any groups for an admin that has not explicitly created accesses for groups. This is arguably a bug, and I'll fix the behavior. But do we really want to create a menu of unbounded size?This is up to Mark; most likely, we need to think more realistically how to select contacts. Any better ideas?
Comment #5
Torenware commentedI've added code to check for user admin rights which will make sure that if you have the right to see all contacts, you'll be able to see all groups.
Try this one out and see if it does what you want.
Comment #6
Torenware commentedTo be clear: code is now in CVS.
Comment #7
bomarmonk commentedI figured out my problem: civinode only displays contacts in the CCK select box that have been added through Drupal's "create content"->Nodify CRM contact. For some reason, I was thinking the cck would query the CiviCRM contacts without having to nodify them. Would there be a mass "Nodify" option, where all CRM contacts and groups could be nodified at once? Maybe. This issue can be closed and I'll submit a feature request perhaps. Sorry about my mistake.
Comment #8
mfredrickson commented@torenware: In the long run, I think the solution should be a new widget. Preferably one that depends on the activeselect.module "drill down" feature. The widget would have two select boxes: the first would be all the groups a person has access to (in admin's case all of them). The second select box would populate with the users in the groups selected in box 1. It would be empty until 1+ groups were selected.
In the short run, I say let admin (or someone with an appropriate priv) choose from everyone. It might be irritating, but I think it is the correct behavior.
@bomarmonk: Thanks for trouble shooting this. I was unaware the contacts had to be nodified first. I think the solution is two fold:
#2 is trivial, as I already have that code. #1 is easy because that is what we currently have. I hope I can have a fix sometime today.
Comment #9
mfredrickson commentedI'm not sure this is "fixed" yet. I'm keeping it open to keep it on my radar screen.
Comment #10
mfredrickson commentedOk. Things seem to be working. Closing this.
Comment #11
mfredrickson commented