Skip to content

Commit

Permalink
Fix Curaçao name from m13 migration file. File was set to ANSI.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcgirr83 committed Dec 11, 2020
1 parent 5fcb19c commit d16410d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "Allows a user to be able to choose a national flag and have a top (those with the most users selecting the flag) number of flags display on the index page of a phpBB forum. Header is link to a listing of all users of a flag. Clicking on user count of the flag displays the users that have that flag set. This extension requires at least phpBB version 3.2.6. Must have version 2.0.0 of Collapsible Forum Categories to take advantage of that extension.",
"homepage": "https://github.com/rmcgirr83/nationalflags",
"version": "2.2.5",
"time": "2020-10-21",
"version": "2.2.6",
"time": "2020-12-11",
"keywords": [
"phpbb",
"extension",
Expand Down
2 changes: 1 addition & 1 deletion migrations/m13_update_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function flag_update_image()
{
$sql_ary = [
[
'flag_name' => 'Curaçao',
'flag_name' => 'Curaçao',
'flag_image' => 'cw.png',
],
];
Expand Down
49 changes: 49 additions & 0 deletions migrations/m14_update_data.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
*
* @package National Flags
* @copyright (c) 2020 Rich Mcgirr (RMcGirr83)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

namespace rmcgirr83\nationalflags\migrations;

class m14_update_data extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return ['\rmcgirr83\nationalflags\migrations\m13_update_data'];
}

public function update_data()
{
return [
['custom', [
[&$this, 'flag_update_image']
]],
];
}

public function flag_update_image()
{
if ($this->db_tools->sql_table_exists($this->table_prefix . 'flags'))
{
$sql_ary = [
[
'flag_name' => 'Curaçao',
'flag_image' => 'cw.png',
],
];
foreach ($sql_ary as $num => $flag)
{
$sql = 'UPDATE ' . $this->table_prefix . 'flags
SET ' . $this->db->sql_build_array('UPDATE', [
'flag_name' => (string) $flag['flag_name']]
) .
" WHERE flag_image = '" . (string) $flag['flag_image'] . "'";
$this->db->sql_query($sql);
}
}
}
}

0 comments on commit d16410d

Please sign in to comment.