mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Remove unnecessary $schemaLink parameter
This commit is contained in:
parent
aa47845a6c
commit
7cd32b7d72
@ -17,10 +17,9 @@ class FormSchema {
|
|||||||
* Gets the schema for this form as a nested array.
|
* Gets the schema for this form as a nested array.
|
||||||
*
|
*
|
||||||
* @param Form $form
|
* @param Form $form
|
||||||
* @param string $schemaLink Link to get this schema
|
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getSchema(Form $form, $schemaLink) {
|
public function getSchema(Form $form) {
|
||||||
$schema = [
|
$schema = [
|
||||||
'name' => $form->getName(),
|
'name' => $form->getName(),
|
||||||
'id' => $form->FormName(),
|
'id' => $form->FormName(),
|
||||||
|
@ -379,8 +379,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
$return = ['id' => $id];
|
$return = ['id' => $id];
|
||||||
|
|
||||||
if (in_array('schema', $schemaParts)) {
|
if (in_array('schema', $schemaParts)) {
|
||||||
$schemaLink = $this->getSchemaLinkForForm($form);
|
$return['schema'] = $this->schema->getSchema($form);
|
||||||
$return['schema'] = $this->schema->getSchema($form, $schemaLink);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('state', $schemaParts)) {
|
if (in_array('state', $schemaParts)) {
|
||||||
|
@ -52,7 +52,7 @@ class FormSchemaTest extends SapphireTest {
|
|||||||
'actions' => []
|
'actions' => []
|
||||||
];
|
];
|
||||||
|
|
||||||
$schema = $formSchema->getSchema($form, 'admin/mysection/schema');
|
$schema = $formSchema->getSchema($form);
|
||||||
$this->assertInternalType('array', $schema);
|
$this->assertInternalType('array', $schema);
|
||||||
$this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($schema));
|
$this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($schema));
|
||||||
}
|
}
|
||||||
@ -334,7 +334,7 @@ class FormSchemaTest extends SapphireTest {
|
|||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
$schema = $formSchema->getSchema($form, 'admin/mysection/schema');
|
$schema = $formSchema->getSchema($form);
|
||||||
|
|
||||||
$this->assertInternalType('array', $schema);
|
$this->assertInternalType('array', $schema);
|
||||||
$this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($schema));
|
$this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($schema));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user