Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If a user has permission to add a nodes of the type "profile" wich is marked as "Use this content type as a content profile for users" it still gets the chance to create an additional profile node wich isnt supposed to be happening right?
anyone else had been experiencing this?
Thanks in advance
Comment | File | Size | Author |
---|---|---|---|
#8 | content_profile-573974-9.patch | 2.44 KB | thePanz |
#7 | content_profile-573974-7.patch | 1.77 KB | thePanz |
#6 | 573974-hide_create_menu_item.patch | 1.08 KB | jeffschuler |
Comments
Comment #1
Todd Nienkerk CreditAttribution: Todd Nienkerk commentedI've experienced this as user 1. Users with fewer permissions appear to be limited to one profile node.
Comment #2
Todd Nienkerk CreditAttribution: Todd Nienkerk commentedCorrection: Any user with the "administer nodes" permission is sent to the node creation form but receives an error on submit. Line 377 appears to be the culprit:
Removing
&& !user_access('administer nodes')
will force that user to edit the existing profile node. Here's the modified line 377:However, the module author is correct to include this code. Otherwise, and admin cannot create profiles on behalf of other users.
The real problem, it seems, is the default "Create content" menu item. Perhaps it's best if the "Create content" menu items for each of the profile content types is removed from the menu? Here's a
hook_menu_alter()
that does it:Comment #3
fagoYep, administer nodes people can create profiles on behalf other users, that's supposed to work like that.
But removing the menu item makes sense to me? Could you file a patch? Anyone against this change?
Comment #4
Macronomicus CreditAttribution: Macronomicus commentedsubscribing ^_^
Comment #5
Philo72 CreditAttribution: Philo72 commentedBefore the patch comes out where would i put this little bit of code you have written?
Phil
Comment #6
jeffschulerPatch to add functionality to content_profile_menu_alter() to hide Content Profile types in the Create Content menu.
Instead of unsetting, this sets the menu item's type to MENU_CALLBACK to keep it's path available (but not show it in the menu.)
Comment #7
thePanz CreditAttribution: thePanz commentedFollowing the previous patch I've added an option (a check box in the profile settings page) to choose if the profile should be hidden from the "Create Content" menu.
Comment #8
thePanz CreditAttribution: thePanz commentedSome minor fixes applied
Comment #9
Ralt CreditAttribution: Ralt commentedGreat patch!