-
Notifications
You must be signed in to change notification settings - Fork 41
Issue #239337 Fix : Fixed "Invalid form" error when saving translated notifications with disabled email/webhook/SMS settings #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release-3.1.0
Are you sure you want to change the base?
Conversation
Caution Review failedFailed to post review comments WalkthroughThe pull request adds webhook backend support to a Joomla notification component, expanding from email and SMS backends to include webhooks. Changes include updated configuration settings, backend option registration, notification model enhancements for webhook validation and persistence, database schema updates to store webhook URLs and configuration flags, and installation scripts to manage schema migrations. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Model as notification.php
participant DB as Database
participant Logger as Logger
participant ComponentHelper as ComponentHelper
User->>Model: save(notification data)
Model->>Model: Determine new vs. existing<br/>(check data['id'])
Model->>ComponentHelper: Get global webhook URLs
ComponentHelper-->>Model: params (webhook URLs)
Model->>Model: Backend-specific validation
alt Backend is email
Model->>Model: Validate subject, body
else Backend is webhook
Model->>Model: Validate webhook URL<br/>(global or per-backend)
else Backend is sms
Model->>Model: Validate language, body
end
alt Validation fails
Model->>Logger: Log validation error
Model-->>User: Return false
else Validation passes
Model->>DB: Save notification
alt Save successful
Model->>DB: Insert/Update template config<br/>(webhook_url, use_global_webhook_url)
Model->>DB: Set params = json_encode([])
Model->>Model: Update model state<br/>(templateId, isNew flag)
Model-->>User: Return success
else Save failed
Model->>Logger: Log save failure
Model-->>User: Return false
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes The notification model file introduces substantial backend-specific validation logic, new state management for distinguishing new versus existing records, component parameter handling for global webhook URLs, and persistent storage of webhook configuration. Database schema changes involve significant constraint modifications and new column additions requiring careful review for data integrity implications. The changes span multiple architectural layers (configuration, validation, persistence, schema) with interconnected logic requiring careful verification of backend behavior consistency and database constraint compatibility. Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Summary by CodeRabbit
Release Notes
New Features
Chores