Fix getProfileUrl, so it works with preventProxyCache. fixes #10877
This commit is contained in:
parent
831664397d
commit
fea30d0db0
3 changed files with 17 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
7.8.0
|
||||
- fixed #10877: getProfileUrl() broken
|
||||
- fixed #10844: Ad Sales: No template variable Help
|
||||
- fixed #10873: Code editor breaks CSS comments
|
||||
|
||||
|
|
|
|||
|
|
@ -814,7 +814,7 @@ sub getProfileUrl {
|
|||
|
||||
my $identifier = $session->config->get("profileModuleIdentifier");
|
||||
|
||||
return qq{$page?op=account;module=$identifier;do=view;uid=}.$self->userId;
|
||||
return $session->url->append($page,qq{op=account;module=$identifier;do=view;uid=}.$self->userId);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
18
t/User.t
18
t/User.t
|
|
@ -22,7 +22,7 @@ use WebGUI::User;
|
|||
use WebGUI::ProfileField;
|
||||
use WebGUI::Shop::AddressBook;
|
||||
|
||||
use Test::More tests => 225; # increment this value for each test you create
|
||||
use Test::More tests => 226; # increment this value for each test you create
|
||||
use Test::Deep;
|
||||
use Data::Dumper;
|
||||
|
||||
|
|
@ -833,6 +833,7 @@ isa_ok( $newCreateUser, 'WebGUI::User', 'create() returns a WebGUI::User' );
|
|||
# getProfileUrl
|
||||
#
|
||||
################################################################
|
||||
$session->setting->set('preventProxyCache', 0);
|
||||
|
||||
WebGUI::Test->originalConfig('profileModuleIdentifier');
|
||||
my $profileModuleId = $session->config->get('profileModuleIdentifier');
|
||||
|
|
@ -845,7 +846,7 @@ $session->config->set('profileModuleIdentifier', 'someOtherThing');
|
|||
is(
|
||||
$newFish->getProfileUrl('cellblock'),
|
||||
"cellblock?op=account;module=someOtherThing;do=view;uid=".$newFish->userId,
|
||||
'getProfileUrl: uses profileModuleIdentifier to pick the right Account module'
|
||||
'... uses profileModuleIdentifier to pick the right Account module'
|
||||
);
|
||||
$session->config->set('profileModuleIdentifier', $profileModuleId);
|
||||
|
||||
|
|
@ -853,9 +854,20 @@ $session->asset(WebGUI::Asset->getDefault($session));
|
|||
is(
|
||||
$newFish->getProfileUrl(),
|
||||
"/home?op=account;module=$profileModuleId;do=view;uid=".$newFish->userId,
|
||||
'getProfileUrl: uses session->url->page if no URL is passed in'
|
||||
'... uses session->url->page if no URL is passed in'
|
||||
);
|
||||
|
||||
$session->setting->set('preventProxyCache', 1);
|
||||
my $newFishId = $newFish->userId;
|
||||
|
||||
like(
|
||||
$newFish->getProfileUrl(),
|
||||
qr{/home\?noCache=\d+:\d+;op=account;module=$profileModuleId;do=view;uid=$newFishId},
|
||||
'... handles preventProxyCache correctly'
|
||||
);
|
||||
|
||||
$session->setting->set('preventProxyCache', 0);
|
||||
|
||||
################################################################
|
||||
#
|
||||
# hasFriends
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue