1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-20 23:51:28 +01:00

Merge pull request #5079 from rxu/ticket/15502

[ticket/15502] Fix migrations
This commit is contained in:
Derky 2018-01-12 07:30:51 +01:00
commit 7f6ececf95
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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);