When using Content-Profile I cannot automatically link the User as e.g. employee of a company. With cnr I can only link to the Content-Profile of that user leaving the actuall user out. It would be great to have such functionality.
Example:
On my Content Profile I choose my company (which has its own Content-Company-Profile) and with cnr on the Content-Company-Profile the employees would be listet automatically. So the company would never have to search for all its employees in a huge list and add them manually.
For now I can only make that happen via a "View".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

domidc’s picture

For this to work the user profile would need a node reference field. Which is doesnt have.
I ll think about it. It would be cool to have this functionality.

edleob’s picture

I am using the Node Profile to quasi-node reference a User and would love this to work.

domidc’s picture

Category: feature » task
Status: Active » Postponed

Maybe later.

rkuo’s picture

Version: 6.x-3.1 » 7.x-4.0
Category: task » feature
Status: Postponed » Active

Hi Dominique,

Now that in Drupal 7, user profiles have node reference fields, I was wondering if this feature could be re-looked at (Integrate user references in with corresponding node references).

Thanks in advance. Great work with the module!

rkuo’s picture

- Just to follow up on this issue:

I made a set of hacks that implements this functionality, however it is very rough. If there is interest in this issue (other than from myself) I can try and clean it up and make it a patch, otherwise I highly doubt it is up to coding standards right now.

glennnz’s picture

+1!!!

@rkuo
Put it up, I reckon there will be some folks who can help out.

rkuo’s picture

Status: Active » Needs review
FileSize
25.46 KB

Alright, I cleaned up the code and made it a patch!

Some notes:

- Bulk updating/"Update existing nodes" doesn't work yet. Shouldn't be too hard to implement, just haven't gotten around to it yet.

- It might look like a lot was changed, but the tweaks are actually very trivial. Essentially, there are 4 cases of references between nodes that the module looks at now...

1. Node -> Node
2. Node -> User
3. User -> Node
4. User -> User (So, supposedly this module should also work as "corresponding user references" now. Haven't tested it out fully yet though)

... whereas before, it would only work for the case of Node -> Node. Each case has its own set of user/node variables it needed to use..so I went through all of the functions and changed it so it would use the right ones based on the cases.

modstore’s picture

It would be great if this would work with the profile2 module in drupal 7.

tvilms’s picture

Hi, @modstore, I saw your post and assumed it's not worth me applying this patch, given that I'm on D7 and also using profile2. Did you try the patch with profile2 and experience problems?

modstore’s picture

That's correct, it works if you add fields directly to the user type, but profile 2 fields are not available.

glennnz’s picture

@rkuo

Your patch doesn't work for me, there are several errors.

I get the following:

patching file corresponding_node_references.crud.inc
Hunk #1 FAILED at 16.
Hunk #2 FAILED at 119.
Hunk #3 FAILED at 163.
Hunk #4 FAILED at 175.
Hunk #5 FAILED at 226.
Hunk #6 succeeded at 330 with fuzz 1.
5 out of 7 hunks FAILED -- saving rejects to file corresponding_node_references.crud.inc.rej
patching file corresponding_node_references.module
Hunk #1 FAILED at 55.
Hunk #2 succeeded at 165 (offset -2 lines).
Hunk #3 succeeded at 179 (offset -2 lines).
Hunk #4 succeeded at 194 with fuzz 1 (offset -1 lines).
Hunk #5 succeeded at 209 (offset -2 lines).
1 out of 5 hunks FAILED -- saving rejects to file corresponding_node_references.module.rej

--EDIT--

Oops, I was applying the patch to the wrong version....

glennnz’s picture

A bug:

A user without 'View user profiles' permissions gets the username as a link. Clicking the link goes to 404, but it shouldn't be a link in the first place....

This is post the patch in #7.

glennnz’s picture

Status: Needs review » Active

Something seems to have changed here? I'm trying to run this patch again on a new instance, but I can't get it to run against any version of cnr.

Does someone have the patched files to put up here?

glennnz’s picture

Version: 7.x-4.0 » 7.x-4.22
Priority: Normal » Major

Is anyone getting anywhere with this?

czigor’s picture

Have you checked out the Relation module? It's supposed to become a replacement of cnr (and much more). It can handle all entities (users, field_collections), not just nodes.

glennnz’s picture

@czigor

The Relation module doesn't do what I want. The UI for muktiple relation selects is very clunky (that is, the Relation Select module.

Can anyone post the patched cnr files for user integration?

Thanks,

Glenn

glennnz’s picture

Bump....

kclarkson’s picture

I am surprised at how many people don't see the importance of node -> user and user -> node references.

Is the patch mentioned in #7 added to the development version yet?

Thanks for the hard work on this module :)

tiyberius’s picture

Count one more vote for this feature ... !

tiyberius’s picture

Okay, I updated the patch in comment #7 to work on the latest version of CNR. Many thanks to the original patch writer 'rkuo'.

On admin/config/system/corresponding_node_references the corresponding user references show up and I am able to save them. However, when I try to create a node with a corresponding user reference on it, I get a

EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7409 of /Applications/XAMPP/xamppfiles/htdocs/drupal7/includes/common.inc).

As I am not the maintainer of this module, I have no idea how to fix this without reviewing the code base extensively.

I have attached the updated patch to this comment. czigor or anyone familiar with this module, could we get some help? I know that you mentioned the Relation module in comment #15, but the Relation module is still very much in development and also is not feasible for many site developers to switch to after a site has been built using node and user references.

glennnz’s picture

Hi tiyberius

Would you please reply and attach your entire amended module code, rather than just the patch?

I'll have a look, see if I can figure this out.

Thanks,

Glenn

tiyberius’s picture

FileSize
17.75 KB

Hi Glennz,

Terribly sorry about the delayed response. Apparently my account does not send me updates to comment threads.

It has been a while since I've looked at this project, but I think I found what you are looking for, it should be attached to this comment.

In other news, I won't be able to help with this fix due to time restrictions as my current job does not endorse Drupal module development.

I hope this is what you are looking for. If it is not, please let me know and I'll try to dig up the right pieces so you can get this issue resolved!

glennnz’s picture

Ah, beyond me to fix this problem.

Czigor??

glennnz’s picture

Category: feature » bug
Priority: Major » Critical

Changing priority.

czigor’s picture

Category: bug » feature
Priority: Critical » Normal

Please don't raise the priority. A feature request cannot be critical. If you need it and cannot do it you can hire Dominique or me or someone else, see http://drupal.org/project/cnr.

As I do not need this feature and it's kind of out of the scope of the project (suggested by the project name) I won't spend my free time on it. Naturally, if someone makes a patch and the community tests it, it will be commited.

glennnz’s picture

Hi Tobias

Looks like it's you and I :-(

Have you been able to pin down where in the code the error in #20 is coming from?

Thanks,

Glenn

uripo’s picture

Version: 7.x-4.22 » 7.x-4.x-dev

+1
I also need that feature !!

Glenn, anything new to tell? Were you able to fix this?
I could try to look into it but I think I won't be able to solve this.

glennnz’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.