Fixed: Service credential fields never saved from form to DB #85

Open
opened 2026-05-29 05:30:23 +00:00 by jmiller · 1 comment
Owner

Fixed in commit 8dd6fdd

Severity: Critical — extension was non-functional

What was wrong:
The service edit form has individual cred_* fields (e.g., cred_twitter_api_key) but the DB stores credentials as a single JSON column. The model never collected individual fields into JSON on save, and never expanded JSON back to fields on load.

Fix applied:

  • ServiceModel::save() now collects all cred_* fields, strips the cred_{service_type}_ prefix, JSON-encodes into credentials column
  • ServiceModel::loadFormData() expands credentials JSON back into individual form fields for editing
  • Individual cred_* keys are removed from data before table save

Files: ServiceModel.php

Label: priority: critical, status: pending-testing

## Fixed in commit 8dd6fdd **Severity:** Critical — extension was non-functional **What was wrong:** The service edit form has individual `cred_*` fields (e.g., `cred_twitter_api_key`) but the DB stores credentials as a single JSON column. The model never collected individual fields into JSON on save, and never expanded JSON back to fields on load. **Fix applied:** - `ServiceModel::save()` now collects all `cred_*` fields, strips the `cred_{service_type}_` prefix, JSON-encodes into `credentials` column - `ServiceModel::loadFormData()` expands credentials JSON back into individual form fields for editing - Individual `cred_*` keys are removed from data before table save **Files:** `ServiceModel.php` **Label:** `priority: critical`, `status: pending-testing`
Author
Owner

Branch created: feature/85-fixed-service-credential-fields-never-sa

git fetch origin
git checkout feature/85-fixed-service-credential-fields-never-sa
Branch created: [`feature/85-fixed-service-credential-fields-never-sa`](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomCross/src/branch/feature/85-fixed-service-credential-fields-never-sa) ```bash git fetch origin git checkout feature/85-fixed-service-credential-fields-never-sa ```
Sign in to join this conversation.
Type Bug
Status
Priority Critical
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomCross#85