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.
Please don't hang me if this problem is already in queue or if this is a feature(?). I'm working hard at a new project and I just don't know yet how to search this queue effectively...
The problem is...
I browse to:
Administer > User Management
(?q=admin/user/profile)
I add a new field by clicking one of the links on the page:
(?q=admin/user/profile/add/textfield)
When I use a slash in the category's name e.g. I name it Category containg a / slash it results in all fields disappearing from this profile category on the user page but NOT in the registration form.
Comment | File | Size | Author |
---|---|---|---|
#12 | user_category_map-111481-12.patch | 3.52 KB | chx |
#11 | user_category_map-111481-11.patch | 3.49 KB | pwolanin |
#10 | user_category_map.patch | 2.05 KB | chx |
#8 | user_category_menu_map-111481-8.patch | 2.52 KB | pwolanin |
#5 | user_category_menu_map-111481-5.patch | 1.87 KB | chx |
Comments
Comment #1
schnizZzla CreditAttribution: schnizZzla commentedthis should be the profile module
and i run into a second problem, but I'm not able to track it down. Testing the Categories with a slash, i had this error message one time when I created a new field, but the field was created:
Missing argument 1 for profile_admin_settings_autocomplete() in D:\!APACHE\xampp\htdocs\!project\hamachi\modules\profile\profile.module on line 825.
I don't know if this also has something to do with the slash problem...
Comment #2
tostinni CreditAttribution: tostinni commentedI'm not sure if it's not an issue related to the menu system which doesn't like slash in menus...
I couldn't find any issue in menu related to this one and under the new menu system, these categories just disappear...
Comment #3
drummConfirmed.
The user_edit() function gets $category as an argument directly from the menu system, which breaks arguments on '/'.
It should grab all arg(n) where n >= 3 and arg(n) is not empty, and implode with slashes. Or use $_GET['q']. search_get_keys() has an example of this.
Comment #4
chx CreditAttribution: chx commentedGet http://drupal.org/node/177488 in and we will talk again :)
Comment #5
chx CreditAttribution: chx commentedThis patch depends on http://drupal.org/node/177488 and implements user_category_menu_map and nails down the tab parent to be user/%/edit otherwise user/123/edit/this/is will be the parent of user/123/edit/this/is/a/problem which is not what we want.
Comment #6
pwolanin CreditAttribution: pwolanin commentedperhaps slashes should be prohibited in profile names too?
Comment #7
pwolanin CreditAttribution: pwolanin commentedActually - if you are going to allow arbitrary characters - like & or ?, for exmaple, there may be many additional ways to break this. Perhaps using urlencode() is a solution?
Comment #8
pwolanin CreditAttribution: pwolanin commentedok, here's a new patch - this one requires the short and more elegant patch at: http://drupal.org/node/177488#comment-309664
note also changed 'page arguments' => array(1, 'account'), for the main callback, otherwise it stupidly breaks if you put in an invalid arg like 'user/1/edit/foo'
Comment #9
pwolanin CreditAttribution: pwolanin commentedhmmm, what's weird and suggests either a bug or room for improvement in general in the menu system code - this load function gets called 3 times with the same path on each page view of a profile page.
Comment #10
chx CreditAttribution: chx commentedUnlike the above experiments, this one works with current HEAD after
%map
and%index
is in. And they are, for quite some time now, but I forgot to reroll.Comment #11
pwolanin CreditAttribution: pwolanin commentedpatch works as advertised. Attached version differs slightly as follows:
Comment #12
chx CreditAttribution: chx commentedVery good, but there is a minor caveat. It's not impossible that we call this function with multiiple uids. Unlikely, yes, but no timpossible. Attached patch changes the static cache to be per uid.
Comment #13
Gábor HojtsyGreat, committed.
Comment #14
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.