pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
306 stars 445 forks source link

Upgrade fails if a theme plugin is installed but not yet copied into the themes directory location #8415

Closed Vitaliy-1 closed 1 year ago

Vitaliy-1 commented 1 year ago

Describe the bug Considering this as a bug as a step to copy plugins before running an upgrade script isn't reflected in the upgrade documentation:

2022-11-10 13:54:57 [pre-install]
2022-11-10 13:54:57 [load: upgrade.xml]
2022-11-10 13:54:57 [version: 3.4.0.0]
2022-11-10 13:54:57 [code: Installer Installer::checkPhpVersion]
2022-11-10 13:54:57 [code: Installer Installer::installDefaultNavigationMenus]
WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
2022-11-10 13:54:57 [code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
2022-11-10 13:54:57 [migration: APP\migration\upgrade\OJSv3_3_0UpgradeMigration]
2022-11-10 13:57:08 [note: docs/release-notes/README-3.3.0]
2022-11-10 13:57:08 [migration: APP\migration\upgrade\v3_4_0\PreflightCheckMigration]
2022-11-10 13:57:10 [Nulling non-existent source_submission_file_id 0 in submission_files.]
2022-11-10 13:57:10 [migration: APP\migration\upgrade\v3_4_0\I7129_IssueEntityDAORefactor]
2022-11-10 13:57:11 [migration: APP\migration\upgrade\OJSv3_3_1_i6872_UrlPathMigration]
2022-11-10 13:57:11 [migration: APP\migration\upgrade\v3_4_0\I6091_AddFilterNamespaces]
2022-11-10 13:57:11 [migration: APP\migration\upgrade\v3_4_0\I6093_AddForeignKeys]
2022-11-10 13:57:57 [migration: PKP\migration\upgrade\v3_4_0\FailedJobsMigration]
2022-11-10 13:57:57 [migration: PKP\migration\upgrade\v3_4_0\UpgradeMigration]
2022-11-10 13:57:59 [migration: APP\migration\upgrade\v3_4_0\I6807_SetLastModified]
2022-11-10 13:57:59 [migration: APP\migration\upgrade\v3_4_0\I4235_OAISetSpec]
2022-11-10 13:57:59 [migration: PKP\migration\upgrade\v3_4_0\I7167_RemoveDuplicatedUserSettingsAndDeprecatedFields]
2022-11-10 13:58:00 [migration: APP\migration\upgrade\v3_4_0\I7264_UpdateEmailTemplates]
2022-11-10 13:58:02 [migration: APP\migration\upgrade\v3_4_0\I7596_RemoveNonExpiring]
2022-11-10 13:58:02 [migration: APP\migration\upgrade\v3_4_0\I7014_DoiMigration]
2022-11-10 13:58:12 [migration: APP\migration\upgrade\v3_4_0\I7265_EditorialDecisions]
2022-11-10 13:58:13 [migration: PKP\migration\upgrade\v3_4_0\I7624_StrftimeDeprecation]
2022-11-10 13:58:13 [migration: PKP\migration\upgrade\v3_4_0\I7592_RemoveUnusedEmailTemplates]
2022-11-10 13:58:13 [migration: PKP\migration\upgrade\v3_4_0\I7126_Galleys]
2022-11-10 13:58:13 [migration: APP\migration\upgrade\v3_4_0\I7190_RemoveOrphanFilters]
2022-11-10 13:58:13 [migration: PKP\migration\upgrade\v3_4_0\I7190_UpdateFilters]
2022-11-10 13:58:13 [migration: PKP\migration\upgrade\v3_4_0\I8060_UpdateUserLocalesDefaultToEmptyArrayFromNull]
2022-11-10 13:58:13 [migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]
2022-11-10 13:58:20 [migration: PKP\migration\upgrade\v3_4_0\I6895_CreateNewInstitutionsTables]
2022-11-10 13:58:22 [migration: PKP\migration\upgrade\v3_4_0\I8073_RemoveNotesWithoutQueriesAndRelatedObjects]
2022-11-10 13:58:27 [migration: APP\migration\upgrade\v3_4_0\I6895_Institutions]
2022-11-10 13:58:27 [migration: APP\migration\upgrade\v3_4_0\I6782_OrphanedMetrics]
2022-11-10 13:58:29 [migration: PKP\migration\upgrade\v3_4_0\I6782_UsageStatsSettings]
Exception: Plugin bootstrap3 expected to inherit from BootstrapThreeThemePlugin, actual type NULL in /home/doc/OJS/development/ojs/lib/pkp/classes/plugins/PluginRegistry.php:202
Stack trace:
#0 /home/doc/OJS/development/ojs/lib/pkp/classes/plugins/PluginRegistry.php(218): PKP\plugins\PluginRegistry::_instantiatePlugin()
#1 /home/doc/OJS/development/ojs/lib/pkp/classes/plugins/PluginRegistry.php(111): PKP\plugins\PluginRegistry::_loadFromDatabase()
#2 /home/doc/OJS/development/ojs/lib/pkp/classes/migration/upgrade/v3_4_0/I6782_UsageStatsSettings.php(103): PKP\plugins\PluginRegistry::loadCategory()
#3 /home/doc/OJS/development/ojs/lib/pkp/classes/install/Installer.php(457): PKP\migration\upgrade\v3_4_0\I6782_UsageStatsSettings->up()
#4 /home/doc/OJS/development/ojs/lib/pkp/classes/install/Installer.php(286): PKP\install\Installer->executeAction()
#5 /home/doc/OJS/development/ojs/lib/pkp/classes/install/Installer.php(201): PKP\install\Installer->executeInstaller()
#6 /home/doc/OJS/development/ojs/lib/pkp/classes/cliTool/UpgradeTool.php(95): PKP\install\Installer->execute()
#7 /home/doc/OJS/development/ojs/lib/pkp/classes/cliTool/UpgradeTool.php(68): PKP\cliTool\UpgradeTool->upgrade()
#8 /home/doc/OJS/development/ojs/tools/upgrade.php(21): PKP\cliTool\UpgradeTool->execute()
#9 {main}
2022-11-10 13:58:29 [revert migration: APP\migration\upgrade\v3_4_0\I6782_OrphanedMetrics]
2022-11-10 13:58:29 [downgrade for "APP\migration\upgrade\v3_4_0\I6782_OrphanedMetrics" unsupported: Downgrade not supported]
ERROR: Upgrade failed: DB: Invalid product name "default-child"

(test upgrade from 3.2.1 to the current main branch) To Reproduce Steps to reproduce the behavior:

  1. Have an OJS instance with an installed theme
  2. Perform preparation for upgrade according to the upgrade docs
  3. Don't copy the theme plugin package to the OJS theme plugin folder
  4. Run an upgrade

What application are you using? OJS main branch

asmecher commented 1 year ago

@Vitaliy-1, I think this is a misdiagnosis of the problem; it's actually the - in the plugin name (default-child). I don't think we intentionally supported hyphens in plugin names before, and I've never seen one written that way. The default child theme might've suggested this in its documentation; I've updated that in main to use our usual lowerCamelCase convention.