Skip to content

Commit

Permalink
Backdrop 1.26.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shelane authored Oct 3, 2023
1 parent 7837af5 commit 796f90e
Show file tree
Hide file tree
Showing 509 changed files with 3,297 additions and 1,341 deletions.
3 changes: 2 additions & 1 deletion docroot/core/includes/anonymous.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* use of the AnonymousUser class in places where different kinds of users are
* listed together.
*/
class AnonymousUser implements UserInterface {
class AnonymousUser extends stdClass implements UserInterface {

public $uid = 0;
public $name = NULL;
public $hostname = NULL;
Expand Down
2 changes: 1 addition & 1 deletion docroot/core/includes/bootstrap.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* The current system version.
*/
define('BACKDROP_VERSION', '1.25.1');
define('BACKDROP_VERSION', '1.26.0');

/**
* Core API compatibility.
Expand Down
13 changes: 0 additions & 13 deletions docroot/core/includes/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3044,19 +3044,6 @@ function backdrop_deliver_html_page($page_callback_result) {
backdrop_add_http_header('X-Frame-Options', $frame_options);
}

if ($site_config->get('block_interest_cohort')) {
$permissions_policy = backdrop_get_http_header('Permissions-Policy');
if (is_null($permissions_policy)) {
backdrop_add_http_header('Permissions-Policy', 'interest-cohort=()');
}
else {
// Only add interest-cohort if the header does not contain it already.
if (strpos($permissions_policy, 'interest-cohort') === FALSE) {
backdrop_add_http_header('Permissions-Policy', 'interest-cohort=()', TRUE);
}
}
}

// Menu status constants are integers; page content is a string or array.
if (is_int($page_callback_result)) {
// @todo: Break these up into separate functions?
Expand Down
48 changes: 35 additions & 13 deletions docroot/core/includes/config.inc
Original file line number Diff line number Diff line change
Expand Up @@ -270,19 +270,27 @@ function config_load_multiple($names, $type = 'active') {
}

/**
* Moves the default config supplied by a module to the live config directory.
* Moves the default config supplied by a project to the live config directory.
*
* @param string $module
* The name of the module we are installing.
* @param string $project
* The name of the project we are installing.
* @param string|NULL $config_name
* (optional) If wanting to copy just a single configuration file from the
* module, specify the configuration file name without the extension.
* project, specify the configuration file name without the extension.
*
* @since 1.26.0 First parameter changed from $module to $project.
*/
function config_install_default_config($module, $config_name = NULL) {
$module_config_dir = backdrop_get_path('module', $module) . '/config';
if (is_dir($module_config_dir)) {
$storage = new ConfigFileStorage($module_config_dir);
$files = glob($module_config_dir . '/*.json');
function config_install_default_config($project, $config_name = NULL) {
$project_path = NULL;
foreach (array('module', 'theme') as $project_type) {
if ($project_path = backdrop_get_path($project_type, $project)) {
break;
}
}
$project_config_dir = $project_path . '/config';
if (is_dir($project_config_dir)) {
$storage = new ConfigFileStorage($project_config_dir);
$files = glob($project_config_dir . '/*.json');
foreach ($files as $file) {
// Load config data into the active store and write it out to the
// file system in the Backdrop config directory. Note the config name
Expand All @@ -305,11 +313,25 @@ function config_install_default_config($module, $config_name = NULL) {
}

/**
* Uninstall all the configuration provided by a module.
* Uninstall all the configuration provided by a project.
*
* @param string $project
* The name of the project we are uninstalling.
* @param string|NULL $config_name
* (optional) If wanting to remove just a single configuration file from the
* project, specify the configuration file name without the extension.
*
* @since 1.26.0 First parameter changed from $module to $project.
*/
function config_uninstall_config($module, $config_name = NULL) {
backdrop_load('module', $module);
if ($configs = module_invoke($module, 'config_info')) {
function config_uninstall_config($project, $config_name = NULL) {
// If this is a theme key, load the matching template.php file.
if (!backdrop_load('module', $project) && $theme_path = backdrop_get_path('theme', $project)) {
if (file_exists($theme_path . '/template.php')) {
include_once $theme_path . '/template.php';
}
}

if ($configs = module_invoke($project, 'config_info')) {
foreach ($configs as $config_name => $config_info) {
if (isset($config_info['name_key'])) {
$sub_names = config_get_names_with_prefix($config_name . '.');
Expand Down
6 changes: 3 additions & 3 deletions docroot/core/includes/database/database.inc
Original file line number Diff line number Diff line change
Expand Up @@ -737,12 +737,12 @@ abstract class DatabaseConnection {
if ($options['throw_exception']) {
// Add additional debug information.
if ($query instanceof DatabaseStatementInterface) {
$e->query_string = $stmt->getQueryString();
$e->errorInfo['query_string'] = $stmt->getQueryString();
}
else {
$e->query_string = $query;
$e->errorInfo['query_string'] = $query;
}
$e->args = $args;
$e->errorInfo['args'] = $args;
throw $e;
}
return NULL;
Expand Down
7 changes: 7 additions & 0 deletions docroot/core/includes/database/query.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,13 @@ class MergeQuery extends Query implements QueryConditionInterface {
*/
protected $table;

/**
* The condition object for this query.
*
* @var DatabaseCondition
*/
protected $condition;

/**
* An array of fields on which to insert.
*
Expand Down
18 changes: 18 additions & 0 deletions docroot/core/includes/date.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@
class BackdropDateTime extends DateTime {
public $granularity = array();
public $errors = array();

/**
* @var bool
*/
public $dateOnly;

/**
* @var bool
*/
public $timeOnly;

/**
* Date string, timestamp or indexed date array.
*
* @var string|int|array
*/
public $originalTime;

protected static $allgranularity = array(
'year',
'month',
Expand Down
4 changes: 2 additions & 2 deletions docroot/core/includes/errors.inc
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ function _backdrop_decode_exception($exception) {
// We remove that call.
array_shift($backtrace);
}
if (isset($exception->query_string, $exception->args)) {
$message .= ": " . $exception->query_string . "; " . print_r($exception->args, TRUE);
if (isset($exception->errorInfo['query_string'], $exception->errorInfo['args'])) {
$message .= ": " . $exception->errorInfo['query_string'] . "; " . print_r($exception->errorInfo['args'], TRUE);
}
}
$caller = _backdrop_get_last_caller($backtrace);
Expand Down
10 changes: 10 additions & 0 deletions docroot/core/includes/filetransfer/filetransfer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ abstract class FileTransfer {
protected $hostname = 'localhost';
protected $port;

/**
* @var string
*/
protected $jail;

/**
* @var string
*/
protected $chroot;

/**
* The constructor for the UpdateConnection class. This method is also called
* from the classes that extend this class and override this method.
Expand Down
6 changes: 4 additions & 2 deletions docroot/core/includes/form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3023,7 +3023,7 @@ function form_process_password_confirm($element) {
'#title' => t('New password'),
'#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'],
'#required' => $element['#required'],
'#attributes' => array('class' => array('password-field')),
'#attributes' => $element['#attributes'] + array('class' => array('password-field')),
'#password_strength' => TRUE,
'#password_shown' => FALSE,
'#password_toggle' => FALSE,
Expand All @@ -3033,7 +3033,7 @@ function form_process_password_confirm($element) {
'#title' => t('Confirm new password'),
'#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'],
'#required' => $element['#required'],
'#attributes' => array('class' => array('password-confirm')),
'#attributes' => $element['#attributes'] + array('class' => array('password-confirm')),
'#password_strength' => FALSE,
'#password_shown' => FALSE,
'#password_toggle' => FALSE,
Expand Down Expand Up @@ -4750,6 +4750,8 @@ function theme_textarea($variables) {
function theme_password($variables) {
$element = $variables['element'];
$element['#attributes']['type'] = 'password';
$element['#attributes']['spellcheck'] = !empty($element['#attributes']['spellcheck']) ? $element['#attributes']['spellcheck'] : 'false';

element_set_attributes($element, array('id', 'name', 'size', 'maxlength', 'placeholder'));
_form_set_class($element, array('form-text'));

Expand Down
3 changes: 1 addition & 2 deletions docroot/core/includes/session.inc
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ function backdrop_session_regenerate() {
global $user, $is_https;
// Nothing to do if we are not allowed to change the session.
if (!backdrop_save_session()) {
return TRUE;
return;
}

if ($is_https && settings_get('https', FALSE)) {
Expand Down Expand Up @@ -421,7 +421,6 @@ function backdrop_session_regenerate() {
$user = $account;
}
date_default_timezone_set(backdrop_get_user_timezone());
return TRUE;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions docroot/core/includes/theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,9 @@ function theme_get_setting($setting_name, $theme = NULL) {
* TRUE if the theme has settings, FALSE otherwise.
*/
function theme_has_settings($theme) {
if (config_get_names_with_prefix($theme . '.settings')) {
return TRUE;
}
$themes = list_themes();
$theme_info = $themes[$theme];
if (!empty($theme_info->info['settings'])) {
Expand Down Expand Up @@ -1643,6 +1646,9 @@ function theme_enable($theme_list) {
->condition('type', 'theme')
->condition('name', $key)
->execute();

// Copy any default configuration data to the system config directory.
config_install_default_config($key);
}

list_themes(TRUE);
Expand Down Expand Up @@ -1676,6 +1682,8 @@ function theme_disable($theme_list) {
->condition('type', 'theme')
->condition('name', $key)
->execute();

config_uninstall_config($key);
}

list_themes(TRUE);
Expand Down
10 changes: 10 additions & 0 deletions docroot/core/includes/updater.inc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ abstract class Updater implements BackdropUpdaterInterface {
*/
public $source;

/**
* @var string
*/
protected $name;

/**
* @var string
*/
protected $title;

public function __construct($source) {
$this->source = $source;
$this->name = self::getProjectName($source);
Expand Down
6 changes: 3 additions & 3 deletions docroot/core/layouts/boxton/boxton.info
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ preview = boxton.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
6 changes: 3 additions & 3 deletions docroot/core/layouts/geary/geary.info
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ preview = geary.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
6 changes: 3 additions & 3 deletions docroot/core/layouts/harris/harris.info
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ preview = harris.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
6 changes: 3 additions & 3 deletions docroot/core/layouts/legacy/one_column/one_column.info
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ regions[footer] = Footer
; Modify this line if you would like to change the default in this layout.
default region = content

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ regions[footer] = Footer bottom
; Modify this line if you would like to change the default in this layout.
default region = content

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
6 changes: 3 additions & 3 deletions docroot/core/layouts/legacy/two_column/two_column.info
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ regions[footer] = Footer
; Modify this line if you would like to change the default in this layout.
default region = content

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ regions[footer] = Footer
; Modify this line if you would like to change the default in this layout.
default region = content

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
6 changes: 3 additions & 3 deletions docroot/core/layouts/moscone/moscone.info
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ preview = moscone.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
6 changes: 3 additions & 3 deletions docroot/core/layouts/moscone_flipped/moscone_flipped.info
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ preview = moscone-flipped.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
6 changes: 3 additions & 3 deletions docroot/core/layouts/rolph/rolph.info
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ preview = rolph.png
; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
6 changes: 3 additions & 3 deletions docroot/core/layouts/simmons/simmons.info
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ file = simmons.php
; Default stylesheets for this layout
; stylesheets[all][] = simmons.css

; Added by Backdrop CMS packaging script on 2023-06-07
; Added by Backdrop CMS packaging script on 2023-09-15
project = backdrop
version = 1.25.1
timestamp = 1686169096
version = 1.26.0
timestamp = 1694823391
Loading

0 comments on commit 796f90e

Please sign in to comment.