Merge branch '4.3' into 4.4

This commit is contained in:
Serge Latyntcev 2019-10-18 15:58:13 +13:00
commit 0cf5d4cbe2
5 changed files with 31 additions and 29 deletions

View File

@ -291,18 +291,19 @@ class CoreKernel implements Kernel
// Build error response
$dv = new DebugView();
$body =
$dv->renderHeader() .
$body = implode([
$dv->renderHeader(),
$dv->renderInfo(
"Configuration Error",
Director::absoluteBaseURL()
) .
),
$dv->renderParagraph(
'You need to replace your _ss_environment.php file with a .env file, or with environment variables.<br><br>'
. 'See the <a href="https://docs.silverstripe.org/en/4/getting_started/environment_management/">'
. 'Environment Management</a> docs for more information.'
) .
$dv->renderFooter();
),
$dv->renderFooter()
]);
// Raise error
$response = new HTTPResponse($body, 500);

View File

@ -2112,12 +2112,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
// If we haven't been written yet, we can't save these relations, so use a list that handles this case
if (!$id) {
if (!isset($this->unsavedRelations[$componentName])) {
$this->unsavedRelations[$componentName] =
new UnsavedRelationList(
$manyManyComponent['parentClass'],
$componentName,
$manyManyComponent['childClass']
);
$this->unsavedRelations[$componentName] = new UnsavedRelationList(
$manyManyComponent['parentClass'],
$componentName,
$manyManyComponent['childClass']
);
}
return $this->unsavedRelations[$componentName];
}

View File

@ -268,15 +268,15 @@ class PermissionCheckboxSetField extends FormField
}
}
if ($this->readonly) {
$message = _t(
'SilverStripe\\Security\\Permission.UserPermissionsIntro',
'Assigning groups to this user will adjust the permissions they have.'
. ' See the groups section for details of permissions on individual groups.'
);
return
"<ul id=\"{$this->ID()}\" class=\"optionset checkboxsetfield{$this->extraClass()}\">\n" .
"<li class=\"help\">" .
_t(
'SilverStripe\\Security\\Permission.UserPermissionsIntro',
'Assigning groups to this user will adjust the permissions they have.'
. ' See the groups section for details of permissions on individual groups.'
) .
"</li>" .
"<li class=\"help\">" . $message . "</li>" .
$options .
"</ul>\n";
} else {

View File

@ -42,13 +42,17 @@ if (!defined('BASE_PATH')) {
define('BASE_PATH', call_user_func(function () {
// Determine BASE_PATH based on the composer autoloader
foreach (debug_backtrace() as $backtraceItem) {
if (isset($backtraceItem['file'])
&& preg_match(
'#^(?<base>.*)(/|\\\\)vendor(/|\\\\)composer(/|\\\\)autoload_real.php#',
$backtraceItem['file'],
$matches
)
) {
if (!isset($backtraceItem['file'])) {
continue;
}
$matched = preg_match(
'#^(?<base>.*)(/|\\\\)vendor(/|\\\\)composer(/|\\\\)autoload_real.php#',
$backtraceItem['file'],
$matches
);
if ($matched) {
return realpath($matches['base']) ?: DIRECTORY_SEPARATOR;
}
}

View File

@ -1061,11 +1061,9 @@ class DataListTest extends SapphireTest
->leftJoin(
'DataObjectTest_Team',
'"DataObjectTest_Team"."ID" = "DataObjectTest_TeamComment"."TeamID"'
)->filter(
array(
)->filter([
'Title' => 'Team 1'
)
);
]);
$this->assertEquals(2, $list->count());
$values = $list->column('Name');