-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#10511 remove invalid series navigation menu items
- Loading branch information
1 parent
6d5eefa
commit db22420
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
classes/migration/upgrade/v3_5_0/I10511_RemoveSeriesMenuItems.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/migration/upgrade/v3_5_0/I10511_RemoveSeriesMenuItems.php | ||
* | ||
* Copyright (c) 2024 Simon Fraser University | ||
* Copyright (c) 2024 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class I10511_RemoveSeriesMenuItems | ||
* | ||
* @brief Remove invalid series menu items. | ||
*/ | ||
|
||
namespace APP\migration\upgrade\v3_5_0; | ||
|
||
use Illuminate\Support\Facades\DB; | ||
use PKP\install\DowngradeNotSupportedException; | ||
use PKP\migration\Migration; | ||
|
||
class I10511_RemoveSeriesMenuItems extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
DB::table('navigation_menu_items') | ||
->where('type', 'NMI_TYPE_SERIES') | ||
->where('path', '�*�escapeWhenCastingToString') | ||
->delete('navigation_menu_item_id'); | ||
} | ||
|
||
/** | ||
* Reverse the downgrades | ||
* | ||
* @throws DowngradeNotSupportedException | ||
*/ | ||
public function down(): void | ||
{ | ||
throw new DowngradeNotSupportedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters