Skip to content

Commit bdca268

Browse files
committed
Fix role exists install issues
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent adf82a5 commit bdca268

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030
],
3131
"require": {
32-
"php": ">=5.4",
32+
"php": ">=7.1.3",
3333
"composer/installers": "~1.0"
3434
},
3535
"require-dev": {
@@ -38,7 +38,7 @@
3838
"extra": {
3939
"display-name": "Board Rules",
4040
"soft-require": {
41-
"phpbb/phpbb": ">=3.2.0"
41+
"phpbb/phpbb": ">=3.3.2"
4242
},
4343
"version-check": {
4444
"host": "www.phpbb.com",

ext.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ class ext extends \phpbb\extension\base
3131
* The current phpBB version should meet or exceed
3232
* the minimum version required by this extension:
3333
*
34-
* Requires phpBB 3.2.0 due to new faq controller route for bbcodes,
35-
* the revised notifications system, font awesome and the text reparser.
34+
* Requires phpBB 3.3.2 due to using role_exists check in permission migration.
3635
*
3736
* @return bool
3837
* @access public
3938
*/
4039
public function is_enableable()
4140
{
42-
return phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>=');
41+
return phpbb_version_compare(PHPBB_VERSION, '3.3.2', '>=');
4342
}
4443

4544
/**

migrations/v10x/m5_initial_permission.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ public function update_data()
4040
array('permission.add', array('a_boardrules', true)),
4141

4242
// Set permissions
43-
array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_boardrules')),
44-
array('permission.permission_set', array('ROLE_ADMIN_STANDARD', 'a_boardrules')),
43+
array('if', array(
44+
array('permission.role_exists', array('ROLE_ADMIN_FULL')),
45+
array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_boardrules')),
46+
)),
47+
array('if', array(
48+
array('permission.role_exists', array('ROLE_ADMIN_STANDARD')),
49+
array('permission.permission_set', array('ROLE_ADMIN_STANDARD', 'a_boardrules')),
50+
)),
4551
);
4652
}
4753
}

0 commit comments

Comments
 (0)