If I go to 'user/me/edit/profile' , edit my profile, and save it, I get redirect to /profile/profilename instead of redirect back to user/me/edit/profile.
That is because in content_profile_form_alter() there is is_numeric(arg(2)) check that is not working with 'me' alias. I've fixed the problem removing this check from condition.

Comments

rburgundy’s picture

subscribing - can you please share exactly the line/code you altered for the community?
also, will this change affect any other uses of this module?

marcus_gbs’s picture

I am having issues as my pageroute is aborting after the content_profile creation, so I was wondering if this could possibly be the issue I am seeing as well.

I searched the entire module and found only one call to is_numeric. It is on line 273 of the content_profile.module file. This is within the content_profile_form_alter function. The lines, starting with 272 are:

    // Customize the redirect target and buttons of our own node forms.
    if (arg(0) == 'user' && is_numeric(arg(1)) && arg(2) == 'edit' || arg(2) == 'profile') {
      $form['buttons']['preview']['#access'] = FALSE;
      $form['buttons']['delete']['#access'] = FALSE;
      $form['#redirect'] = arg(2) == 'profile' ? 'user/'. $form['#node']->uid : $_GET['q'];
    }

I have not investigated this any further than this, but thought I would post so that you would know what I found and maybe both of us looking at this might find something or maybe the module owner will take a look.

fago’s picture

Category: bug » support

There is no such alias in core?

fago’s picture

Status: Needs review » Active

And no patch.

restyler’s picture

I think instead of removing is_numeric check you should add 'me' to the condition:
Change

 if (arg(0) == 'user' && is_numeric(arg(1)) && arg(2) == 'edit' || arg(2) == 'profile') {

to

 if (arg(0) == 'user' && (is_numeric(arg(1)) || arg(1) == 'me' ) && arg(2) == 'edit' || arg(2) == 'profile') {

(not tested but I hope it's ok)

einpol’s picture

working for me. patch would be good.