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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

schnizZzla’s picture

Component: user.module » profile.module

this 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...

tostinni’s picture

I'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...

drumm’s picture

Version: 5.0 » 6.x-dev
Component: profile.module » user.module

Confirmed.

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.

chx’s picture

Get http://drupal.org/node/177488 in and we will talk again :)

chx’s picture

Status: Active » Needs review
FileSize
1.87 KB

This 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.

pwolanin’s picture

perhaps slashes should be prohibited in profile names too?

pwolanin’s picture

Actually - 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?

pwolanin’s picture

ok, 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'

pwolanin’s picture

hmmm, 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.

chx’s picture

FileSize
2.05 KB

Unlike 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.

pwolanin’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
3.49 KB

patch works as advertised. Attached version differs slightly as follows:

  • added more code comments to explain the operation of the new load function.
  • use the new load function for user/%/edit and user/%/edit/account also - this is needed to make sure a 404 is returned for invalid profile categories.
  • cache the user object in the load function since the load function will get called once per profile tab.
chx’s picture

Very 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.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Great, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.