mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Use Director::get_current_page() rather than Controller::curr() in Widget_Controller->Link() to avoid infinite loops when the widget controller is handling a request.
From: Andrew Short <andrewjshort@gmail.com> git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90978 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a8e96ef3f0
commit
5ba3a91741
@ -155,9 +155,13 @@ class Widget_Controller extends Controller {
|
||||
}
|
||||
|
||||
public function Link($action = null) {
|
||||
return Controller::curr()->Link (
|
||||
Controller::join_links('widget', ($this->widget ? $this->widget->ID : null), $action)
|
||||
);
|
||||
$segment = Controller::join_links('widget', ($this->widget ? $this->widget->ID : null), $action);
|
||||
|
||||
if(Director::get_current_page()) {
|
||||
return Director::get_current_page()->Link($segment);
|
||||
} else {
|
||||
return Controller::curr()->Link($segment);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user