This is a patch to be able to edit user_related_content on user_edit form. (4.6)

I needed this new functionality to be able to make relationship of registered user and partner database (that is 'partner' content_type: which contains all details e.g: telefon, address of registered users)

TODO:
- adding option to resctrict number of related_nodes for the given content_type
(This patch only can handle one node per user per content_type)
- adding option: required when adding/editing user.
- adding option: to appear in registration form
- Select form: check if user have right to see those nodes (node_access)

- with autocomplete in 4.7 it will be more usable.

Comments

keve’s picture

StatusFileSize
new6.27 KB

Some bugfixes.

ejort’s picture

Hi keve,

Thanks for the patch. I will try to look at this after I get home from work tonight or tomorrow.

Cheers,
Eric

ejort’s picture

Hi,

I've finally had a chance to play with this patch.

1. One thing to note is that I'm trying to keep all the inline SQL queries out of this module, all the queries are contained in a few api functions at the end of the module which I'll probably split into a user_related_content.inc file soon. This patch should be rewritten to use these functions. If there's something this api doesn't do that you need, please let me know.

Ideally this patch should be able to exist as a separate module which just uses the user_related_content api.

2. As the relationship types aren't 1-1, it's strange to have a drop down list as the interface. I'm going to add options to restricts relationship types to be 1-1, 1-n and n-1 sometime, but until then this interface isn't of general use in this module.

Cheers,
Eric

keve’s picture

Thanks for the comments.
Yes, I know, on my site, i use it only for 1-1 relationship.
I just wanted to share. :)

Note: For 1-n relationships, more dropdown list can be used (as in node forms of this module, there are 5 input boxes).

Good idea, for the API.

In my opinion. It would not worth creating as a separete module. It would be nice if someone could edit relationships both from node and user pages. (Possibly it could be restricted as on option on settings page.)

ejort’s picture

It would be nice to edit the relationships from the user pages. The first released version of this module in CVS had code to edit relationships from the user pages as well as the node forms, however it was disabled as I hadn't found a nice interface for selecting from possibly thousands of nodes, but the code (which worked) is in CVS to look at. In the end I decided that the drupal interface for browsing nodes with the add/remove links was better than what I had.

When 4.7 is released I will migrate the production site I wrote this module for to it and update the module in the process. I think the auto complete functionality in 4.7 will make this a lot better.

Rosamunda’s picture

Is there a way to use the block this module creates to add a list of all that author articles?
Thanks!
Rosamunda