aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2018-01-08 23:21:17 +0700
committerrxu <rxu@mail.ru>2018-01-09 01:01:49 +0700
commit0391b48d7e95aca38be7c7ce7f1cbbba6c9fc5ab (patch)
tree83a029f9816cd4695a1c9528c92bd2a39749f1d7
parentf26cf2dc1f2c58ac6cf97974aafa749688cacbaa (diff)
downloadforums-0391b48d7e95aca38be7c7ce7f1cbbba6c9fc5ab.tar
forums-0391b48d7e95aca38be7c7ce7f1cbbba6c9fc5ab.tar.gz
forums-0391b48d7e95aca38be7c7ce7f1cbbba6c9fc5ab.tar.bz2
forums-0391b48d7e95aca38be7c7ce7f1cbbba6c9fc5ab.tar.xz
forums-0391b48d7e95aca38be7c7ce7f1cbbba6c9fc5ab.zip
[ticket/15502] Fix migrations
PHPBB3-15502
-rw-r--r--phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php6
-rw-r--r--phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php4
2 files changed, 7 insertions, 3 deletions
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);