-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Make ElementalAreaController a subclass of FormSchemaController #1273
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
class ElementalAreaControllerTest extends FunctionalTest | ||
{ | ||
protected static $fixture_file = 'ElementalAreaControllerTest.yml'; | ||
|
||
protected static $extra_dataobjects = [ | ||
TestElementContent::class, | ||
TestElementalArea::class, | ||
|
@@ -180,9 +180,9 @@ public function testElementFormPost(string $idType, string $dataType, string $fa | |
$response = $this->post($url, $data, $headers); | ||
$this->assertSame($expectedCode, $response->getStatusCode()); | ||
if ($fail === 'csrf-token') { | ||
// Will end up at an HTML page with "Silverstripe - Bad Request" | ||
$this->assertSame('text/html; charset=utf-8', $response->getHeader('Content-type')); | ||
$this->assertStringContainsString('Silverstripe - Bad Request', $response->getBody()); | ||
// Gives suitable error message for XHR request | ||
$this->assertStringStartsWith('text/plain', $response->getHeader('Content-type')); | ||
$this->assertStringContainsString('There seems to have been a technical problem', $response->getBody()); | ||
Comment on lines
-183
to
+185
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The modal links used to be routed through Now, a simple The end result for the user is no change. |
||
return; | ||
} | ||
$this->assertSame($expectedCode, $response->getStatusCode()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was originally changed from subclassing
LeftAndMain
toCMSMain
in #449The reasoning was
Maybe that made sense at the time, but you can have an elemental area on any
DataObject
including inside aModelAdmin
.... so requiringCMS_ACCESS_CMSMain
permissions is just wrong. Instead, require CMS access more generally, and let the model permissions dictate what can and can't be done within the controller.