mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Resolve merge regressions
This commit is contained in:
parent
0b1f297873
commit
ce93a8a98e
@ -612,7 +612,6 @@ class Image extends File implements Flushable {
|
|||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$pattern = "/^(({$generateFuncs}).*\-)+" . preg_quote($this->Name) . "$/i";
|
|
||||||
|
|
||||||
$pattern = $this->getFilenamePatterns($this->Name);
|
$pattern = $this->getFilenamePatterns($this->Name);
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ class CMSSecurity extends Security {
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getLoginMessage() {
|
protected function getLoginMessage(&$messageType = null) {
|
||||||
return parent::getLoginMessage()
|
return parent::getLoginMessage($messageType)
|
||||||
?: _t(
|
?: _t(
|
||||||
'CMSSecurity.LoginMessage',
|
'CMSSecurity.LoginMessage',
|
||||||
'<p>If you have any unsaved work you can return to where you left off by logging back in below.</p>'
|
'<p>If you have any unsaved work you can return to where you left off by logging back in below.</p>'
|
||||||
@ -157,12 +157,12 @@ PHP
|
|||||||
user_error('Passed invalid authentication method', E_USER_ERROR);
|
user_error('Passed invalid authentication method', E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getTemplatesFor($action) {
|
public function getTemplatesFor($action) {
|
||||||
return array("CMSSecurity_{$action}", "CMSSecurity")
|
return array("CMSSecurity_{$action}", "CMSSecurity")
|
||||||
+ parent::getTemplatesFor($action);
|
+ parent::getTemplatesFor($action);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getIncludeTemplate($name) {
|
public function getIncludeTemplate($name) {
|
||||||
return array("CMSSecurity_{$name}")
|
return array("CMSSecurity_{$name}")
|
||||||
+ parent::getIncludeTemplate($name);
|
+ parent::getIncludeTemplate($name);
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ class MemberAuthenticator extends Authenticator {
|
|||||||
if($member && !$asDefaultAdmin) {
|
if($member && !$asDefaultAdmin) {
|
||||||
$result = $member->checkPassword($data['Password']);
|
$result = $member->checkPassword($data['Password']);
|
||||||
$success = $result->valid();
|
$success = $result->valid();
|
||||||
|
} else {
|
||||||
$result = new ValidationResult(false, _t('Member.ERRORWRONGCRED'));
|
$result = new ValidationResult(false, _t('Member.ERRORWRONGCRED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,8 +117,7 @@ class MemberAuthenticator extends Authenticator {
|
|||||||
} else {
|
} else {
|
||||||
// Audit logging hook
|
// Audit logging hook
|
||||||
singleton('Member')->extend('authenticationFailedUnknownUser', $data);
|
singleton('Member')->extend('authenticationFailedUnknownUser', $data);
|
||||||
|
}
|
||||||
$attempt->Email = $userEmail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$attempt->Email = $email;
|
$attempt->Email = $email;
|
||||||
|
@ -450,7 +450,7 @@ class Security extends Controller implements TemplateGlobalProvider {
|
|||||||
* @param string $action
|
* @param string $action
|
||||||
* @return array Template list
|
* @return array Template list
|
||||||
*/
|
*/
|
||||||
protected function getTemplatesFor($action) {
|
public function getTemplatesFor($action) {
|
||||||
return array("Security_{$action}", 'Security', $this->stat('template_main'), 'BlankPage');
|
return array("Security_{$action}", 'Security', $this->stat('template_main'), 'BlankPage');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,8 +535,8 @@ class FormTest extends FunctionalTest {
|
|||||||
$form->Controller()->handleRequest(new SS_HTTPRequest('GET', '/'), DataModel::inst()); // stub out request
|
$form->Controller()->handleRequest(new SS_HTTPRequest('GET', '/'), DataModel::inst()); // stub out request
|
||||||
$form->addErrorMessage('key1', '<em>Escaped HTML</em>', 'good', true);
|
$form->addErrorMessage('key1', '<em>Escaped HTML</em>', 'good', true);
|
||||||
$form->setupFormErrors();
|
$form->setupFormErrors();
|
||||||
$parser = new CSSContentParser($form->forTemplate());
|
$parser = new CSSContentParser($result = $form->forTemplate());
|
||||||
$messageEls = $parser->getBySelector('#key1 .message');
|
$messageEls = $parser->getBySelector('#Form_Form_key1_Holder .message');
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
'<em>Escaped HTML</em>',
|
'<em>Escaped HTML</em>',
|
||||||
$messageEls[0]->asXML()
|
$messageEls[0]->asXML()
|
||||||
@ -547,7 +547,7 @@ class FormTest extends FunctionalTest {
|
|||||||
$form->addErrorMessage('key1', '<em>Unescaped HTML</em>', 'good', false);
|
$form->addErrorMessage('key1', '<em>Unescaped HTML</em>', 'good', false);
|
||||||
$form->setupFormErrors();
|
$form->setupFormErrors();
|
||||||
$parser = new CSSContentParser($form->forTemplate());
|
$parser = new CSSContentParser($form->forTemplate());
|
||||||
$messageEls = $parser->getBySelector('#key1 .message');
|
$messageEls = $parser->getBySelector('#Form_Form_key1_Holder .message');
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
'<em>Unescaped HTML</em>',
|
'<em>Unescaped HTML</em>',
|
||||||
$messageEls[0]->asXML()
|
$messageEls[0]->asXML()
|
||||||
|
@ -124,13 +124,13 @@ class DataListTest extends SapphireTest {
|
|||||||
|
|
||||||
public function testDistinct() {
|
public function testDistinct() {
|
||||||
$list = DataObjectTest_TeamComment::get();
|
$list = DataObjectTest_TeamComment::get();
|
||||||
$this->assertContains('SELECT DISTINCT', $list->dataQuery()->sql(), 'Query is set as distinct by default');
|
$this->assertContains('SELECT DISTINCT', $list->dataQuery()->sql($params), 'Query is set as distinct by default');
|
||||||
|
|
||||||
$list = $list->distinct(false);
|
$list = $list->distinct(false);
|
||||||
$this->assertNotContains('SELECT DISTINCT', $list->dataQuery()->sql(), 'Query does not contain distinct');
|
$this->assertNotContains('SELECT DISTINCT', $list->dataQuery()->sql($params), 'Query does not contain distinct');
|
||||||
|
|
||||||
$list = $list->distinct(true);
|
$list = $list->distinct(true);
|
||||||
$this->assertContains('SELECT DISTINCT', $list->dataQuery()->sql(), 'Query contains distinct');
|
$this->assertContains('SELECT DISTINCT', $list->dataQuery()->sql($params), 'Query contains distinct');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDataClass() {
|
public function testDataClass() {
|
||||||
|
@ -54,7 +54,7 @@ class DataQueryTest extends SapphireTest {
|
|||||||
//apply a relation to a relation from an ancestor class
|
//apply a relation to a relation from an ancestor class
|
||||||
$newDQ->applyRelation('TestA');
|
$newDQ->applyRelation('TestA');
|
||||||
$this->assertTrue($newDQ->query()->isJoinedTo('DataQueryTest_C'));
|
$this->assertTrue($newDQ->query()->isJoinedTo('DataQueryTest_C'));
|
||||||
$this->assertContains('"DataQueryTest_A"."ID" = "DataQueryTest_C"."TestAID"', $newDQ->sql());
|
$this->assertContains('"DataQueryTest_A"."ID" = "DataQueryTest_C"."TestAID"', $newDQ->sql($params));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRelationReturn() {
|
public function testRelationReturn() {
|
||||||
@ -174,13 +174,13 @@ class DataQueryTest extends SapphireTest {
|
|||||||
|
|
||||||
public function testDistinct() {
|
public function testDistinct() {
|
||||||
$query = new DataQuery('DataQueryTest_E');
|
$query = new DataQuery('DataQueryTest_E');
|
||||||
$this->assertContains('SELECT DISTINCT', $query->sql(), 'Query is set as distinct by default');
|
$this->assertContains('SELECT DISTINCT', $query->sql($params), 'Query is set as distinct by default');
|
||||||
|
|
||||||
$query = $query->distinct(false);
|
$query = $query->distinct(false);
|
||||||
$this->assertNotContains('SELECT DISTINCT', $query->sql(), 'Query does not contain distinct');
|
$this->assertNotContains('SELECT DISTINCT', $query->sql($params), 'Query does not contain distinct');
|
||||||
|
|
||||||
$query = $query->distinct(true);
|
$query = $query->distinct(true);
|
||||||
$this->assertContains('SELECT DISTINCT', $query->sql(), 'Query contains distinct');
|
$this->assertContains('SELECT DISTINCT', $query->sql($params), 'Query contains distinct');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testComparisonClauseInt() {
|
public function testComparisonClauseInt() {
|
||||||
|
@ -231,7 +231,7 @@ class ImageTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException PHPUnit_Framework_Error
|
* @expectedException InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testGenerateImageWithInvalidParameters() {
|
public function testGenerateImageWithInvalidParameters() {
|
||||||
$image = $this->objFromFixture('Image', 'imageWithoutTitle');
|
$image = $this->objFromFixture('Image', 'imageWithoutTitle');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user