Skip to content

Commit 7432752

Browse files
authored
Merge pull request #30 from iMattPro/fixes
Fix migration uninstall error
2 parents 49d8d74 + 063f3df commit 7432752

9 files changed

Lines changed: 32 additions & 24 deletions

File tree

acp/wpn_acp_info.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public function module()
1616
{
1717
return [
1818
'filename' => '\phpbb\webpushnotifications\acp\wpn_acp_module',
19-
'title' => 'ACP_WEBPUSH_SETTINGS',
19+
'title' => 'ACP_WEBPUSH_EXT_SETTINGS',
2020
'modes' => [
2121
'webpush' => [
22-
'title' => 'ACP_WEBPUSH_SETTINGS',
22+
'title' => 'ACP_WEBPUSH_EXT_SETTINGS',
2323
'auth' => 'ext_phpbb/webpushnotifications && acl_a_server',
2424
'cat' => ['ACP_CLIENT_COMMUNICATION']
2525
],

acp/wpn_acp_module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function main($id, $mode)
7676
$this->lang->add_lang('webpushnotifications_module_acp', 'phpbb/webpushnotifications');
7777

7878
// Set the page title for our ACP page
79-
$this->page_title = $this->lang->lang('ACP_WEBPUSH_SETTINGS');
79+
$this->page_title = $this->lang->lang('ACP_WEBPUSH_EXT_SETTINGS');
8080

8181
if ($this->request->is_set_post('submit'))
8282
{

adm/style/wpn_acp_settings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% include 'overall_header.html' %}
22
{% INCLUDEJS '@phpbb_webpushnotifications/wpn_acp.js' %}
33

4-
<h1>{{ lang('ACP_WEBPUSH_SETTINGS') }}</h1>
4+
<h1>{{ lang('ACP_WEBPUSH_EXT_SETTINGS') }}</h1>
55

66
<p>{{ lang('ACP_WEBPUSH_SETTINGS_EXPLAIN') }}</p>
77

config/routing.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
phpbb_webpushnotifications_ucp_push_get_notification_controller:
2-
path: /push/notification
3-
defaults: { _controller: phpbb.wpn.ucp.controller.webpush:notification }
4-
5-
phpbb_webpushnotifications_ucp_push_worker_controller:
6-
path: /push/worker
7-
defaults: { _controller: phpbb.wpn.ucp.controller.webpush:worker }
8-
9-
phpbb_webpushnotifications_ucp_push_subscribe_controller:
10-
path: /push/subscribe
11-
defaults: { _controller: phpbb.wpn.ucp.controller.webpush:subscribe }
12-
13-
phpbb_webpushnotifications_ucp_push_unsubscribe_controller:
14-
path: /push/unsubscribe
15-
defaults: { _controller: phpbb.wpn.ucp.controller.webpush:unsubscribe }
1+
phpbb_ucp_routing:
2+
resource: wpn_ucp.yml
3+
prefix: /user

config/wpn_ucp.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
phpbb_webpushnotifications_ucp_push_get_notification_controller:
2+
path: /push/notification
3+
defaults: { _controller: phpbb.wpn.ucp.controller.webpush:notification }
4+
5+
phpbb_webpushnotifications_ucp_push_worker_controller:
6+
path: /push/worker
7+
defaults: { _controller: phpbb.wpn.ucp.controller.webpush:worker }
8+
9+
phpbb_webpushnotifications_ucp_push_subscribe_controller:
10+
path: /push/subscribe
11+
defaults: { _controller: phpbb.wpn.ucp.controller.webpush:subscribe }
12+
13+
phpbb_webpushnotifications_ucp_push_unsubscribe_controller:
14+
path: /push/unsubscribe
15+
defaults: { _controller: phpbb.wpn.ucp.controller.webpush:unsubscribe }

language/en/info_acp_webpushnotifications.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//
3939

4040
$lang = array_merge($lang, [
41-
'ACP_WEBPUSH_SETTINGS' => 'Web Push settings',
41+
'ACP_WEBPUSH_EXT_SETTINGS' => 'Web Push settings',
4242
'ACP_WEBPUSH_REMOVE_WARNING' => 'Web Push Notifications are now built-in to phpBB',
4343
'ACP_WEBPUSH_REMOVE_NOTICE' => 'The extension “phpBB Browser Push Notifications” is no longer needed and should be uninstalled.<br>All settings and user preferences associated with the extension will be migrated into phpBB‘s built-in push notifications when you uninstall the extension.',
4444
'LOG_CONFIG_WEBPUSH' => '<strong>Altered Web Push settings</strong>',

migrations/add_webpush.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function effectively_installed(): bool
2121

2222
public static function depends_on()
2323
{
24-
return ['\phpbb\webpushnotifications\migrations\handle_subscriptions'];
24+
return ['\phpbb\db\migration\data\v33x\v3312rc1'];
2525
}
2626

2727
public function update_schema(): array
@@ -72,7 +72,7 @@ public function update_data(): array
7272
['config.add', ['wpn_webpush_vapid_private', '']],
7373
['module.add', ['acp', 'ACP_CLIENT_COMMUNICATION', [
7474
'module_basename' => '\phpbb\webpushnotifications\acp\wpn_acp_module',
75-
'module_langname' => 'ACP_WEBPUSH_SETTINGS',
75+
'module_langname' => 'ACP_WEBPUSH_EXT_SETTINGS',
7676
'module_mode' => 'webpush',
7777
'after' => 'ACP_JABBER_SETTINGS',
7878
]]],
@@ -85,7 +85,7 @@ public function revert_data(): array
8585
['config.remove', ['wpn_webpush_enable']],
8686
['config.remove', ['wpn_webpush_vapid_public']],
8787
['config.remove', ['wpn_webpush_vapid_private']],
88-
['module.remove', ['acp', 'ACP_BOARD_CONFIGURATION', 'ACP_WEBPUSH_SETTINGS']]
88+
['module.remove', ['acp', 'ACP_BOARD_CONFIGURATION', 'ACP_WEBPUSH_EXT_SETTINGS']]
8989
];
9090
}
9191
}

migrations/handle_subscriptions.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
class handle_subscriptions extends migration
1616
{
17+
public static function depends_on()
18+
{
19+
return ['\phpbb\webpushnotifications\migrations\add_webpush'];
20+
}
21+
1722
public function effectively_installed()
1823
{
1924
return !$this->db_tools->sql_table_exists($this->table_prefix . 'wpn_notification_push');

tests/functional/functional_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function test_acp_module()
4040

4141
$crawler = self::request('GET', 'adm/index.php?i=-phpbb-webpushnotifications-acp-wpn_acp_module&mode=webpush&sid=' . $this->sid);
4242

43-
$this->assertContainsLang('ACP_WEBPUSH_SETTINGS', $crawler->filter('div.main > h1')->text());
43+
$this->assertContainsLang('ACP_WEBPUSH_EXT_SETTINGS', $crawler->filter('div.main > h1')->text());
4444
$this->assertContainsLang('ACP_WEBPUSH_SETTINGS_EXPLAIN', $crawler->filter('div.main > p')->text());
4545
$this->assertContainsLang('WEBPUSH_GENERATE_VAPID_KEYS', $crawler->filter('input[type="button"]')->attr('value'));
4646

0 commit comments

Comments
 (0)