Skip to content

Commit

Permalink
pkp/pkp-lib#10511 remove invalid series navigation menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson committed Nov 22, 2024
1 parent 6d5eefa commit db22420
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions classes/migration/upgrade/v3_5_0/I10511_RemoveSeriesMenuItems.php
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();
}
}
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
<migration class="APP\migration\upgrade\v3_5_0\I5885_RenameReviewReminderSettingsName"/>
<migration class="PKP\migration\upgrade\v3_5_0\COA75_AddUserRoleEndEmail"/>
<migration class="APP\migration\upgrade\v3_5_0\I10561_OnixFilter"/>
<migration class="APP\migration\upgrade\v3_5_0\I10511_RemoveSeriesMenuItems"/>
</upgrade>

<!-- Update plugin configuration - should be done as the final upgrade task -->
Expand Down

0 comments on commit db22420

Please sign in to comment.