mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed TableListField->Link() to allow for instanciation without a form/controller (e.g. for unit tests)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60757 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d38d7208b7
commit
c706dbdcc1
@ -1226,8 +1226,14 @@ class TableListField_Item extends ViewableData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Link() {
|
function Link() {
|
||||||
return Controller::join_links($this->parent->Link() . "item/" . $this->item->ID);
|
if($this->parent->getForm()) {
|
||||||
}
|
return Controller::join_links($this->parent->Link() . "item/" . $this->item->ID);
|
||||||
|
} else {
|
||||||
|
// allow for instanciation of this FormField outside of a controller/form
|
||||||
|
// context (e.g. for unit tests)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function BaseLink() {
|
function BaseLink() {
|
||||||
user_error("TableListField_Item::BaseLink() deprecated, use Link() instead", E_USER_NOTICE);
|
user_error("TableListField_Item::BaseLink() deprecated, use Link() instead", E_USER_NOTICE);
|
||||||
|
Loading…
Reference in New Issue
Block a user