Skip to Content Skip to Menu

CB with AceSEF issue

  • jay.jose
  • jay.jose
  • OFFLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 0
12 years 4 months ago #202121 by jay.jose
CB with AceSEF issue was created by jay.jose
Hi all,

For the past few days, we are trying to fix an issue between CB and AceSEF. The problem is that, with AceSEF, somehow the user profile link (menu item (user profile), CB Online module, list) of the user currently logged on is pointing to some random CB URL.

Example:
I logged in as User 2. At the same time, User 1 and 3 are also logged in. All links pertaining to my user (User 2) in the User Profile menu item, CB Online and User List are all pointing to the wrong URL. Link to User 1 and User 3 profile are working properly. If I logged in as User 3, all links to User 3 profile are again pointing to the wrong URL. Link to User 1 and 2 are working properly.

The issue mentioned above can be observed if AceSEF for Community Builder is active. If we disable AceSEF for Community Builder, everything works properly.

After a few days of testing, debugging and code tracing, we found out that the userProfileUrl function assigns a null value to the userid if the id is equal to the current logged in user. I think, somehow, AceSEF is not able to catch that null userid is equal to the current logged in user, thus giving a wrong URL.

In order to correct the current issue, we decided to comment out line 2870 of administrator/components/com_comprofiler/plugin.foundation.php
Code:
function userProfileUrl( $userId = null, $htmlSpecials = true, $tab = null, $format = 'html' ) { if ( $userId && ( $userId == $this->myId() ) ) { /*$userId = null;*/ } return $this->cbSef( 'index.php?option=com_comprofiler' . ( $userId ? '&task=userprofile&user=' . (int) $userId : '' ) . ( $tab ? '&tab=' . urlencode( $tab ) : '' ) . getCBprofileItemid( false ), $htmlSpecials, $format ); }

Doing so solved our current issue. The question now is, what's the reason for assigning null value if it's the same as the current user? will there be any issue to other area/function if we comment this line out? So far, we haven't encountered any error...yet. But just wanted to be sure that it is ok to comment it out.

Thanks

Please Log in or Create an account to join the conversation.

  • jay.jose
  • jay.jose
  • OFFLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 0
12 years 4 months ago #202381 by jay.jose
Replied by jay.jose on topic Re: CB with AceSEF issue
Currently, the fix above is working properly and haven't encountered any issues (yet). One problem that we do encountered is when a user edit/update their profile, upon saving, instead of being redirected back to the user's profile, they are being redirected to a different CB URL (same issue that we are having in the previous post).

As of now, I have narrowed it down to line 2785 of the same file above.
Code:
$uri = call_user_func_array( $this->_cmsSefFunction, array( $this->_sefFuncHtmlEnt ? $string : cbUnHtmlspecialchars( $string ) ) );

If I comment out the whole "if" statement and just assign the $string to $uri, everything works properly, but the URL will be plain URL and not SEF URL. This will also affect all other redirect using the cbSef function.

Has anyone has any suggestion on how to fix this AceSEF issue?

Thanks

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum