PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar tecpromotion
tecpromotion
19 May 2026

Pull Request resolves #47799 and #47802 .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

AccessiblemediaField::setup() rejects any object value that does not have both imagefile and alt_text properties. That check was written when only image media was supported and never widened when the types attribute (images, audios, videos, documents) was added in 6.1.0 with PR #45013.

We’re really sorry we didn’t test this properly!

For non-image media inside a repeatable subform, the stored value looks like {"file":"files/example.pdf","linktext":"Download {filename}"}.
When the article edit form is reopened, this value is passed back to setup() as an object, fails the imagefile/alt_text property check, and setup() returns false — so the nested media field is never rendered.

The fix derives the expected file-property name (imagefile for images, file otherwise) the same way the form-XML builder and getInput() already do it ($fieldName = \in_array('images', $mediaTypes) ? 'imagefile' : 'file'), and checks for that single property.
Edit with commit 6ac4c93: Image-type validation is unchanged (both imagefile and alt_text still required); only the non-image branch is added, requiring file.

Behaviour for image-type fields is unchanged: an object with imagefilestill passes, and strings/non-objects are still handled as before.

Testing Instructions

  1. Create an article custom field of type Media (Document). Confirm it stores values shaped like {"file":"...","linktext":"..."}.
  2. Create a Subform custom field and add the document field from step 1 as a subform option, with Repeatable enabled.
  3. Edit an article, add a document inside the repeatable subform, and save.
  4. Before this patch: reopen the article — the subform row is rendered but the nested document field is missing; only the row controls appear. The saved value is still present in #__fields_values.
  5. With this patch: reopen the article — the document selector and link text input appear pre-populated with the saved value, and editing / re-saving round-trips correctly.
  6. Repeat with Audios and Videos (with and without video_poster) to confirm the same fix applies.
  7. Regression check: repeat with an Images accessible media subfield to confirm the existing image path still works.

Actual result BEFORE applying this Pull Request

2026-05-18_21-36-51

Expected result AFTER applying this Pull Request

image

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar tecpromotion tecpromotion - open - 19 May 2026
avatar tecpromotion tecpromotion - change - 19 May 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 May 2026
Category Libraries
avatar velisnolis
velisnolis - comment - 19 May 2026

Tested successfully on a Joomla 6.1.0 site running PHP 8.4.

Scenario tested:

  • Article custom field of type Media (Document), storing values with file and linktext.
  • Repeatable Subform custom field using that document field as the nested field.
  • Existing article with saved subform value like {"row0":{"field5":{"file":"images/3898600.pdf","linktext":"Download {filename}"}}}.

Before the fix, reopening the article edit form rendered only the repeatable row controls and the nested document field was missing.

After applying this PR patch, the document/media field renders again in the repeatable row and the saved file is visible/editable in the administrator form.

I also checked the setup behavior directly for non-image values:

  • documents with object containing file: passes
  • audios with object containing file: passes
  • videos with object containing file: passes
  • images with object containing imagefile and no alt_text: passes
  • invalid document object without file: fails

So the PR matches the observed issue and fixes the regression for document subform values.

avatar BeginnerJoomlaCom
BeginnerJoomlaCom - comment - 19 May 2026

@velisnolis please mark your test result at https://issues.joomla.org/tracker/joomla-cms/47804 by login using your github-account.

avatar velisnolis velisnolis - test_item - 19 May 2026 - Tested successfully
avatar velisnolis
velisnolis - comment - 19 May 2026

I have tested this item ✅ successfully on 12c4e7d

Tested successfully on Joomla 6.1.0 with PHP 8.4.

Test scenario:

  • Native Media (Document) custom field storing file and linktext.
  • The document field is used inside a repeatable Subform custom field.
  • Existing article had a saved subform value with a PDF file.

Before the patch, reopening the article edit form showed only the repeatable row controls; the nested document/media field was missing.

After applying PR #47804, the document/media field renders correctly inside the repeatable row, with the saved file visible and editable.

Also checked directly that documents, audios, and videos values with file pass setup, image values with imagefile still pass, and invalid document objects without file fail.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47804.

avatar velisnolis
velisnolis - comment - 19 May 2026

I have tested this item ✅ successfully on 12c4e7d

Tested successfully on Joomla 6.1.0 with PHP 8.4.

Test scenario:

  • Native Media (Document) custom field storing file and linktext.
  • The document field is used inside a repeatable Subform custom field.
  • Existing article had a saved subform value with a PDF file.

Before the patch, reopening the article edit form showed only the repeatable row controls; the nested document/media field was missing.

After applying PR #47804, the document/media field renders correctly inside the repeatable row, with the saved file visible and editable.

Also checked directly that documents, audios, and videos values with file pass setup, image values with imagefile still pass, and invalid document objects without file fail.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47804.

avatar tecpromotion tecpromotion - change - 19 May 2026
Labels Added: PR-6.1-dev
avatar tecpromotion tecpromotion - change - 19 May 2026
The description was changed
avatar tecpromotion tecpromotion - edited - 19 May 2026
avatar tecpromotion
tecpromotion - comment - 19 May 2026

@velisnolis please run the test again. I had to make a few adjustments to ensure the expected internal tests run through.

avatar velisnolis velisnolis - test_item - 19 May 2026 - Tested successfully
avatar velisnolis
velisnolis - comment - 19 May 2026

I have tested this item ✅ successfully on 6ac4c93

Yesys results:

documents=true
audios=true
videos=true
images_with_alt=true
images_no_alt=false
bad_document=false


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47804.

avatar velisnolis
velisnolis - comment - 19 May 2026

I have tested this item ✅ successfully on 6ac4c93

Yesys results:

documents=true
audios=true
videos=true
images_with_alt=true
images_no_alt=false
bad_document=false


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47804.

Add a Comment

Login with GitHub to post a comment