aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorDerky <derky@phpbb.com>2018-01-12 07:30:51 +0100
committerDerky <derky@phpbb.com>2018-01-12 07:30:51 +0100
commit7f6ececf95da25ce37e6f1359755d62820a3b2ce (patch)
treed9c3fa0aadaee8974470d7ec32c87266b194c363 /phpBB/phpbb
parentd268a63812b81cd96af5c7f82a60de21da16cc75 (diff)
parent0391b48d7e95aca38be7c7ce7f1cbbba6c9fc5ab (diff)
downloadforums-7f6ececf95da25ce37e6f1359755d62820a3b2ce.tar
forums-7f6ececf95da25ce37e6f1359755d62820a3b2ce.tar.gz
forums-7f6ececf95da25ce37e6f1359755d62820a3b2ce.tar.bz2
forums-7f6ececf95da25ce37e6f1359755d62820a3b2ce.tar.xz
forums-7f6ececf95da25ce37e6f1359755d62820a3b2ce.zip
Merge pull request #5079 from rxu/ticket/15502
[ticket/15502] Fix migrations
Diffstat (limited to 'phpBB/phpbb')
-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);