From 4719f94cecd8a3f585c9ca1c75336aa109849844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Fri, 28 Apr 2017 22:41:07 +0200 Subject: [ticket/15201] Remove wrong user style check PHPBB3-15201 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index 2c7b7edf2e..dcf031a7a7 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -165,7 +165,7 @@ class style_update_p1 extends \phpbb\db\migration\migration $this->config->set('default_style', $default_style); - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0'; + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . $default_style; $this->sql_query($sql); } else @@ -183,9 +183,9 @@ class style_update_p1 extends \phpbb\db\migration\migration } // Reset styles for users - $this->sql_query('UPDATE ' . USERS_TABLE . ' - SET user_style = 0 - WHERE ' . $this->db->sql_in_set('user_style', $valid_styles, true)); + $this->sql_query('UPDATE ' . USERS_TABLE . " + SET user_style = '" . $valid_styles[0] . "' + WHERE " . $this->db->sql_in_set('user_style', $valid_styles, true)); } } } -- cgit v1.2.1 From 13b0f399612bf3c3f6ce04bda46429dab572e590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 29 Apr 2017 09:47:48 +0200 Subject: [ticket/15201] Migration to fix current invalid styles PHPBB3-15201 --- .../db/migration/data/v32x/fix_user_styles.php | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php new file mode 100644 index 0000000000..e0caae812a --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php @@ -0,0 +1,50 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class fix_user_styles extends \phpbb\db\migration\migration +{ + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'styles_fix'))), + ); + } + + public function styles_fix() + { + $default_style = (int) $this->config['default_style']; + + // Get enabled styles + $sql = 'SELECT style_id + FROM ' . STYLES_TABLE . ' + WHERE style_active = 1'; + $result = $this->db->sql_query($sql); + $enabled_styles = $result->fetch_array(); + $this->db->sql_freeresult($result); + + // Set the default style to users who have an invalid style + $this->sql_query('UPDATE ' . USERS_TABLE . " + SET user_style = $default_style + WHERE " . $this->db->sql_in_set('user_style', $enabled_styles, true)); + } +} -- cgit v1.2.1 From 4b1ec6abb7b2d2daa320ac5e2872e055bc5b07d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Fri, 8 Sep 2017 10:59:47 +0200 Subject: [ticket/15201] Fix tests PHPBB3-15201 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index dcf031a7a7..3e28e8747d 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -160,7 +160,7 @@ class style_update_p1 extends \phpbb\db\migration\migration FROM ' . STYLES_TABLE . " WHERE style_name = 'prosilver'"; $result = $this->sql_query($sql); - $default_style = $this->db->sql_fetchfield('style_id'); + $default_style = (int) $this->db->sql_fetchfield('style_id'); $this->db->sql_freeresult($result); $this->config->set('default_style', $default_style); @@ -184,7 +184,7 @@ class style_update_p1 extends \phpbb\db\migration\migration // Reset styles for users $this->sql_query('UPDATE ' . USERS_TABLE . " - SET user_style = '" . $valid_styles[0] . "' + SET user_style = '" . (int) $valid_styles[0] . "' WHERE " . $this->db->sql_in_set('user_style', $valid_styles, true)); } } -- cgit v1.2.1 From bace8dd31f0a5c2f95ae612e7e1b2e6d3083613b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Fri, 8 Sep 2017 15:02:29 +0200 Subject: [ticket/15201] Add casting PHPBB3-15201 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 2 +- phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index 3e28e8747d..f50ab33830 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -165,7 +165,7 @@ class style_update_p1 extends \phpbb\db\migration\migration $this->config->set('default_style', $default_style); - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . $default_style; + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . (int) $default_style; $this->sql_query($sql); } else diff --git a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php index e0caae812a..282c6bef2f 100644 --- a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php +++ b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php @@ -43,8 +43,8 @@ class fix_user_styles extends \phpbb\db\migration\migration $this->db->sql_freeresult($result); // Set the default style to users who have an invalid style - $this->sql_query('UPDATE ' . USERS_TABLE . " - SET user_style = $default_style - WHERE " . $this->db->sql_in_set('user_style', $enabled_styles, true)); + $this->sql_query('UPDATE ' . USERS_TABLE . ' + SET user_style = ' . (int) $default_style . ' + WHERE ' . $this->db->sql_in_set('user_style', $enabled_styles, true)); } } -- cgit v1.2.1 From 2592d597652242cc5e1299e3dcde53d31f35c4f1 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 22 Sep 2017 14:34:38 +0200 Subject: [ticket/15339] Use manual method when adding modules This will fix cases where the module is deleted in later versions and the migrator thus cannot retrieve the info. PHPBB3-15339 --- .../db/migration/data/v30x/release_3_0_6_rc1.php | 41 +++++++++++++++++++--- .../db/migration/data/v30x/release_3_0_8_rc1.php | 4 ++- .../db/migration/data/v310/auth_provider_oauth.php | 4 ++- .../data/v310/contact_admin_acp_module.php | 4 ++- phpBB/phpbb/db/migration/data/v310/dev.php | 25 ++++++++++--- phpBB/phpbb/db/migration/data/v310/extensions.php | 4 ++- .../phpbb/db/migration/data/v310/notifications.php | 7 ++-- .../migration/data/v310/softdelete_mcp_modules.php | 8 +++-- .../db/migration/data/v320/add_help_phpbb.php | 4 ++- 9 files changed, 83 insertions(+), 18 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php index faef68121d..08b8979e00 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php @@ -153,7 +153,9 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'ACP_BOARD_CONFIGURATION', array( 'module_basename' => 'acp_board', - 'modes' => array('feed'), + 'module_langname' => 'ACP_FEED_SETTINGS', + 'module_mode' => 'feed', + 'module_auth' => 'acl_a_board', ), )), array('module.add', array( @@ -161,7 +163,10 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'ACP_CAT_USERS', array( 'module_basename' => 'acp_users', - 'modes' => array('warnings'), + 'module_langname' => 'ACP_USER_WARNINGS', + 'module_mode' => 'warnings', + 'module_auth' => 'acl_a_user', + 'module_display' => false, ), )), array('module.add', array( @@ -169,7 +174,9 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'ACP_SERVER_CONFIGURATION', array( 'module_basename' => 'acp_send_statistics', - 'modes' => array('send_statistics'), + 'module_langname' => 'ACP_SEND_STATISTICS', + 'module_mode' => 'send_statistics', + 'module_auth' => 'acl_a_server', ), )), array('module.add', array( @@ -177,7 +184,9 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'ACP_FORUM_BASED_PERMISSIONS', array( 'module_basename' => 'acp_permissions', - 'modes' => array('setting_forum_copy'), + 'module_langname' => 'ACP_FORUM_PERMISSIONS_COPY', + 'module_mode' => 'setting_forum_copy', + 'module_auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', ), )), array('module.add', array( @@ -185,7 +194,29 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'MCP_REPORTS', array( 'module_basename' => 'mcp_pm_reports', - 'modes' => array('pm_reports','pm_reports_closed','pm_report_details'), + 'module_langname' => 'MCP_PM_REPORTS_OPEN', + 'module_mode' => 'pm_reports', + 'module_auth' => 'acl_m_pm_report', + ), + )), + array('module.add', array( + 'mcp', + 'MCP_REPORTS', + array( + 'module_basename' => 'mcp_pm_reports', + 'module_langname' => 'MCP_PM_REPORTS_CLOSED', + 'module_mode' => 'pm_reports_closed', + 'module_auth' => 'acl_m_pm_report', + ), + )), + array('module.add', array( + 'mcp', + 'MCP_REPORTS', + array( + 'module_basename' => 'mcp_pm_reports', + 'module_langname' => 'MCP_PM_REPORT_DETAILS', + 'module_mode' => 'pm_report_details', + 'module_auth' => 'acl_m_pm_report', ), )), array('custom', array(array(&$this, 'add_newly_registered_group'))), diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php index 22fd51543b..0190eeb1af 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -36,7 +36,9 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration 'ACP_MESSAGES', array( 'module_basename' => 'acp_board', - 'modes' => array('post'), + 'module_langname' => 'ACP_POST_SETTINGS', + 'module_mode' => 'post', + 'module_auth' => 'acl_a_board', ), )), array('config.add', array('load_unreads_search', 1)), diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php index 2d51bd53e4..508a31fba9 100644 --- a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php +++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php @@ -69,7 +69,9 @@ class auth_provider_oauth extends \phpbb\db\migration\migration 'UCP_PROFILE', array( 'module_basename' => 'ucp_auth_link', - 'modes' => array('auth_link'), + 'module_langname' => 'UCP_AUTH_LINK_MANAGE', + 'module_mode' => 'auth_link', + 'module_auth' => 'authmethod_oauth', ), )), ); diff --git a/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php b/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php index 20bd547ac3..e48a9a1d3d 100644 --- a/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php +++ b/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php @@ -23,7 +23,9 @@ class contact_admin_acp_module extends \phpbb\db\migration\migration 'ACP_BOARD_CONFIGURATION', array( 'module_basename' => 'acp_contact', - 'modes' => array('contact'), + 'module_langname' => 'ACP_CONTACT_SETTINGS', + 'module_mode' => 'contact', + 'module_auth' => 'acl_a_board', ), )), ); diff --git a/phpBB/phpbb/db/migration/data/v310/dev.php b/phpBB/phpbb/db/migration/data/v310/dev.php index 250258eea7..9cc953ad8d 100644 --- a/phpBB/phpbb/db/migration/data/v310/dev.php +++ b/phpBB/phpbb/db/migration/data/v310/dev.php @@ -125,7 +125,9 @@ class dev extends \phpbb\db\migration\container_aware_migration 'ACP_GROUPS', array( 'module_basename' => 'acp_groups', - 'modes' => array('position'), + 'module_langname' => 'ACP_GROUPS_POSITION', + 'module_mode' => 'position', + 'module_auth' => 'acl_a_group', ), )), array('module.add', array( @@ -133,7 +135,9 @@ class dev extends \phpbb\db\migration\container_aware_migration 'ACP_ATTACHMENTS', array( 'module_basename' => 'acp_attachments', - 'modes' => array('manage'), + 'module_langname' => 'ACP_MANAGE_ATTACHMENTS', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_attach', ), )), array('module.add', array( @@ -141,7 +145,19 @@ class dev extends \phpbb\db\migration\container_aware_migration 'ACP_STYLE_MANAGEMENT', array( 'module_basename' => 'acp_styles', - 'modes' => array('install', 'cache'), + 'module_langname' => 'ACP_STYLES_INSTALL', + 'module_mode' => 'install', + 'module_auth' => 'acl_a_styles', + ), + )), + array('module.add', array( + 'acp', + 'ACP_STYLE_MANAGEMENT', + array( + 'module_basename' => 'acp_styles', + 'module_langname' => 'ACP_STYLES_CACHE', + 'module_mode' => 'cache', + 'module_auth' => 'acl_a_styles', ), )), array('module.add', array( @@ -149,7 +165,8 @@ class dev extends \phpbb\db\migration\container_aware_migration 'UCP_PROFILE', array( 'module_basename' => 'ucp_profile', - 'modes' => array('autologin_keys'), + 'module_langname' => 'UCP_PROFILE_AUTOLOGIN_KEYS', + 'module_mode' => 'autologin_keys', ), )), // Module will be renamed later diff --git a/phpBB/phpbb/db/migration/data/v310/extensions.php b/phpBB/phpbb/db/migration/data/v310/extensions.php index 3171435482..2e7c5c5316 100644 --- a/phpBB/phpbb/db/migration/data/v310/extensions.php +++ b/phpBB/phpbb/db/migration/data/v310/extensions.php @@ -66,7 +66,9 @@ class extensions extends \phpbb\db\migration\migration 'ACP_EXTENSION_MANAGEMENT', array( 'module_basename' => 'acp_extensions', - 'modes' => array('main'), + 'module_langname' => 'ACP_EXTENSIONS', + 'module_mode' => 'main', + 'module_auth' => 'acl_a_extensions', ), )), array('permission.add', array('a_extensions', true, 'a_styles')), diff --git a/phpBB/phpbb/db/migration/data/v310/notifications.php b/phpBB/phpbb/db/migration/data/v310/notifications.php index f4d012b5ac..789aaa3ba9 100644 --- a/phpBB/phpbb/db/migration/data/v310/notifications.php +++ b/phpBB/phpbb/db/migration/data/v310/notifications.php @@ -85,7 +85,9 @@ class notifications extends \phpbb\db\migration\migration 'UCP_MAIN', array( 'module_basename' => 'ucp_notifications', - 'modes' => array('notification_list'), + 'module_langname' => 'UCP_NOTIFICATION_LIST', + 'module_mode' => 'notification_list', + 'module_auth' => 'cfg_allow_board_notifications', ), )), array('module.add', array( @@ -93,7 +95,8 @@ class notifications extends \phpbb\db\migration\migration 'UCP_PREFS', array( 'module_basename' => 'ucp_notifications', - 'modes' => array('notification_options'), + 'module_langname' => 'UCP_NOTIFICATION_OPTIONS', + 'module_mode' => 'notification_options', ), )), array('config.add', array('load_notifications', 1)), diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php b/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php index 5e68db5889..90dab991e1 100644 --- a/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php +++ b/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php @@ -45,7 +45,9 @@ class softdelete_mcp_modules extends \phpbb\db\migration\migration 'MCP_QUEUE', array( 'module_basename' => 'mcp_queue', - 'modes' => array('deleted_topics'), + 'module_langname' => 'MCP_QUEUE_DELETED_TOPICS', + 'module_mode' => 'deleted_topics', + 'module_auth' => 'aclf_m_approve', ), )), array('module.add', array( @@ -53,7 +55,9 @@ class softdelete_mcp_modules extends \phpbb\db\migration\migration 'MCP_QUEUE', array( 'module_basename' => 'mcp_queue', - 'modes' => array('deleted_posts'), + 'module_langname' => 'MCP_QUEUE_DELETED_POSTS', + 'module_mode' => 'deleted_posts', + 'module_auth' => 'aclf_m_approve', ), )), ); diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php index 8fadb4bde4..a52067f484 100644 --- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -41,7 +41,9 @@ class add_help_phpbb extends \phpbb\db\migration\migration 'ACP_SERVER_CONFIGURATION', array( 'module_basename' => 'acp_help_phpbb', - 'modes' => array('help_phpbb'), + 'module_langname' => 'ACP_HELP_PHPBB', + 'module_mode' => 'help_phpbb', + 'module_auth' => 'acl_a_server', ), )), ); -- cgit v1.2.1 From e55480385b5c7d49030d3f380bf2c1349695033b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Sun, 24 Sep 2017 21:32:53 -0400 Subject: [ticket/15372] Migration for adding f_list_topic permission --- .../data/v32x/f_list_topics_permission_add.php | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php new file mode 100644 index 0000000000..175c27da03 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php @@ -0,0 +1,38 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class f_list_topics_permission_add extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321', + ); + } + + public function update_data() + { + return array( + array('permission.add', array('f_list_topics', false)), + ); + } + + public function revert_data() + { + return array( + array('permission.remove', array('f_list_topics', false)), + ); + } +} -- cgit v1.2.1 From 4ae7cb89ff55902ab50393e1f7aa81b4b055f511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Sun, 24 Sep 2017 22:48:51 -0400 Subject: [ticket/15372] Remove revert_data from migration --- .../phpbb/db/migration/data/v32x/f_list_topics_permission_add.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php index 175c27da03..e4b77d0f0f 100644 --- a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php +++ b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php @@ -28,11 +28,4 @@ class f_list_topics_permission_add extends \phpbb\db\migration\migration array('permission.add', array('f_list_topics', false)), ); } - - public function revert_data() - { - return array( - array('permission.remove', array('f_list_topics', false)), - ); - } } -- cgit v1.2.1 From 33ceceda021160b73fe9d7333e9e950308da5569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Thu, 26 Oct 2017 16:21:50 -0400 Subject: [ticket/15372] Add permission to schema and copy from f_read --- phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php index e4b77d0f0f..49727e5a62 100644 --- a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php +++ b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php @@ -25,7 +25,7 @@ class f_list_topics_permission_add extends \phpbb\db\migration\migration public function update_data() { return array( - array('permission.add', array('f_list_topics', false)), + array('permission.add', array('f_list_topics', false, 'f_read')), ); } } -- cgit v1.2.1 From 4bf0f4a50f34e00fb80299119f98c23ee426dc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Tue, 31 Oct 2017 14:37:36 +0100 Subject: [ticket/15171] Add migration PHPBB3-15171 --- .../data/v32x/update_prosilver_bitfield.php | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/update_prosilver_bitfield.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/update_prosilver_bitfield.php b/phpBB/phpbb/db/migration/data/v32x/update_prosilver_bitfield.php new file mode 100644 index 0000000000..6e51a01834 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/update_prosilver_bitfield.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class update_prosilver_bitfield extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_bbcode_bitfield'))), + ); + } + + public function update_bbcode_bitfield() + { + $sql = 'UPDATE ' . STYLES_TABLE . " + SET bbcode_bitfield = '//g=' + WHERE style_path = 'prosilver'"; + $this->sql_query($sql); + } +} -- cgit v1.2.1 From aa961991fdafc8a0371d22c7e42f2424ee1b8898 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 17 Nov 2017 01:29:38 +0100 Subject: [ticket/15339] Allow a module to have multiple parents Also restore old behaviour from Olympus regarding re-sorting modules PHPBB3-15339 --- .../db/migration/data/v30x/release_3_0_6_rc1.php | 3 + .../db/migration/data/v30x/release_3_0_8_rc1.php | 1 + phpBB/phpbb/db/migration/tool/module.php | 255 +++++++++++---------- 3 files changed, 136 insertions(+), 123 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php index 08b8979e00..40bb58c10d 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php @@ -156,6 +156,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'module_langname' => 'ACP_FEED_SETTINGS', 'module_mode' => 'feed', 'module_auth' => 'acl_a_board', + 'after' => array('signature', 'ACP_SIGNATURE_SETTINGS'), ), )), array('module.add', array( @@ -167,6 +168,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'module_mode' => 'warnings', 'module_auth' => 'acl_a_user', 'module_display' => false, + 'after' => array('feedback', 'ACP_USER_FEEDBACK'), ), )), array('module.add', array( @@ -187,6 +189,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'module_langname' => 'ACP_FORUM_PERMISSIONS_COPY', 'module_mode' => 'setting_forum_copy', 'module_auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', + 'after' => array('setting_forum_local', 'ACP_FORUM_PERMISSIONS'), ), )), array('module.add', array( diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php index 0190eeb1af..c018adab46 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -39,6 +39,7 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration 'module_langname' => 'ACP_POST_SETTINGS', 'module_mode' => 'post', 'module_auth' => 'acl_a_board', + 'after' => array('message', 'ACP_MESSAGE_SETTINGS'), ), )), array('config.add', array('load_unreads_search', 1)), diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index b47c426110..3b4728c9d7 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -84,9 +84,11 @@ class module implements \phpbb\db\migration\tool\tool_interface * Use false to ignore the parent check and check class wide. * @param int|string $module The module_id|module_langname you would like to * check for to see if it exists - * @return bool true/false if module exists + * @param bool $lazy Checks lazily if the module exists. Returns true if it exists in at + * least one given parent. + * @return bool true if module exists in *all* given parents, false if not */ - public function exists($class, $parent, $module) + public function exists($class, $parent, $module, $lazy = false) { // the main root directory should return true if (!$module) @@ -94,33 +96,44 @@ class module implements \phpbb\db\migration\tool\tool_interface return true; } - $parent_sql = ''; + $parent_sqls = []; if ($parent !== false) { - $parent = $this->get_parent_module_id($parent, $module, false); - if ($parent === false) + $parents = $this->get_parent_module_id($parent, $module, false); + if ($parents === false) { return false; } - $parent_sql = 'AND parent_id = ' . (int) $parent; + foreach ((array) $parents as $parent_id) + { + $parent_sqls[] = 'AND parent_id = ' . (int) $parent_id; + } } - $sql = 'SELECT module_id - FROM ' . $this->modules_table . " - WHERE module_class = '" . $this->db->sql_escape($class) . "' - $parent_sql - AND " . ((is_numeric($module)) ? 'module_id = ' . (int) $module : "module_langname = '" . $this->db->sql_escape($module) . "'"); - $result = $this->db->sql_query($sql); - $module_id = $this->db->sql_fetchfield('module_id'); - $this->db->sql_freeresult($result); - - if ($module_id) + foreach ($parent_sqls as $parent_sql) { - return true; + $sql = 'SELECT module_id + FROM ' . $this->modules_table . " + WHERE module_class = '" . $this->db->sql_escape($class) . "' + $parent_sql + AND " . ((is_numeric($module)) ? 'module_id = ' . (int) $module : "module_langname = '" . $this->db->sql_escape($module) . "'"); + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + if (!$lazy && !$module_id) + { + return false; + } + else if ($lazy && $module_id) + { + return true; + } } - return false; + // Returns true, if modules exist in all parents and false otherwise + return !$lazy; } /** @@ -172,7 +185,7 @@ class module implements \phpbb\db\migration\tool\tool_interface $data = array('module_langname' => $data); } - $parent = $data['parent_id'] = $this->get_parent_module_id($parent, $data); + $parents = (array) $this->get_parent_module_id($parent, $data); if (!isset($data['module_langname'])) { @@ -195,95 +208,129 @@ class module implements \phpbb\db\migration\tool\tool_interface ); // Run the "manual" way with the data we've collected. - $this->add($class, $parent, $new_module); + foreach ($parents as $parent) + { + $this->add($class, $parent, $new_module); + } } } return; } - // The "manual" way - if (!$this->exists($class, false, $parent)) + foreach ($parents as $parent) { - throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent); - } + $data['parent_id'] = $parent; - if ($this->exists($class, $parent, $data['module_langname'])) - { - throw new \phpbb\db\migration\exception('MODULE_EXISTS', $data['module_langname']); - } - - $module_data = array( - 'module_enabled' => (isset($data['module_enabled'])) ? $data['module_enabled'] : 1, - 'module_display' => (isset($data['module_display'])) ? $data['module_display'] : 1, - 'module_basename' => (isset($data['module_basename'])) ? $data['module_basename'] : '', - 'module_class' => $class, - 'parent_id' => (int) $parent, - 'module_langname' => (isset($data['module_langname'])) ? $data['module_langname'] : '', - 'module_mode' => (isset($data['module_mode'])) ? $data['module_mode'] : '', - 'module_auth' => (isset($data['module_auth'])) ? $data['module_auth'] : '', - ); - - try - { - $this->module_manager->update_module_data($module_data); + // The "manual" way + if (!$this->exists($class, false, $parent)) + { + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent); + } - // Success - $module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']); - $phpbb_log->add('admin', (isset($user->data['user_id'])) ? $user->data['user_id'] : ANONYMOUS, $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); + if ($this->exists($class, $parent, $data['module_langname'])) + { + throw new \phpbb\db\migration\exception('MODULE_EXISTS', $data['module_langname']); + } - // Move the module if requested above/below an existing one - if (isset($data['before']) && $data['before']) + $module_data = array( + 'module_enabled' => (isset($data['module_enabled'])) ? $data['module_enabled'] : 1, + 'module_display' => (isset($data['module_display'])) ? $data['module_display'] : 1, + 'module_basename' => (isset($data['module_basename'])) ? $data['module_basename'] : '', + 'module_class' => $class, + 'parent_id' => (int) $parent, + 'module_langname' => (isset($data['module_langname'])) ? $data['module_langname'] : '', + 'module_mode' => (isset($data['module_mode'])) ? $data['module_mode'] : '', + 'module_auth' => (isset($data['module_auth'])) ? $data['module_auth'] : '', + ); + + try { - $sql = 'SELECT left_id + $this->module_manager->update_module_data($module_data); + + // Success + $module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']); + $phpbb_log->add('admin', (isset($user->data['user_id'])) ? $user->data['user_id'] : ANONYMOUS, $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); + + // Move the module if requested above/below an existing one + if (isset($data['before']) && $data['before']) + { + $before_mode = $before_langname = ''; + if (is_array($data['before'])) + { + // Restore legacy-legacy behaviour from phpBB 3.0 + list($before_mode, $before_langname) = $data['before']; + } + else + { + // Legacy behaviour from phpBB 3.1+ + $before_langname = $data['before']; + } + + $sql = 'SELECT left_id FROM ' . $this->modules_table . " WHERE module_class = '" . $this->db->sql_escape($class) . "' AND parent_id = " . (int) $parent . " - AND module_langname = '" . $this->db->sql_escape($data['before']) . "'"; - $this->db->sql_query($sql); - $to_left = (int) $this->db->sql_fetchfield('left_id'); + AND module_langname = '" . $this->db->sql_escape($before_langname) . "'" + . (($before_mode) ? " AND module_mode = '" . $this->db->sql_escape($before_mode) . "'" : ''); + $this->db->sql_query($sql); + $to_left = (int) $this->db->sql_fetchfield('left_id'); - $sql = 'UPDATE ' . $this->modules_table . " + $sql = 'UPDATE ' . $this->modules_table . " SET left_id = left_id + 2, right_id = right_id + 2 WHERE module_class = '" . $this->db->sql_escape($class) . "' AND left_id >= $to_left AND left_id < {$module_data['left_id']}"; - $this->db->sql_query($sql); + $this->db->sql_query($sql); - $sql = 'UPDATE ' . $this->modules_table . " + $sql = 'UPDATE ' . $this->modules_table . " SET left_id = $to_left, right_id = " . ($to_left + 1) . " WHERE module_class = '" . $this->db->sql_escape($class) . "' AND module_id = {$module_data['module_id']}"; - $this->db->sql_query($sql); - } - else if (isset($data['after']) && $data['after']) - { - $sql = 'SELECT right_id + $this->db->sql_query($sql); + } + else if (isset($data['after']) && $data['after']) + { + $after_mode = $after_langname = ''; + if (is_array($data['after'])) + { + // Restore legacy-legacy behaviour from phpBB 3.0 + list($after_mode, $after_langname) = $data['after']; + } + else + { + // Legacy behaviour from phpBB 3.1+ + $after_langname = $data['after']; + } + + $sql = 'SELECT right_id FROM ' . $this->modules_table . " WHERE module_class = '" . $this->db->sql_escape($class) . "' AND parent_id = " . (int) $parent . " - AND module_langname = '" . $this->db->sql_escape($data['after']) . "'"; - $this->db->sql_query($sql); - $to_right = (int) $this->db->sql_fetchfield('right_id'); + AND module_langname = '" . $this->db->sql_escape($after_langname) . "'" + . (($after_mode) ? " AND module_mode = '" . $this->db->sql_escape($after_mode) . "'" : ''); + $this->db->sql_query($sql); + $to_right = (int) $this->db->sql_fetchfield('right_id'); - $sql = 'UPDATE ' . $this->modules_table . " + $sql = 'UPDATE ' . $this->modules_table . " SET left_id = left_id + 2, right_id = right_id + 2 WHERE module_class = '" . $this->db->sql_escape($class) . "' AND left_id >= $to_right AND left_id < {$module_data['left_id']}"; - $this->db->sql_query($sql); + $this->db->sql_query($sql); - $sql = 'UPDATE ' . $this->modules_table . ' + $sql = 'UPDATE ' . $this->modules_table . ' SET left_id = ' . ($to_right + 1) . ', right_id = ' . ($to_right + 2) . " WHERE module_class = '" . $this->db->sql_escape($class) . "' AND module_id = {$module_data['module_id']}"; - $this->db->sql_query($sql); + $this->db->sql_query($sql); + } + } + catch (module_exception $e) + { + // Error + throw new \phpbb\db\migration\exception('MODULE_ERROR', $e->getMessage()); } - } - catch (module_exception $e) - { - // Error - throw new \phpbb\db\migration\exception('MODULE_ERROR', $e->getMessage()); } // Clear the Modules Cache @@ -334,7 +381,7 @@ class module implements \phpbb\db\migration\tool\tool_interface } else { - if (!$this->exists($class, $parent, $module)) + if (!$this->exists($class, $parent, $module, true)) { return; } @@ -342,8 +389,8 @@ class module implements \phpbb\db\migration\tool\tool_interface $parent_sql = ''; if ($parent !== false) { - $parent = $this->get_parent_module_id($parent, $module); - $parent_sql = 'AND parent_id = ' . (int) $parent; + $parents = (array)$this->get_parent_module_id($parent, $module); + $parent_sql = 'AND ' . $this->db->sql_in_set('parent_id', $parents); } $module_ids = array(); @@ -457,14 +504,11 @@ class module implements \phpbb\db\migration\tool\tool_interface * @param string|int $parent_id The parent module_id|module_langname * @param int|string|array $data The module_id, module_langname for existance checking or module data array for adding * @param bool $throw_exception The flag indicating if exception should be thrown on error - * @return mixed The int parent module_id or false + * @return mixed The int parent module_id, an array of int parent module_id values or false * @throws \phpbb\db\migration\exception */ public function get_parent_module_id($parent_id, $data = '', $throw_exception = true) { - // Initialize exception object placeholder - $exception = false; - // Allow '' to be sent as 0 $parent_id = $parent_id ?: 0; @@ -486,61 +530,26 @@ class module implements \phpbb\db\migration\tool\tool_interface { // No parent with the given module_langname exist case 0: - $exception = new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent_id); + if ($throw_exception) + { + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent_id); + } + + return false; break; // Return the module id case 1: - $parent_id = (int) $ids[0]; + return (int) $ids[0]; break; - // Several modules with the given module_langname were found - // Try to determine the parent_id by the neighbour module parent default: - if (is_array($data) && (isset($data['before']) || isset($data['after']))) - { - $neighbour_module_langname = isset($data['before']) ? $data['before'] : $data['after']; - $sql = 'SELECT parent_id - FROM ' . $this->modules_table . " - WHERE module_langname = '" . $this->db->sql_escape($neighbour_module_langname) . "' - AND " . $this->db->sql_in_set('parent_id', $ids); - $result = $this->db->sql_query($sql); - $parent_id = (int) $this->db->sql_fetchfield('parent_id'); - if (!$parent_id) - { - $exception = new \phpbb\db\migration\exception('PARENT_MODULE_FIND_ERROR', $data['parent_id']); - } - } - else if (!empty($data) && !is_array($data)) - { - // The module_langname is set, checking for the module existance - // As more than 1 parents were found already, there's no way for null parent_id here - $sql = 'SELECT m2.module_id as module_parent_id - FROM ' . $this->modules_table . ' m1, ' . $this->modules_table . " m2 - WHERE " . ((is_numeric($data)) ? 'm1.module_id = ' . (int) $data : "m1.module_langname = '" . $this->db->sql_escape($data)) . "' - AND m2.module_id = m1.parent_id - AND " . $this->db->sql_in_set('m2.module_id', $ids); - $result = $this->db->sql_query($sql); - $parent_id = (int) $this->db->sql_fetchfield('module_parent_id'); - } - else - { - //Unable to get the parent module id, throwing an exception - $exception = new \phpbb\db\migration\exception('MODULE_EXIST_MULTIPLE', $parent_id); - } + // This represents the old behaviour of phpBB 3.0 + return $ids; break; } } - if ($exception !== false) - { - if ($throw_exception) - { - throw $exception; - } - return false; - } - return $parent_id; } } -- cgit v1.2.1 From 719a49d38793f1490988ed0fa3fea84da17d3886 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 17 Nov 2017 01:31:31 +0100 Subject: [ticket/15339] Free sql results in migration module tool PHPBB3-15339 --- phpBB/phpbb/db/migration/tool/module.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 3b4728c9d7..e1dfe40709 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -273,8 +273,9 @@ class module implements \phpbb\db\migration\tool\tool_interface AND parent_id = " . (int) $parent . " AND module_langname = '" . $this->db->sql_escape($before_langname) . "'" . (($before_mode) ? " AND module_mode = '" . $this->db->sql_escape($before_mode) . "'" : ''); - $this->db->sql_query($sql); + $result = $this->db->sql_query($sql); $to_left = (int) $this->db->sql_fetchfield('left_id'); + $this->db->sql_freeresult($result); $sql = 'UPDATE ' . $this->modules_table . " SET left_id = left_id + 2, right_id = right_id + 2 @@ -309,8 +310,9 @@ class module implements \phpbb\db\migration\tool\tool_interface AND parent_id = " . (int) $parent . " AND module_langname = '" . $this->db->sql_escape($after_langname) . "'" . (($after_mode) ? " AND module_mode = '" . $this->db->sql_escape($after_mode) . "'" : ''); - $this->db->sql_query($sql); + $result = $this->db->sql_query($sql); $to_right = (int) $this->db->sql_fetchfield('right_id'); + $this->db->sql_freeresult($result); $sql = 'UPDATE ' . $this->modules_table . " SET left_id = left_id + 2, right_id = right_id + 2 -- cgit v1.2.1 From 485a4a75b21578cc1d2bd46b0562d704ac4ebbdb Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 28 Nov 2017 02:09:50 +0100 Subject: [ticket/15444] Add a migration to merge duplicate BBCodes PHPBB3-15444 --- .../data/v32x/merge_duplicate_bbcodes.php | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php new file mode 100644 index 0000000000..3bf442bab5 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -0,0 +1,75 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class merge_duplicate_bbcodes extends \phpbb\db\migration\migration +{ + public function update_data() + { + return [ + ['custom', [[$this, 'update_bbcodes_table']]], + ]; + } + + public function update_bbcodes_table() + { + $sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline, bbcode_match, bbcode_tpl FROM ' . BBCODES_TABLE; + $result = $this->sql_query($sql); + $bbcodes = []; + while ($row = $this->db->sql_fetchrow($result)) + { + $variant = (substr($row['bbcode_tag'], -1) === '=') ? 'with': 'without'; + $bbcode_name = rtrim($row['bbcode_tag'], '='); + $bbcodes[$bbcode_name][$variant] = $row; + } + $this->db->sql_freeresult($result); + + foreach ($bbcodes as $bbcode_name => $variants) + { + if (count($variants) === 2) + { + $this->merge_bbcodes($variants['without'], $variants['with']); + } + } + } + + protected function merge_bbcodes(array $without, array $with) + { + $merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes( + [ + 'usage' => $without['bbcode_match'], + 'template' => $without['bbcode_tpl'] + ], + [ + 'usage' => $with['bbcode_match'], + 'template' => $with['bbcode_tpl'] + ] + ); + $bbcode_data = [ + 'bbcode_tag' => $without['bbcode_tag'], + 'bbcode_helpline' => $without['bbcode_helpline'] . ' | ' . $with['bbcode_helpline'], + 'bbcode_match' => $merged['usage'], + 'bbcode_tpl' => $merged['template'] + ]; + + $sql = 'UPDATE ' . BBCODES_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . ' + WHERE bbcode_id = ' . $without['bbcode_id']; + $this->sql_query($sql); + + $sql = 'DELETE FROM ' . BBCODES_TABLE . ' + WHERE bbcode_id = ' . $with['bbcode_id']; + $this->sql_query($sql); + } +} -- cgit v1.2.1 From 9f055e1af39f36ff18cc278093000cb30c858885 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 11 Dec 2017 21:56:21 +0100 Subject: [ticket/15322] Add config setting for -f parameter & remove mail function name The -f parameter can now be added via configuration in the ACP. Addtionally, the config setting for the mail function name has been removed. PHPBB3-15322 --- .../migration/data/v32x/email_envelope_sender.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php b/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php new file mode 100644 index 0000000000..2ba83f40df --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class email_envelope_sender extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321', + ); + } + + public function effectively_installed() + { + return isset($this->config['email_envelope_sender']); + } + + public function update_data() + { + return array( + array('config.add', array('email_envelope_sender', '0')), + array('config.remove', array('email_function_name')), + ); + } +} -- cgit v1.2.1 From 4e045ed767603547d6aa9126d22a42bd690a1dd1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 13 Dec 2017 21:31:07 +0100 Subject: [ticket/15322] Try to make new email setting more readable PHPBB3-15322 --- .../migration/data/v32x/email_envelope_sender.php | 37 ---------------------- .../db/migration/data/v32x/email_force_sender.php | 37 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 37 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php create mode 100644 phpBB/phpbb/db/migration/data/v32x/email_force_sender.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php b/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php deleted file mode 100644 index 2ba83f40df..0000000000 --- a/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php +++ /dev/null @@ -1,37 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\db\migration\data\v32x; - -class email_envelope_sender extends \phpbb\db\migration\migration -{ - static public function depends_on() - { - return array( - '\phpbb\db\migration\data\v32x\v321', - ); - } - - public function effectively_installed() - { - return isset($this->config['email_envelope_sender']); - } - - public function update_data() - { - return array( - array('config.add', array('email_envelope_sender', '0')), - array('config.remove', array('email_function_name')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v32x/email_force_sender.php b/phpBB/phpbb/db/migration/data/v32x/email_force_sender.php new file mode 100644 index 0000000000..5319b7f76e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/email_force_sender.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class email_force_sender extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321', + ); + } + + public function effectively_installed() + { + return isset($this->config['email_force_sender']); + } + + public function update_data() + { + return array( + array('config.add', array('email_force_sender', '0')), + array('config.remove', array('email_function_name')), + ); + } +} -- cgit v1.2.1 From 2b16b7cada85492b6312d126afa71a8a2e50a2a3 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 24 Dec 2017 19:55:03 +0100 Subject: [ticket/15339] Fix tests PHPBB3-15339 --- phpBB/phpbb/db/migration/tool/module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index e1dfe40709..238e063a87 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -391,7 +391,7 @@ class module implements \phpbb\db\migration\tool\tool_interface $parent_sql = ''; if ($parent !== false) { - $parents = (array)$this->get_parent_module_id($parent, $module); + $parents = (array) $this->get_parent_module_id($parent, $module); $parent_sql = 'AND ' . $this->db->sql_in_set('parent_id', $parents); } -- cgit v1.2.1 From bd52c64e68f4fa5ae1a6292c61b272b6a04d2e7f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 28 Dec 2017 15:02:37 +0100 Subject: [prep-release-3.2.2] Add migration for 3.2.2-RC1 --- phpBB/phpbb/db/migration/data/v32x/v321.php | 1 + phpBB/phpbb/db/migration/data/v32x/v322rc1.php | 40 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v322rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v321.php b/phpBB/phpbb/db/migration/data/v32x/v321.php index 268f978b4b..fdbb5cff19 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v321.php +++ b/phpBB/phpbb/db/migration/data/v32x/v321.php @@ -23,6 +23,7 @@ class v321 extends \phpbb\db\migration\migration static public function depends_on() { return array( + '\phpbb\db\migration\data\v31x\v3111', '\phpbb\db\migration\data\v32x\v321rc1', ); diff --git a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php new file mode 100644 index 0000000000..51e9f5fcaa --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v322rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.2-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\fix_user_styles', + '\phpbb\db\migration\data\v32x\update_prosilver_bitfield', + '\phpbb\db\migration\data\v32x\email_force_sender', + '\phpbb\db\migration\data\v32x\f_list_topics_permission_add', + '\phpbb\db\migration\data\v32x\merge_duplicate_bbcodes', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.2-RC1')), + ); + } +} -- cgit v1.2.1 From 5def7e255ec46175b74a31523f89309136e78869 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 31 Dec 2017 16:39:02 +0100 Subject: [prep-release-3.1.12] Add migration for 3.1.12 --- phpBB/phpbb/db/migration/data/v31x/v3112.php | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/v3112.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v31x/v3112.php b/phpBB/phpbb/db/migration/data/v31x/v3112.php new file mode 100644 index 0000000000..0d75d35184 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v3112.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class v3112 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.1.12', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v3111', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.12')), + ); + } +} -- cgit v1.2.1 From dec06d10fedb43bc948fe438b6f581ac7caa1916 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 7 May 2017 02:10:37 +0700 Subject: [ticket/14972] Fix use of deprecated media attachment constants PHPBB3-14972 --- .../phpbb/db/migration/data/v320/remove_outdated_media.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php index c14d31f1c0..98b1c2d039 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -15,10 +15,17 @@ namespace phpbb\db\migration\data\v320; class remove_outdated_media extends \phpbb\db\migration\migration { + // Following constants were deprecated in 3.2 + // and moved from constants.php to compatibility_globals.php, + // thus define them as class constants + const ATTACHMENT_CATEGORY_WM = 2; + const ATTACHMENT_CATEGORY_RM = 3; + const ATTACHMENT_CATEGORY_QUICKTIME = 6; + protected $cat_id = array( - ATTACHMENT_CATEGORY_WM, - ATTACHMENT_CATEGORY_RM, - ATTACHMENT_CATEGORY_QUICKTIME, + self::ATTACHMENT_CATEGORY_WM, + self::ATTACHMENT_CATEGORY_RM, + self::ATTACHMENT_CATEGORY_QUICKTIME, ); static public function depends_on() -- cgit v1.2.1 From f8fbe3793680af1dae2db2829cfc84068831c52f Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 28 Jun 2017 00:58:03 +0700 Subject: [ticket/14972] replace all occurrences of sizeof() with the count() PHPBB3-14972 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 2 +- phpBB/phpbb/db/migration/data/v310/teampage.php | 4 ++-- phpBB/phpbb/db/migration/tool/config.php | 2 +- phpBB/phpbb/db/migration/tool/config_text.php | 2 +- phpBB/phpbb/db/migration/tool/module.php | 4 ++-- phpBB/phpbb/db/migration/tool/permission.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index f50ab33830..a7e30a9cb7 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -133,7 +133,7 @@ class style_update_p1 extends \phpbb\db\migration\migration } // Remove old entries from styles table - if (!sizeof($valid_styles)) + if (!count($valid_styles)) { // No valid styles: remove everything and add prosilver $this->sql_query('DELETE FROM ' . STYLES_TABLE); diff --git a/phpBB/phpbb/db/migration/data/v310/teampage.php b/phpBB/phpbb/db/migration/data/v310/teampage.php index f8edbc3492..3a37b17e97 100644 --- a/phpBB/phpbb/db/migration/data/v310/teampage.php +++ b/phpBB/phpbb/db/migration/data/v310/teampage.php @@ -93,13 +93,13 @@ class teampage extends \phpbb\db\migration\migration $teampage_entries[] = array( 'group_id' => (int) $row['group_id'], 'teampage_name' => '', - 'teampage_position' => sizeof($teampage_entries) + 1, + 'teampage_position' => count($teampage_entries) + 1, 'teampage_parent' => 0, ); } $this->db->sql_freeresult($result); - if (sizeof($teampage_entries)) + if (count($teampage_entries)) { $this->db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_entries); } diff --git a/phpBB/phpbb/db/migration/tool/config.php b/phpBB/phpbb/db/migration/tool/config.php index 33aa8ff026..a351c4858e 100644 --- a/phpBB/phpbb/db/migration/tool/config.php +++ b/phpBB/phpbb/db/migration/tool/config.php @@ -134,7 +134,7 @@ class config implements \phpbb\db\migration\tool\tool_interface case 'remove': $call = 'add'; - if (sizeof($arguments) == 1) + if (count($arguments) == 1) { $arguments[] = ''; } diff --git a/phpBB/phpbb/db/migration/tool/config_text.php b/phpBB/phpbb/db/migration/tool/config_text.php index 54b45f6f6d..5fe9a25b70 100644 --- a/phpBB/phpbb/db/migration/tool/config_text.php +++ b/phpBB/phpbb/db/migration/tool/config_text.php @@ -110,7 +110,7 @@ class config_text implements \phpbb\db\migration\tool\tool_interface case 'remove': $call = 'add'; - if (sizeof($arguments) == 1) + if (count($arguments) == 1) { $arguments[] = ''; } diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 238e063a87..7d2720c861 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -515,7 +515,7 @@ class module implements \phpbb\db\migration\tool\tool_interface $parent_id = $parent_id ?: 0; // If automatic adding is in action, convert array back to string to simplify things - if (is_array($data) && sizeof($data) == 1) + if (is_array($data) && count($data) == 1) { $data = $data['module_langname']; } @@ -528,7 +528,7 @@ class module implements \phpbb\db\migration\tool\tool_interface // Search for the parent module_langname $ids = array_keys($this->module_categories, $parent_id); - switch (sizeof($ids)) + switch (count($ids)) { // No parent with the given module_langname exist case 0: diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index 9688420025..4b53aa32a7 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -442,7 +442,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface } ); - if (sizeof($auth_option)) + if (count($auth_option)) { return $this->permission_set($role_name, $auth_option, 'role', $has_permission); } -- cgit v1.2.1 From f8180ca97bf6d9e92a0a080e2af8af2f0654bfbe Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 7 Jan 2018 11:45:49 +0100 Subject: [prep-release-3.2.2] Add migration for 3.2.2 --- phpBB/phpbb/db/migration/data/v32x/v322.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v322.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v322.php b/phpBB/phpbb/db/migration/data/v32x/v322.php new file mode 100644 index 0000000000..7ecbbb3e79 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v322.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v322 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v3112', + '\phpbb\db\migration\data\v32x\v322rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.2')), + ); + } +} -- cgit v1.2.1 From 0391b48d7e95aca38be7c7ce7f1cbbba6c9fc5ab Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 8 Jan 2018 23:21:17 +0700 Subject: [ticket/15502] Fix migrations PHPBB3-15502 --- phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php | 6 +++++- phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php index 282c6bef2f..16fbdbc77b 100644 --- a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php +++ b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php @@ -33,13 +33,17 @@ class fix_user_styles extends \phpbb\db\migration\migration public function styles_fix() { $default_style = (int) $this->config['default_style']; + $enabled_styles = array(); // Get enabled styles $sql = 'SELECT style_id FROM ' . STYLES_TABLE . ' WHERE style_active = 1'; $result = $this->db->sql_query($sql); - $enabled_styles = $result->fetch_array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $enabled_styles[] = (int) $row['style_id']; + } $this->db->sql_freeresult($result); // Set the default style to users who have an invalid style diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php index 3bf442bab5..08609b571b 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -13,7 +13,7 @@ namespace phpbb\db\migration\data\v32x; -class merge_duplicate_bbcodes extends \phpbb\db\migration\migration +class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migration { public function update_data() { @@ -30,7 +30,7 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\migration while ($row = $this->db->sql_fetchrow($result)) { $variant = (substr($row['bbcode_tag'], -1) === '=') ? 'with': 'without'; - $bbcode_name = rtrim($row['bbcode_tag'], '='); + $bbcode_name = strtolower(rtrim($row['bbcode_tag'], '=')); $bbcodes[$bbcode_name][$variant] = $row; } $this->db->sql_freeresult($result); -- cgit v1.2.1 From f01e29effe5bf053ac5205e47f8e0e90a262315a Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Wed, 17 Jan 2018 00:16:26 +0100 Subject: [ticket/15518] Add a setting to toggle permission checks for pms in viewtopic PHPBB3-15518 --- .../data/v32x/enable_accurate_pm_button.php | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php b/phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php new file mode 100644 index 0000000000..a7b99606f7 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class enable_accurate_pm_button extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v322', + ); + } + + public function effectively_installed() + { + return isset($this->config['enable_accurate_pm_button']); + } + + public function update_data() + { + return array( + array('config.add', array('enable_accurate_pm_button', '1')), + ); + } +} -- cgit v1.2.1 From f08887e2774c480daf6b0d29dc949d2590472ee3 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sat, 20 Jan 2018 09:48:00 -0800 Subject: [ticket/15526] Cast bbcode id to INT in merge bbcodes migration PHPBB3-15526 --- phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php index 08609b571b..b1ee241f44 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -65,11 +65,11 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migrat $sql = 'UPDATE ' . BBCODES_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . ' - WHERE bbcode_id = ' . $without['bbcode_id']; + WHERE bbcode_id = ' . (int) $without['bbcode_id']; $this->sql_query($sql); $sql = 'DELETE FROM ' . BBCODES_TABLE . ' - WHERE bbcode_id = ' . $with['bbcode_id']; + WHERE bbcode_id = ' . (int) $with['bbcode_id']; $this->sql_query($sql); } } -- cgit v1.2.1 From 5c8a667db2e47313e687fd8afe3c4fa7c73abeb9 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Mon, 22 Jan 2018 02:37:47 +0100 Subject: [ticket/15527] Skip malformed BBCodes during merge_duplicate_bbcodes migration PHPBB3-15527 --- .../data/v32x/merge_duplicate_bbcodes.php | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php index 08609b571b..6457a84adb 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -13,6 +13,8 @@ namespace phpbb\db\migration\data\v32x; +use Exception; + class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migration { public function update_data() @@ -46,16 +48,25 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migrat protected function merge_bbcodes(array $without, array $with) { - $merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes( - [ - 'usage' => $without['bbcode_match'], - 'template' => $without['bbcode_tpl'] - ], - [ - 'usage' => $with['bbcode_match'], - 'template' => $with['bbcode_tpl'] - ] - ); + try + { + $merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes( + [ + 'usage' => $without['bbcode_match'], + 'template' => $without['bbcode_tpl'] + ], + [ + 'usage' => $with['bbcode_match'], + 'template' => $with['bbcode_tpl'] + ] + ); + } + catch (Exception $e) + { + // Ignore the pair and move on. The BBCodes would have to be fixed manually + return; + } + $bbcode_data = [ 'bbcode_tag' => $without['bbcode_tag'], 'bbcode_helpline' => $without['bbcode_helpline'] . ' | ' . $with['bbcode_helpline'], -- cgit v1.2.1 From 532afbf83a509b25c5042f5bb374657417ca3e5d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 24 Jan 2018 18:47:40 +0100 Subject: [ticket/15527] Remove "use" and specify full class name for exception PHPBB3-15527 --- phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php index 6457a84adb..ad50089d4e 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -13,8 +13,6 @@ namespace phpbb\db\migration\data\v32x; -use Exception; - class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migration { public function update_data() @@ -61,7 +59,7 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migrat ] ); } - catch (Exception $e) + catch (\Exception $e) { // Ignore the pair and move on. The BBCodes would have to be fixed manually return; -- cgit v1.2.1 From 747ed95678a0063d3197eed49e6d3e2e78dde385 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 28 Feb 2018 21:32:52 +0100 Subject: [prep-release-3.2.3] Add migration for 3.2.3-RC1 --- phpBB/phpbb/db/migration/data/v32x/v323rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v323rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php new file mode 100644 index 0000000000..0ff20d5074 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v323rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.3-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\enable_accurate_pm_button', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.3-RC1')), + ); + } +} -- cgit v1.2.1 From 2d5fe90ed5735c44ae733959c96da3a67a5d2647 Mon Sep 17 00:00:00 2001 From: kasimi Date: Sun, 11 Mar 2018 15:24:29 +0100 Subject: [ticket/15586] Fixed adding module the automatic way without specifying modes PHPBB3-15586 --- phpBB/phpbb/db/migration/tool/module.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 7d2720c861..8a48efb19c 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -514,12 +514,6 @@ class module implements \phpbb\db\migration\tool\tool_interface // Allow '' to be sent as 0 $parent_id = $parent_id ?: 0; - // If automatic adding is in action, convert array back to string to simplify things - if (is_array($data) && count($data) == 1) - { - $data = $data['module_langname']; - } - if (!is_numeric($parent_id)) { // Refresh the $module_categories array -- cgit v1.2.1 From d7db5d366b9a326237efc7576d7db3215a51bc81 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 19 Mar 2018 16:42:53 -0700 Subject: [ticket/15595] Fix module exists tool when parent is false PHPBB3-15595 --- phpBB/phpbb/db/migration/tool/module.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 7d2720c861..e24c78e228 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -86,7 +86,8 @@ class module implements \phpbb\db\migration\tool\tool_interface * check for to see if it exists * @param bool $lazy Checks lazily if the module exists. Returns true if it exists in at * least one given parent. - * @return bool true if module exists in *all* given parents, false if not + * @return bool true if module exists in *all* given parents, false if not in any given parent; + * true if ignoring parent check and module exists class wide, false if not found at all. */ public function exists($class, $parent, $module, $lazy = false) { @@ -110,6 +111,10 @@ class module implements \phpbb\db\migration\tool\tool_interface $parent_sqls[] = 'AND parent_id = ' . (int) $parent_id; } } + else + { + $parent_sqls[] = ''; + } foreach ($parent_sqls as $parent_sql) { @@ -126,7 +131,7 @@ class module implements \phpbb\db\migration\tool\tool_interface { return false; } - else if ($lazy && $module_id) + if ($lazy && $module_id) { return true; } -- cgit v1.2.1 From 6fdb7486ad0a95a3f80ddc88e6e53c058a9863ec Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Mon, 18 Jun 2018 13:42:42 +0200 Subject: [ticket/15651] Remove unnecessary condition module.remove internally check if the module exists PHPBB3-15651 --- phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php index a52067f484..804adc4490 100644 --- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -32,10 +32,7 @@ class add_help_phpbb extends \phpbb\db\migration\migration return array( array('config.add', array('help_send_statistics', true)), array('config.add', array('help_send_statistics_time', 0)), - array('if', array( - array('module.exists', array('acp', false, 'ACP_SEND_STATISTICS')), - array('module.remove', array('acp', false, 'ACP_SEND_STATISTICS')), - )), + array('module.remove', array('acp', false, 'ACP_SEND_STATISTICS')), array('module.add', array( 'acp', 'ACP_SERVER_CONFIGURATION', -- cgit v1.2.1 From 8276b3d33732d120dc2556c917816c8407f9787a Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Thu, 26 Jul 2018 16:42:33 +0200 Subject: [ticket/11847] Add depends_on() to auth_provider_oauth PHPBB3-11847 --- phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php index 508a31fba9..d41041af49 100644 --- a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php +++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php @@ -20,6 +20,11 @@ class auth_provider_oauth extends \phpbb\db\migration\migration return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); } + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_0'); + } + public function update_schema() { return array( -- cgit v1.2.1 From 75c082e60589bddc6e4acea687231367e0e3a05b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 30 Jul 2018 21:29:19 +0200 Subject: [prep-release-3.2.3] Add migration for 3.2.3-RC2 --- phpBB/phpbb/db/migration/data/v32x/v323rc2.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v323rc2.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v323rc2.php b/phpBB/phpbb/db/migration/data/v32x/v323rc2.php new file mode 100644 index 0000000000..32235ee067 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v323rc2.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v323rc2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.3-RC2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v323rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.3-RC2')), + ); + } +} -- cgit v1.2.1 From ecfd067f37bbcf3ce86c85f75ca0442c18be0531 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 26 Aug 2018 14:47:24 +0200 Subject: [prep-release-3.2.3] Add 3.2.3 migration --- phpBB/phpbb/db/migration/data/v32x/v323.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v323.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v323.php b/phpBB/phpbb/db/migration/data/v32x/v323.php new file mode 100644 index 0000000000..1ec28ceb37 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v323.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v323 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.3', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v323rc2', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.3')), + ); + } +} -- cgit v1.2.1 From b79aa3e147506f6e861bc777d40d758ee83d33c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Thu, 30 Aug 2018 07:06:18 +0200 Subject: [ticket/15762] Update type for forum_topics_per_page PHPBB3-15762 --- .../data/v32x/forum_topics_per_page_type.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php b/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php new file mode 100644 index 0000000000..b9b88bac29 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class forum_topics_per_page_type extends \phpbb\db\migration\migration +{ + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v323rc2', + ); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_topics_per_page' => array('USINT', 0), + ), + ), + ); + } + +} -- cgit v1.2.1 From 9090ddcfb6dc4c50a2e7b0cc6a7d387a3fa17143 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Thu, 13 Sep 2018 15:18:29 +0200 Subject: [ticket/15767] Fix effictively_installed condition for oauth_tokens PHPBB3-15767 --- phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php index d41041af49..1e2024a071 100644 --- a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php +++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php @@ -17,7 +17,7 @@ class auth_provider_oauth extends \phpbb\db\migration\migration { public function effectively_installed() { - return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); + return $this->db_tools->sql_table_exists($this->table_prefix . 'oauth_tokens'); } static public function depends_on() -- cgit v1.2.1 From 271c9d34dc8a2556bb0fa164258d2264fb512aca Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Thu, 13 Sep 2018 17:49:24 +0200 Subject: [ticket/15744] Remove useless sql_freeresults PHPBB3-15744 --- phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php index 98b1c2d039..88fe59ccc9 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -85,13 +85,11 @@ class remove_outdated_media extends \phpbb\db\migration\migration WHERE ' . $this->db->sql_in_set('group_id', $group_ids); } - $result = $this->db->sql_query($sql); - $this->db->sql_freeresult($result); + $this->db->sql_query($sql); // delete the now empty, outdated media extension groups $sql = 'DELETE FROM ' . EXTENSION_GROUPS_TABLE . ' WHERE ' . $this->db->sql_in_set('group_id', $group_ids); - $result = $this->db->sql_query($sql); - $this->db->sql_freeresult($result); + $this->db->sql_query($sql); } } -- cgit v1.2.1 From 3d2c1b8f9766bf914755904d685aba1a4665cc26 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Mon, 24 Sep 2018 02:54:50 +0200 Subject: [ticket/15544] Delete cache through module manager This might fix issues with migrations since the sql cache will be purged as well. In general, this puts all the logic in one place, so that's good. PHPBB3-15544 --- phpBB/phpbb/db/migration/tool/module.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 3893935723..e5133c8152 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -341,7 +341,7 @@ class module implements \phpbb\db\migration\tool\tool_interface } // Clear the Modules Cache - $this->cache->destroy("_modules_$class"); + $this->module_manager->remove_cache_file($class); } /** @@ -425,7 +425,7 @@ class module implements \phpbb\db\migration\tool\tool_interface $this->module_manager->delete_module($module_id, $class); } - $this->cache->destroy("_modules_$class"); + $this->module_manager->remove_cache_file($class); } } -- cgit v1.2.1 From 582c1f35626383592aef9aef413c911d4803475d Mon Sep 17 00:00:00 2001 From: rubencm Date: Mon, 8 Oct 2018 21:44:27 +0000 Subject: [ticket/15762] Update migration dependency PHPBB3-15762 --- phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php b/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php index b9b88bac29..afcecf2ef0 100644 --- a/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php +++ b/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php @@ -19,7 +19,7 @@ class forum_topics_per_page_type extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\v323rc2', + '\phpbb\db\migration\data\v32x\v323', ); } -- cgit v1.2.1 From d753351edc04a45c61411ee09607fb932d314617 Mon Sep 17 00:00:00 2001 From: Derky Date: Tue, 23 Oct 2018 23:51:55 +0200 Subject: [ticket/security/227] Replace ImageMagick support with thumbnail event SECURITY-227 --- .../db/migration/data/v32x/remove_imagick.php | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/remove_imagick.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php b/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php new file mode 100644 index 0000000000..a257511856 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class remove_imagick extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v323rc2', + ); + } + + public function update_data() + { + return array( + array('config.remove', array('img_imagick')), + ); + } +} -- cgit v1.2.1 From 46bc3355248b538b2d8b990a9664342ecccf9159 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 28 Oct 2018 20:19:07 +0100 Subject: [prep-release-3.2.4] Add migration for 3.2.4-RC1 --- phpBB/phpbb/db/migration/data/v32x/v324rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v324rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php new file mode 100644 index 0000000000..78aed2f661 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v324rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.4-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\forum_topics_per_page_type', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.4-RC1')), + ); + } +} -- cgit v1.2.1 From 3d534a5eb679356e0ad4f7c8738e3f5e20869ac3 Mon Sep 17 00:00:00 2001 From: Derky Date: Sun, 4 Nov 2018 23:18:38 +0100 Subject: [ticket/security/227] Change migration depends_on to 3.2.4-RC1 SECURITY-227 --- phpBB/phpbb/db/migration/data/v32x/remove_imagick.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php b/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php index a257511856..7ad396f8e8 100644 --- a/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php +++ b/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php @@ -18,7 +18,7 @@ class remove_imagick extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\v323rc2', + '\phpbb\db\migration\data\v32x\v324rc1', ); } -- cgit v1.2.1 From f631d6b84dbc4b5d5530090d31acea5b6bd950a3 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 10 Nov 2018 21:24:14 +0100 Subject: [prep-release-3.2.4] Add migration for 3.2.4 --- phpBB/phpbb/db/migration/data/v32x/v322rc1.php | 1 + phpBB/phpbb/db/migration/data/v32x/v323rc1.php | 1 + phpBB/phpbb/db/migration/data/v32x/v324.php | 38 ++++++++++++++++++++++++++ phpBB/phpbb/db/migration/data/v32x/v324rc1.php | 1 + 4 files changed, 41 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v324.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php index 51e9f5fcaa..87c8a736ae 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php @@ -23,6 +23,7 @@ class v322rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( + '\phpbb\db\migration\data\v320\v321', '\phpbb\db\migration\data\v32x\fix_user_styles', '\phpbb\db\migration\data\v32x\update_prosilver_bitfield', '\phpbb\db\migration\data\v32x\email_force_sender', diff --git a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php index 0ff20d5074..ad452504b9 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php @@ -23,6 +23,7 @@ class v323rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( + '\phpbb\db\migration\data\v320\v322', '\phpbb\db\migration\data\v32x\enable_accurate_pm_button', ); } diff --git a/phpBB/phpbb/db/migration/data/v32x/v324.php b/phpBB/phpbb/db/migration/data/v32x/v324.php new file mode 100644 index 0000000000..cd7783fdee --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v324.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v324 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.4', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v324rc1', + '\phpbb\db\migration\data\v32x\remove_imagick', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.4')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php index 78aed2f661..c5b9c33b7e 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php @@ -23,6 +23,7 @@ class v324rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( + '\phpbb\db\migration\data\v320\v323', '\phpbb\db\migration\data\v32x\forum_topics_per_page_type', ); } -- cgit v1.2.1 From 023ec01611123c426a5aeaf812e50fb1ade43c0e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 11 Nov 2018 10:14:16 +0100 Subject: [prep-release-3.2.4] Correctly specify dependencies --- phpBB/phpbb/db/migration/data/v32x/v322rc1.php | 2 +- phpBB/phpbb/db/migration/data/v32x/v323rc1.php | 2 +- phpBB/phpbb/db/migration/data/v32x/v324rc1.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php index 87c8a736ae..4fd6270132 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php @@ -23,7 +23,7 @@ class v322rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v320\v321', + '\phpbb\db\migration\data\v32x\v321', '\phpbb\db\migration\data\v32x\fix_user_styles', '\phpbb\db\migration\data\v32x\update_prosilver_bitfield', '\phpbb\db\migration\data\v32x\email_force_sender', diff --git a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php index ad452504b9..c3fcd1ab0b 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php @@ -23,7 +23,7 @@ class v323rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v320\v322', + '\phpbb\db\migration\data\v32x\v322', '\phpbb\db\migration\data\v32x\enable_accurate_pm_button', ); } diff --git a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php index c5b9c33b7e..0221e2621a 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php @@ -23,7 +23,7 @@ class v324rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v320\v323', + '\phpbb\db\migration\data\v32x\v323', '\phpbb\db\migration\data\v32x\forum_topics_per_page_type', ); } -- cgit v1.2.1 From 8a1d148fa86767ba5bc44c1f503cb263b1304256 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 29 Nov 2018 21:47:47 +0100 Subject: [prep-release-3.2.5] Add 3.2.5-RC1 migration --- phpBB/phpbb/db/migration/data/v32x/v325rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v325rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v325rc1.php b/phpBB/phpbb/db/migration/data/v32x/v325rc1.php new file mode 100644 index 0000000000..2d0de0a432 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v325rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v325rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.5-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v324', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.5-RC1')), + ); + } +} -- cgit v1.2.1 From 97c5861d5907c7476f3cd6cebcd690d04b64a5d9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 9 Dec 2018 15:43:01 +0100 Subject: [security/229] Update jQuery CDN link SECURITY-229 --- .../phpbb/db/migration/data/v32x/jquery_update.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/jquery_update.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/jquery_update.php b/phpBB/phpbb/db/migration/data/v32x/jquery_update.php new file mode 100644 index 0000000000..f35cac7a0d --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/jquery_update.php @@ -0,0 +1,37 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class jquery_update extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'; + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v325rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js')), + ); + } + +} -- cgit v1.2.1 From 37b33e6b6772d5ed6ad6e538754a2a82b37441b1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 13 Dec 2018 21:22:58 +0100 Subject: [security/229] Adjust effectively_installed on jquery update migration SECURITY-229 --- phpBB/phpbb/db/migration/data/v32x/jquery_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/jquery_update.php b/phpBB/phpbb/db/migration/data/v32x/jquery_update.php index f35cac7a0d..6dc58ec638 100644 --- a/phpBB/phpbb/db/migration/data/v32x/jquery_update.php +++ b/phpBB/phpbb/db/migration/data/v32x/jquery_update.php @@ -17,7 +17,7 @@ class jquery_update extends \phpbb\db\migration\migration { public function effectively_installed() { - return $this->config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'; + return $this->config['load_jquery_url'] === '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'; } static public function depends_on() -- cgit v1.2.1 From 304750a88b5a1c20cbfebbe97f71c65cd464d374 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 18 Dec 2018 21:07:41 +0100 Subject: [ticket/15911] Resolve warnings when updating from 3.0.0 to latest PHPBB3-15911 --- phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php index c018adab46..8838c55620 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -58,9 +58,12 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration $result = $this->db->sql_query($sql); $extension_groups_updated = array(); - while ($lang_dir = $this->db->sql_fetchfield('lang_dir')) + while ($row = $this->db->sql_fetchrow($result)) { - $lang_dir = basename($lang_dir); + if (empty($row['lang_dir'])) + continue; + + $lang_dir = basename($row['lang_dir']); // The language strings we need are either in language/.../acp/attachments.php // in the update package if we're updating to 3.0.8-RC1 or later, -- cgit v1.2.1 From 68489b2c135a1ec75d142851e82ee9683f8177db Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 18 Dec 2018 21:28:15 +0100 Subject: [ticket/15911] Add missing braces PHPBB3-15911 --- phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php index 8838c55620..836cb4577a 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -61,7 +61,9 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration while ($row = $this->db->sql_fetchrow($result)) { if (empty($row['lang_dir'])) + { continue; + } $lang_dir = basename($row['lang_dir']); -- cgit v1.2.1 From b089116965c361b02106fb839877f33639982a42 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 16 Dec 2018 16:05:24 +0100 Subject: [prep-release-3.2.5] Add 3.2.5 migration --- phpBB/phpbb/db/migration/data/v32x/v325.php | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v325.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v325.php b/phpBB/phpbb/db/migration/data/v32x/v325.php new file mode 100644 index 0000000000..59de4916df --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v325.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v325 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.5', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v325rc1', + '\phpbb\db\migration\data\v32x\jquery_update', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.5')), + ); + } +} -- cgit v1.2.1 From dc5a167c429a3813d66b0ae3d14242650466cac6 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 17 Apr 2019 08:54:51 +0200 Subject: [ticket/security/231] Disable remote avatar functionality & add warning SECURITY-231 --- .../migration/data/v32x/disable_remote_avatar.php | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/disable_remote_avatar.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/disable_remote_avatar.php b/phpBB/phpbb/db/migration/data/v32x/disable_remote_avatar.php new file mode 100644 index 0000000000..b08833fad4 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/disable_remote_avatar.php @@ -0,0 +1,34 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +use phpbb\db\migration\migration; + +class disable_remote_avatar extends migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v325', + ); + } + + public function update_data() + { + return array( + array('config.update', array('allow_avatar_remote', '0')), + array('config.update', array('allow_avatar_remote_upload', '0')), + ); + } +} -- cgit v1.2.1 From 3b2119e535b53e80f343c080dbef5f82bf83f5f6 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 20 Apr 2019 23:06:07 +0200 Subject: [prep-release-3.2.6] Add migration for 3.2.6-RC1 --- phpBB/phpbb/db/migration/data/v32x/v326rc1.php | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v326rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v326rc1.php b/phpBB/phpbb/db/migration/data/v32x/v326rc1.php new file mode 100644 index 0000000000..092700d3db --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v326rc1.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v326rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.6-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v325', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.6-RC1')), + ); + } +} -- cgit v1.2.1 From 8e5a0c81ef118c7d88e10fb7d793a36e9204aea8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 21 Apr 2019 22:22:35 +0200 Subject: [ticket/security/233] Make smtp_password and smtp_username dynamic SECURITY-233 --- .../db/migration/data/v32x/smtp_dynamic_data.php | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/smtp_dynamic_data.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/smtp_dynamic_data.php b/phpBB/phpbb/db/migration/data/v32x/smtp_dynamic_data.php new file mode 100644 index 0000000000..aeaa3e8979 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/smtp_dynamic_data.php @@ -0,0 +1,42 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class smtp_dynamic_data extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v326rc1', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'set_smtp_dynamic'))), + ); + } + + public function set_smtp_dynamic() + { + $smtp_auth_entries = [ + 'smtp_password', + 'smtp_username', + ]; + $this->sql_query('UPDATE ' . CONFIG_TABLE . ' + SET is_dynamic = 1 + WHERE ' . $this->db->sql_in_set('config_name', $smtp_auth_entries)); + } +} -- cgit v1.2.1 From bec047586a09ec0bf4a8214edb66c452e2489851 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 27 Apr 2019 14:41:50 +0200 Subject: [prep-release-3.2.6] Add migration to 3.2.6 --- phpBB/phpbb/db/migration/data/v32x/v326.php | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v326.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v326.php b/phpBB/phpbb/db/migration/data/v32x/v326.php new file mode 100644 index 0000000000..2d511b9ed8 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v326.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v326 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.6', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v326rc1', + '\phpbb\db\migration\data\v32x\disable_remote_avatar', + '\phpbb\db\migration\data\v32x\smtp_dynamic_data', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.6')), + ); + } +} -- cgit v1.2.1 From af7412f3cb3588b7a8cde5914e65bb183c09a359 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 2 May 2019 22:55:55 +0200 Subject: [prep-release-3.2.7] Add migration for 3.2.7-RC1 --- phpBB/phpbb/db/migration/data/v32x/v327rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v327rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v327rc1.php b/phpBB/phpbb/db/migration/data/v32x/v327rc1.php new file mode 100644 index 0000000000..c8169105af --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v327rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v327rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.7-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v326', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.7-RC1')), + ); + } +} -- cgit v1.2.1 From 07767ab3e65377654286f4b16c4319e53fa86f04 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 4 May 2019 15:34:18 +0200 Subject: [prep-release-3.2.7] Add 3.2.7 migration --- phpBB/phpbb/db/migration/data/v32x/v327.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v327.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v327.php b/phpBB/phpbb/db/migration/data/v32x/v327.php new file mode 100644 index 0000000000..f9ea11f4b9 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v327.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v327 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.7', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v327rc1', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.7')), + ); + } +} -- cgit v1.2.1 From e3b76bce373e0df73de7d2600cd596d436aedb32 Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 18 May 2019 17:28:01 +0700 Subject: [ticket/16063] Remove board_dst config value since unused PHPBB3-16063 --- phpBB/phpbb/db/migration/data/v310/timezone_p3.php | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/timezone_p3.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/timezone_p3.php b/phpBB/phpbb/db/migration/data/v310/timezone_p3.php new file mode 100644 index 0000000000..6c751eae4e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/timezone_p3.php @@ -0,0 +1,29 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class timezone_p3 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\timezone'); + } + + public function update_data() + { + return array( + array('config.remove', array('board_dst')), + ); + } +} -- cgit v1.2.1 From ed2123fa6183d51e3fae1cb90fc764d0377e0d0b Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 6 Jun 2019 20:22:33 +0700 Subject: [ticket/16063] Move new migration file to 32x folder PHPBB3-16063 --- phpBB/phpbb/db/migration/data/v310/timezone_p3.php | 29 ---------------------- phpBB/phpbb/db/migration/data/v32x/timezone_p3.php | 29 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v310/timezone_p3.php create mode 100644 phpBB/phpbb/db/migration/data/v32x/timezone_p3.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/timezone_p3.php b/phpBB/phpbb/db/migration/data/v310/timezone_p3.php deleted file mode 100644 index 6c751eae4e..0000000000 --- a/phpBB/phpbb/db/migration/data/v310/timezone_p3.php +++ /dev/null @@ -1,29 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\db\migration\data\v310; - -class timezone_p3 extends \phpbb\db\migration\migration -{ - static public function depends_on() - { - return array('\phpbb\db\migration\data\v310\timezone'); - } - - public function update_data() - { - return array( - array('config.remove', array('board_dst')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v32x/timezone_p3.php b/phpBB/phpbb/db/migration/data/v32x/timezone_p3.php new file mode 100644 index 0000000000..433f62ace9 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/timezone_p3.php @@ -0,0 +1,29 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class timezone_p3 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\timezone'); + } + + public function update_data() + { + return array( + array('config.remove', array('board_dst')), + ); + } +} -- cgit v1.2.1 From 62a68def57ef09bc2c03a87b6677ee7c53ac36c5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 17 Aug 2019 11:21:06 +0200 Subject: [prep-release-3.2.8] Add migration for 3.2.8-RC1 --- phpBB/phpbb/db/migration/data/v32x/v328rc1.php | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v328rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v328rc1.php b/phpBB/phpbb/db/migration/data/v32x/v328rc1.php new file mode 100644 index 0000000000..fa43cf33a7 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v328rc1.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v328rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.8-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\timezone_p3', + '\phpbb\db\migration\data\v32x\v327', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.8-RC1')), + ); + } +} -- cgit v1.2.1