Drupal 6 managing Content Profile profiles
Working an a Drupal 6 site that I in开发者_运维技巧herited, and I'm having a bit of a problem understanding Content Profile-based profiles. The site admin had users they wanted to delete, and did so, but the profiles are still showing up in a field drop-down that references profiles.
I look on the Content tab to try and remove them that way, they're not listed, but I can query them manually in the database, and they're there. Other profiles (from existing users) are visible on the Content tab.
I hesitate deleting them from the DB directly, since I don't know what dependencies those records might have.
Bottom line, I need to have a repeatable way of cleaning up those profiles that have no users associated with them.
Thanks
Try creating a view with view type set to User. In the Relationships section, add a relationship for Profile. Set the relationship to be required. In the fields section, add the nid and title fields from the related Profile. The view should now be pulling in all users and outputting the nid and title of any related Profiles. That should eliminate Profiles that are not attached to existing users. Finally, edit your Node Reference field to use the view you just created to generate the listed items.
精彩评论