diff --git a/forms/TableListField.php b/forms/TableListField.php index 8d14917b1..8980d9d96 100755 --- a/forms/TableListField.php +++ b/forms/TableListField.php @@ -262,10 +262,10 @@ class TableListField extends FormField { function index() { return $this->FieldHolder(); } - + static $url_handlers = array( 'item/$ID' => 'handleItem', - '$Action!' => '$Action', + '$Action' => '$Action', ); function sourceClass() { diff --git a/tests/forms/TableListFieldTest.php b/tests/forms/TableListFieldTest.php index 47e512c55..ceb0532c4 100644 --- a/tests/forms/TableListFieldTest.php +++ b/tests/forms/TableListFieldTest.php @@ -94,6 +94,24 @@ class TableListFieldTest extends SapphireTest { $this->assertEquals(array(3 => "a3", 4 => "a4"), $itemMap); } + /** + * Get that visiting the field's URL returns the content of the field. + * This capability is used by ajax + */ + function testAjaxRefreshing() { + $controller = new TableListFieldTest_TestController(); + $table = $controller->TestForm()->Fields()->First(); + + $ajaxResponse = Director::test($table->Link())->getBody(); + + // Check that the column headings have been rendered + $this->assertRegExp('/