bug: missing asset_id and params in article creation data #94

Closed
opened 2026-05-22 03:29:51 +00:00 by jmiller · 1 comment
Owner

Description

The $data array in createTermsArticle() (script.php:217-228) is missing asset_id, params, metadata, and attribs fields. Joomla's ContentTable::store() attempts to create an asset record which may fail on strict Joomla 5 installs if these fields are absent.

Impact

Article may be stored without ACL protection, or check() may fail silently on some Joomla configurations.

Fix

Add default values for params, metadata, attribs to the data array.

Files

  • src/script.php:217-228
## Description The `$data` array in `createTermsArticle()` (script.php:217-228) is missing `asset_id`, `params`, `metadata`, and `attribs` fields. Joomla's `ContentTable::store()` attempts to create an asset record which may fail on strict Joomla 5 installs if these fields are absent. ## Impact Article may be stored without ACL protection, or `check()` may fail silently on some Joomla configurations. ## Fix Add default values for `params`, `metadata`, `attribs` to the data array. ## Files - `src/script.php:217-228`
jmiller added the joomlapriority: highbug labels 2026-05-22 03:29:51 +00:00
Author
Owner

Testing Steps -- Article creation with params/metadata defaults

Setup

  1. Fresh Joomla 5.x install with debug mode enabled and error reporting = Maximum

Test

  1. Install the plugin (fresh, no existing Terms of Service article)
  2. Check the Joomla debug console for any warnings about missing fields
  3. Go to Content > Articles > Terms of Service -- open the article
  4. Click the Publishing tab -- verify metadata fields are present and editable
  5. Click the Options tab -- verify article display options are present
  6. Expected: No PHP notices about undefined indices or missing properties

Pass criteria

  • Article created without PHP warnings
  • Article metadata and options tabs work correctly in admin
## Testing Steps -- Article creation with params/metadata defaults ### Setup 1. Fresh Joomla 5.x install with **debug mode enabled** and **error reporting = Maximum** ### Test 1. Install the plugin (fresh, no existing Terms of Service article) 2. Check the Joomla debug console for any warnings about missing fields 3. Go to **Content > Articles > Terms of Service** -- open the article 4. Click the **Publishing** tab -- verify metadata fields are present and editable 5. Click the **Options** tab -- verify article display options are present 6. **Expected:** No PHP notices about undefined indices or missing properties ### Pass criteria - [ ] Article created without PHP warnings - [ ] Article metadata and options tabs work correctly in admin
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomTOS#94