After use this module to import the profiles from my site, I started to see a lot of warnings of a duplicate entry in menu router.
I traced the problem and found this:
SELECT path, access_callback FROM menu_router WHERE path LIKE 'user/%%/edit%' ORDER BY access_callback;
+-----------------------------------+-----------------------------+
| path | access_callback |
+-----------------------------------+-----------------------------+
| user/%/edit/academic_details | content_profile_page_access |
| user/%/edit/contact_details | content_profile_page_access |
| user/%/edit/financial_information | content_profile_page_access |
| user/%/edit/general_information | content_profile_page_access |
| user/%/edit/personal_information | content_profile_page_access |
| user/%/edit/profile | content_profile_page_access |
| user/%/edit/submit_application | content_profile_page_access |
| user/%/edit/Academic details | profile_category_access |
| user/%/edit/Admin | profile_category_access |
| user/%/edit/Contact details | profile_category_access |
| user/%/edit/Financial Information | profile_category_access |
| user/%/edit/General information | profile_category_access |
| user/%/edit/Personal information | profile_category_access |
| user/%/edit/Submit Application | profile_category_access |
| user/%/edit | user_edit_access |
| user/%/edit/account | user_edit_access |
+-----------------------------------+-----------------------------+
All rows from profile_category_access from the access_callback column are added by profile module.
The problem is Content Profile uses the Human name as path, and it can produce colissions if Profile path doesn't have spaces in the profile:
In my case,
user/%/edit/Admin | profile_category_access
Produces a duplicate entry when Profile Migrate try to create the Admin Content profile.
user/%/edit/Admin | content_profile_page_access
Of course this is not neccesary a bug of of Profile Migrate, but since it will create Content Profile from a profile value, it would be nice to check if this will produce duplicates in menu_router.
Comments
Comment #1
karens commentedProfile Migrate has no direct control over the menu entries. I kind of follow what is happening, but can you provide more details about how to replicate this? I'm not sure how much I can do with this, but the first step is to replicate it.
Comment #2
dagmarHi Karen:
Yes I know, this is not certainly a Profile Migrate bug. To replicate. Create a textfield in a Profile category called Admin.
Next, enable Content Profile and create a Content Type called Admin and set it to be a content profile.
When the profile category (Admin) and the content type name (Admin) are the same, Drupal shows this warning:
This usually don't occurs since is very rare to create a profile and a content profile whit the same name. But Profile Migrate do exactly this. The warning disappears if Content profile or Profile is disabled.
So a possible solution would be warning to users that the migrate will create duplicate entries in the menu_router table or better, allow to change the Content Type name before import the profile.
Of course this should be fixed by Content profile, but probably the fix will be validate the content profile name, and then, we should check this too.
Comment #3
karens commentedAh, hmm. Well maybe we should just automatically rename them, screwing up the menu table is a bad thing to do. I could check if Profile is enabled, but even if it isn't, if we create duplicate names and they enable it later it will be bad. Plus we should not be creating menu names with spaces. We may need to tweak the way this is done to keep that from happening.