Skip to content

Commit 84011a4

Browse files
authored
Merge pull request #107 from VSEphpbb/develop
Ideas fixes and testing on phpBB 3.3
2 parents ddb9b42 + 2680acb commit 84011a4

26 files changed

Lines changed: 103 additions & 139 deletions

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ trim_trailing_whitespace = true
1313
trim_trailing_whitespace = false
1414

1515
[*.yml]
16-
indent_size = 4
1716
indent_style = space

.travis.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
language: php
2+
dist: xenial
23

34
matrix:
45
include:
5-
- php: 5.5
6+
- php: 7.1
67
env: DB=none;NOTESTS=1
7-
- php: 5.4
8-
env: DB=mysqli #myisam
9-
- php: 5.4
10-
env: DB=mysql
11-
- php: 5.4
8+
- php: 7.1
129
env: DB=mariadb
13-
- php: 5.4
10+
- php: 7.1
1411
env: DB=postgres
15-
- php: 5.5
16-
env: DB=mysqli
17-
- php: 5.6
18-
env: DB=mysqli
19-
- php: 7.0
20-
env: DB=mysqli
2112
- php: 7.1
22-
env: DB=mysqli
13+
env: DB=mysqli # MyISAM
2314
- php: 7.2
2415
env: DB=mysqli
16+
- php: 7.3
17+
env: DB=mysqli
18+
- php: 7.4snapshot
19+
env: DB=mysqli
2520
- php: nightly
2621
env: DB=mysqli
2722
allow_failures:
@@ -34,15 +29,21 @@ env:
3429
- SNIFF="1" # Should we run code sniffer on your code?
3530
- IMAGE_ICC="1" # Should we run icc profile sniffer on your images?
3631
- EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
37-
- PHPBB_BRANCH="3.2.x"
32+
- PHPBB_BRANCH="3.3.x"
3833

3934
branches:
4035
only:
4136
- master
37+
- develop
38+
- /^develop-.*$/
4239
- /^\d+(\.\d+)?\.x$/
4340

41+
services:
42+
- postgresql
43+
- mysql
44+
4445
install:
45-
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
46+
- travis/prepare-phpbb.sh $PHPBB_BRANCH
4647
- cd ../../phpBB3
4748
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
4849
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS

acp/ideas_module.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ class ideas_module
1616
public $u_action;
1717

1818
/**
19-
* Main ACP module
20-
*
21-
* @access public
22-
*/
19+
* Main ACP module
20+
*
21+
* @access public
22+
* @throws \Exception
23+
*/
2324
public function main()
2425
{
2526
global $phpbb_container;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"extra": {
4141
"display-name": "phpBB Ideas",
4242
"soft-require": {
43-
"phpbb/phpbb": ">=3.2.0,<3.4"
43+
"phpbb/phpbb": ">=3.2.1,<3.4"
4444
}
4545
}
4646
}

controller/idea_controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function idea($idea_id)
4242
$mode = $this->request->variable('mode', '');
4343
if (!empty($mode) && $this->request->is_ajax())
4444
{
45-
$result = call_user_func(array($this, $mode));
45+
$result = $this->$mode();
4646

4747
return new \Symfony\Component\HttpFoundation\JsonResponse($result);
4848
}

event/listener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function __construct(auth $auth, config $config, helper $helper, ideas $i
7878
/**
7979
* @inheritDoc
8080
*/
81-
static public function getSubscribedEvents()
81+
public static function getSubscribedEvents()
8282
{
8383
return array(
8484
'core.viewforum_get_topic_data' => 'ideas_forum_redirect',
@@ -334,9 +334,9 @@ public function viewonline_ideas($event)
334334
public function edit_idea_title($event)
335335
{
336336
if ($event['mode'] !== 'edit' ||
337+
$event['post_data']['topic_first_post_id'] != $event['post_id'] ||
337338
!$event['update_subject'] ||
338-
!$this->is_ideas_forum($event['forum_id']) ||
339-
$event['post_data']['topic_first_post_id'] != $event['post_id'])
339+
!$this->is_ideas_forum($event['forum_id']))
340340
{
341341
return;
342342
}

ext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class ext extends \phpbb\extension\base
2525
* The current phpBB version should meet or exceed
2626
* the minimum version required by this extension:
2727
*
28-
* Requires phpBB 3.2.0
28+
* Requires phpBB 3.2.1 due to use of $event->update_subarray();
2929
*
3030
* @return bool
3131
* @access public
3232
*/
3333
public function is_enableable()
3434
{
35-
return phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>=');
35+
return phpbb_version_compare(PHPBB_VERSION, '3.2.1', '>=');
3636
}
3737
}

factory/ideas.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public function set_title($idea_id, $title)
421421
* @param int $user_id The ID of the user voting.
422422
* @param int $value Up (1) or down (0)?
423423
*
424-
* @return array Array of information.
424+
* @return array|string Array of information or string on error.
425425
*/
426426
public function vote(&$idea, $user_id, $value)
427427
{

phpunit.xml.dist

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
verbose="true"
1312
bootstrap="../../../../tests/bootstrap.php"
1413
>
@@ -19,17 +18,14 @@
1918
<exclude>./tests/ui</exclude>
2019
</testsuite>
2120
<testsuite name="Extension Functional Tests">
22-
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">./tests/functional/</directory>
21+
<directory suffix="_test.php">./tests/functional/</directory>
2322
</testsuite>
2423
<testsuite name="Extension UI Tests">
25-
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">./tests/ui/</directory>
24+
<directory suffix="_test.php">./tests/ui</directory>
2625
</testsuite>
2726
</testsuites>
2827

2928
<filter>
30-
<blacklist>
31-
<directory>./tests/</directory>
32-
</blacklist>
3329
<whitelist processUncoveredFilesFromWhitelist="true">
3430
<directory suffix=".php">./</directory>
3531
<exclude>

styles/prosilver/template/ideas.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
e.preventDefault();
141141

142142
$obj.rfcEdit.add($obj.rfcLink).hide();
143-
$obj.rfcEditInput.show().focus();
143+
$obj.rfcEditInput.show().trigger('focus');
144144
});
145145

146146
$obj.rfcEditInput.on('keydown', function(e) {
@@ -190,7 +190,7 @@
190190
e.preventDefault();
191191

192192
$obj.ticketEdit.add($obj.ticketLink).hide();
193-
$obj.ticketEditInput.show().focus();
193+
$obj.ticketEditInput.show().trigger('focus');
194194
});
195195

196196
$obj.ticketEditInput.on('keydown', function(e) {
@@ -245,7 +245,7 @@
245245
e.preventDefault();
246246

247247
$obj.duplicateEdit.add($obj.duplicateLink).hide();
248-
$obj.duplicateEditInput.show().focus();
248+
$obj.duplicateEditInput.show().trigger('focus');
249249
});
250250

251251
$obj.duplicateEditInput.on('keydown', function(e) {
@@ -301,7 +301,7 @@
301301
e.preventDefault();
302302

303303
$obj.implementedEdit.add($obj.implementedVersion).hide();
304-
$obj.implementedEditInput.show().focus();
304+
$obj.implementedEditInput.show().trigger('focus');
305305
});
306306

307307
$obj.implementedEditInput.on('keydown', function(e) {
@@ -310,7 +310,7 @@
310310
e.stopPropagation();
311311

312312
var $this = $(this),
313-
find = /^\d\.\d\.\d+(\-\w+)?$/,
313+
find = /^\d\.\d\.\d+(-\w+)?$/,
314314
url = $obj.implementedEdit.attr('href'),
315315
value = $this.val();
316316

0 commit comments

Comments
 (0)