User tests: Successful: Unsuccessful:
Pull Request resolves #47799 and #47802 .
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.
{"file":"...","linktext":"..."}.#__fields_values.video_poster) to confirm the same fix applies.
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
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
@velisnolis please mark your test result at https://issues.joomla.org/tracker/joomla-cms/47804 by login using your github-account.
I have tested this item ✅ successfully on 12c4e7d
Tested successfully on Joomla 6.1.0 with PHP 8.4.
Test scenario:
file and linktext.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.
I have tested this item ✅ successfully on 12c4e7d
Tested successfully on Joomla 6.1.0 with PHP 8.4.
Test scenario:
file and linktext.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.
| Labels |
Added:
PR-6.1-dev
|
||
@velisnolis please run the test again. I had to make a few adjustments to ensure the expected internal tests run through.
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
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
Tested successfully on a Joomla 6.1.0 site running PHP 8.4.
Scenario tested:
fileandlinktext.{"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:
documentswith object containingfile: passesaudioswith object containingfile: passesvideoswith object containingfile: passesimageswith object containingimagefileand noalt_text: passesfile: failsSo the PR matches the observed issue and fixes the regression for document subform values.