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);
|
||||
}
|
||||
}
|
||||
$pattern = "/^(({$generateFuncs}).*\-)+" . preg_quote($this->Name) . "$/i";
|
||||
|
||||
$pattern = $this->getFilenamePatterns($this->Name);
|
||||
|
||||
|
@ -52,8 +52,8 @@ class CMSSecurity extends Security {
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function getLoginMessage() {
|
||||
return parent::getLoginMessage()
|
||||
protected function getLoginMessage(&$messageType = null) {
|
||||
return parent::getLoginMessage($messageType)
|
||||
?: _t(
|
||||
'CMSSecurity.LoginMessage',
|
||||
'<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);
|
||||
}
|
||||
|
||||
protected function getTemplatesFor($action) {
|
||||
public function getTemplatesFor($action) {
|
||||
return array("CMSSecurity_{$action}", "CMSSecurity")
|
||||
+ parent::getTemplatesFor($action);
|
||||
}
|
||||
|
||||
protected function getIncludeTemplate($name) {
|
||||
public function getIncludeTemplate($name) {
|
||||
return array("CMSSecurity_{$name}")
|
||||
+ parent::getIncludeTemplate($name);
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ class MemberAuthenticator extends Authenticator {
|
||||
if($member && !$asDefaultAdmin) {
|
||||
$result = $member->checkPassword($data['Password']);
|
||||
$success = $result->valid();
|
||||
} else {
|
||||
$result = new ValidationResult(false, _t('Member.ERRORWRONGCRED'));
|
||||
}
|
||||
|
||||
@ -116,8 +117,7 @@ class MemberAuthenticator extends Authenticator {
|
||||
} else {
|
||||
// Audit logging hook
|
||||
singleton('Member')->extend('authenticationFailedUnknownUser', $data);
|
||||
|
||||
$attempt->Email = $userEmail;
|
||||
}
|
||||
}
|
||||
|
||||
$attempt->Email = $email;
|
||||
|
@ -450,7 +450,7 @@ class Security extends Controller implements TemplateGlobalProvider {
|
||||
* @param string $action
|
||||
* @return array Template list
|
||||
*/
|
||||
protected function getTemplatesFor($action) {
|
||||
public function getTemplatesFor($action) {
|
||||
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->addErrorMessage('key1', '<em>Escaped HTML</em>', 'good', true);
|
||||
$form->setupFormErrors();
|
||||
$parser = new CSSContentParser($form->forTemplate());
|
||||
$messageEls = $parser->getBySelector('#key1 .message');
|
||||
$parser = new CSSContentParser($result = $form->forTemplate());
|
||||
$messageEls = $parser->getBySelector('#Form_Form_key1_Holder .message');
|
||||
$this->assertContains(
|
||||
'<em>Escaped HTML</em>',
|
||||
$messageEls[0]->asXML()
|
||||
@ -547,7 +547,7 @@ class FormTest extends FunctionalTest {
|
||||
$form->addErrorMessage('key1', '<em>Unescaped HTML</em>', 'good', false);
|
||||
$form->setupFormErrors();
|
||||
$parser = new CSSContentParser($form->forTemplate());
|
||||
$messageEls = $parser->getBySelector('#key1 .message');
|
||||
$messageEls = $parser->getBySelector('#Form_Form_key1_Holder .message');
|
||||
$this->assertContains(
|
||||
'<em>Unescaped HTML</em>',
|
||||
$messageEls[0]->asXML()
|
||||
|
@ -124,13 +124,13 @@ class DataListTest extends SapphireTest {
|
||||
|
||||
public function testDistinct() {
|
||||
$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);
|
||||
$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);
|
||||
$this->assertContains('SELECT DISTINCT', $list->dataQuery()->sql(), 'Query contains distinct');
|
||||
$this->assertContains('SELECT DISTINCT', $list->dataQuery()->sql($params), 'Query contains distinct');
|
||||
}
|
||||
|
||||
public function testDataClass() {
|
||||
|
@ -54,7 +54,7 @@ class DataQueryTest extends SapphireTest {
|
||||
//apply a relation to a relation from an ancestor class
|
||||
$newDQ->applyRelation('TestA');
|
||||
$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() {
|
||||
@ -174,13 +174,13 @@ class DataQueryTest extends SapphireTest {
|
||||
|
||||
public function testDistinct() {
|
||||
$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);
|
||||
$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);
|
||||
$this->assertContains('SELECT DISTINCT', $query->sql(), 'Query contains distinct');
|
||||
$this->assertContains('SELECT DISTINCT', $query->sql($params), 'Query contains distinct');
|
||||
}
|
||||
|
||||
public function testComparisonClauseInt() {
|
||||
|
@ -231,7 +231,7 @@ class ImageTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_Error
|
||||
* @expectedException InvalidArgumentException
|
||||
*/
|
||||
public function testGenerateImageWithInvalidParameters() {
|
||||
$image = $this->objFromFixture('Image', 'imageWithoutTitle');
|
||||
|
Loading…
x
Reference in New Issue
Block a user