Open
Conversation
Prevents fatal error when scheduled_tasks table doesn't exist yet. The plugin now gracefully handles missing tables by: - Checking table existence using DB::getSchemaBuilder()->hasTable() before querying - Wrapping queries in try-catch blocks - Returning null/false instead of throwing exceptions This fixes the issue where plugin settings form crashes with: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'scheduled_tasks' doesn't exist The methods hasScheduledTasks() and getLastExecutionDate() are added with proper error handling to ensure the plugin works even when the scheduled_tasks table hasn't been created yet (common in fresh OJS installations or when scheduled tasks haven't been initialized).
Summary - Fix PLN plugin recognition in OJS by returning the canonical plugin name `plnplugin`. - Use correct PKP notification constants and namespaces. - Ensure success notifications are created without fatals when saving settings or enabling the plugin.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
plnplugin.Changes
use PKP\notification\Notification;Notification::NOTIFICATION_TYPE_SUCCESSfor saved settings noticeNotification::NOTIFICATION_TYPE_SUCCESSfor enable notice'plnplugin'(matches PluginRegistry lookups)Why
PluginRegistry::getPlugin('generic', 'plnplugin').PKPNotification) which caused fatals.Risks / Compat
Rollback
plugins/generic/pln/PlnPlugin.php.Checklist
logs/php_error.log