[BUG]: Media field type doesn't allow for attribute 'types' by default #1222
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What Happened?
The Joomla documentation describes the attribute 'types' for the media field, but this is not in the default properties when creating a new field with the type 'media'.

Clicking the + icon to create a new property when creating a field does not add a new property.
Steps to reproduce the Bug
Additionally the fields 'preview_width' and 'preview_height' are also not defined.
Which Joomla version are you compiling in?
4.4.9
Which PHP version are you compiling in?
8.1
Which Joomla versions are you targeting?
4.4.9
Which PHP version are you targeting?
8.1
Which Web server is JCB running on?
Ubuntu
Which Relational Database is JCB running on?
Mysql
Which OS is JCB running on?
CentOs
Which JCB version are you using?
4.1.1-alpha3
Where in JCB did this issue occur?
Field(admin_view)
On which browsers did you encounter the issue?
Firefox
Additional Comments
No response
Hi @SimonvanDoorne, I tried duplicating the issue but I do not see any options on the media fieldtype as you describe.
There is also only one type field and it the one that determines which fieldtype we are working with.
Could you kindly explain a bit more on this?
Hi Lemuel,


When comparing the joomla documentation and the actual parameters for the fieldtype media, there are 3 missing fields in JCB. I agree that the 'types' parameter naming scheme is confusing, but the documentation defines both 'type' (as all fields have) and 'types', which defines the file types to show.
I created the ticket because we wanted to add a PDF file selector, but since the default is images, the media selector doesn't show pdf files. You can still override the field when it's in a form object with $form->setFieldAttribute( so it's not super important to fix this second.
Contributing and Maintaining JCB Field Types via Repository (New Simplified Workflow)
With the growth of JCB, the management of field types has been externalized into a Git-based system, allowing developers and contributors to update, initialize, reset, and share field type configurations via remote repositories.
This system introduces collaborative power and flexibility while still supporting simplicity for those just wanting to pull in updates. Below is a clear and accurate guide on how this works — including how to make your own updates and optionally contribute them back to the core.
Step-by-Step Guide
1. Understand the New Repository-Based Architecture
JCB uses one or more Git repositories to:
These actions are handled through configured repositories listed under the Repositories section in JCB.
2. Fork the Official Repository
To start:
This fork will be used to maintain your custom field types and optionally submit pull requests back to the core.
3. Update the Existing Repository Entry in JCB
JCB already ships with a repository entry called:
Do not create a new repository entry. Instead, update the existing one:
Open the existing repository entry in JCB
Update:
joomla-fieldtypes
(or your custom fork name)master
(used for pulling/initting/resetting field types)master
orcontributions
(this is crucial — it enables the Push button)Important:
The presence of a Write Branch value is what tells JCB this repository can receive pushed changes. Without it, push will be disabled.
Also add:
4. Avoid Multiple Push Targets
You can configure multiple repositories for field types, but only one should have a write branch set.
5. Control Which Repository is Used First (Init/Reset Priority)
JCB will use the ordering value to determine which repository to search first during init/reset operations.
So, if a field type exists in multiple repositories, JCB will use the first one that matches, based on this ordering. If you want to override a core field type with your custom version, just make sure your repository has a lower ordering number than the default/core one.
6. Push Your Field Type Changes
Once configured:
Go to Field Types in JCB
Edit or create a field type
Select it, then click Push
items.json
to the write-branch of your configured repository7. Init or Reset Field Types
When initializing, you will be able to choose the repository to pull from — JCB will show you a list of all available field types from that repository.
When resetting, JCB will search the repositories from first to last (order) and the first time it finds that field type it will reset it with values it found at that repository..
8. Core Field Type Integrity & Maintenance
Each core field type in JCB (e.g.,
media
,calendar
,color
,checkboxes
) is identified by a globally unique ID (GUID). This ensures consistent references across projects and updates.Important constraints:
color
field types)This approach preserves the integrity of field type identification while supporting both customization and community enhancement.
9. Contribute Back to the Community (Optional)
If you've created or improved a field type:
Include a short description of the enhancements, e.g.:
Once reviewed, this may be merged into the official field types, and the JCB distribution package will be updated accordingly.
Recap
Why This Matters
This system empowers you to:
Thank you for your contribution and for highlighting the enhancements to the
media
field type. The changes you've suggested in this issue will be implemented and included in the next JCB release there is no need to follow the full process described above for this change.You are welcome to continue submitting requests as issues here this remains a valid and encouraged path. The process described above is simply an introduction to our new, more collaborative system, and serves as the first detailed baseline for upcoming documentation related to JCB’s external configuration support.
We’re grateful for your input, and these kinds of enhancements ensure JCB remains in step with Joomla’s evolving capabilities.
If you in your local system open the media type, and click [reset].
The update should be loaded 👍 now... that is the new system (JCB v5.1.1-alpha) in action... enjoy!!!