PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Freewindrider
Freewindrider
4 Aug 2026

Pull Request resolves #37029.

  • 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

The "URL" custom field (plugins/fields/url) lets an admin restrict the allowed scheme(s) via the schemes parameter, but that parameter was never actually read anywhere in the plugin code. When mailto is chosen as the only allowed scheme, the admin still has to type the mailto: prefix manually into the value - otherwise UrlFilter forces a http(s) scheme onto the value or resolves it as a path relative to the site root (e.g. https://example.com/firstname.lastname@example.com). If the prefix is typed manually as a workaround, it then shows up as visible link text on the frontend when "Show URL" is enabled.

This PR treats a field configured with mailto as the sole allowed scheme as a plain e-mail address field:

  • plugins/fields/url/src/Extension/Url.php: validates the raw input as an e-mail address (validate="email") and stores it raw (filter="raw"), so no scheme/host gets implicitly prepended.
  • plugins/fields/url/tmpl/url.php: builds the mailto: link itself from the raw value at render time, and strips any legacy manually-typed mailto: prefix from both stored value and displayed text, for backwards compatibility with existing data saved under the old (broken) behavior.

Testing Instructions

  1. Go to Content > Fields, create a custom field of type "URL".
  2. Under Field Options, set "Allowed Schemes" to only "MAILTO".
  3. Edit an article, enter a plain e-mail address (no mailto: prefix) into the field, and save - it should save without a validation warning.
  4. View the article on the frontend - the field should render as a working mailto: link, and (if "Show URL" is enabled) the displayed text should be the plain e-mail address, without a mailto: prefix.
  5. Existing data saved with a manually-typed mailto: prefix (the previously documented workaround) continues to render correctly, with the prefix stripped from the displayed text.

Actual result BEFORE applying this Pull Request

Setting "Allowed Schemes" to only mailto had no effect on validation or storage. A plain e-mail address entered into the field would fail URL validation. The only working approach was to manually type the mailto: prefix, which then also appeared as visible link text on the frontend when "Show URL" was enabled.

Expected result AFTER applying this Pull Request

A field restricted to the mailto scheme validates and stores a plain e-mail address correctly. The frontend renders it as a working mailto: link, and with "Show URL" enabled the displayed text is the plain e-mail address, without any mailto: prefix. Data previously saved with a manually-typed prefix (the old workaround) still renders correctly.

Link to documentations

  • No documentation changes for guide.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar Freewindrider Freewindrider - open - 4 Aug 2026
avatar Freewindrider Freewindrider - change - 4 Aug 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Aug 2026
Category Front End Plugins
avatar richard67
richard67 - comment - 4 Aug 2026

@Freewindrider Please respect our pull request template. You gave removed parts of it in your PR description, e.g. the reference to the Generative AI policy with the checkbox to acknowledge that you have read it.

Please add that back to your PR description and confirm the Generative AI policy.

Thanks in advance.

avatar richard67
richard67 - comment - 4 Aug 2026

@Freewindrider Please respect our pull request template. You gave removed parts of it in your PR description, e.g. the reference to the Generative AI policy with the checkbox to acknowledge that you have read it, or the actual result (i.e. without the PR) and the expected result (i.e. with the PR)..

Please add that back to your PR description and confirm the Generative AI policy.

Thanks in advance.

avatar brianteeman
brianteeman - comment - 5 Aug 2026

Glad to see this - I needed it last week

avatar Freewindrider Freewindrider - change - 5 Aug 2026
The description was changed
avatar Freewindrider Freewindrider - edited - 5 Aug 2026
avatar Freewindrider Freewindrider - change - 5 Aug 2026
Labels Added: PR-5.4-dev
avatar Freewindrider
Freewindrider - comment - 5 Aug 2026

Retested successfully with the proposed code-optimization (second commit).
@richard67 Please excuse for not having followed the template close enough. I beg you pardon for this is my first PR ever.

avatar richard67
richard67 - comment - 5 Aug 2026

@Freewindrider Thanks for your PR. Meanwhile we have discussed it in the CMS Maintenance Team and cam to the conclusion that it is not really a bug fix but an improvement, so it should be made for the 6.2-dev branch. See also here: #48080

Could you rebase this PR to 6.2-dev? If not, let me know if I can help with that.

Thanks in advance.

Add a Comment

Login with GitHub to post a comment