PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar sathwikre
sathwikre
2 Feb 2026

Summary

Custom fields assigned to contact forms were always rendered at the end
of the form regardless of their configured display position.

What was wrong

The contact form template did not implement logic to render contact
custom fields based on their display parameter.

What this PR does

  • Groups contact custom fields by display position
  • Renders fields using FieldsHelper at the correct locations
  • Preserves layout overrides and permissions

How to test

  1. Create three custom fields with context com_contact.mail
  2. Set display to:
    • After Title
    • Before Display Content
    • After Display Content
  3. Allow "Edit Custom Field Value" for Public
  4. View the contact form in frontend

Result

Fields are rendered respecting their configured display positions.

Fixes #46700

avatar sathwikre sathwikre - open - 2 Feb 2026
avatar sathwikre sathwikre - change - 2 Feb 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Feb 2026
Category Repository Front End com_contact
avatar sathwikre sathwikre - change - 2 Feb 2026
Labels Added: PR-5.4-dev
avatar exlemor
exlemor - comment - 2 Feb 2026

@sathwikre - I am definitely not a good developer, but did I read this correctly that you are removing the 9 lines at the top of the screen which has licensing information for the file /components/com_contact/tmpl/contact/default_form.php, that is definitely not a good thing if that I understood it correctly.

I'm sure someone more knowledgeable than I can chime in on that.

avatar sathwikre
sathwikre - comment - 3 Feb 2026

@brianteeman
Thanks for the review.

I’ve restored the copyright header and removed the unnecessary inline
comment. The PR has also been cleaned up so it now only contains the
contact form change related to this issue.

avatar sathwikre
sathwikre - comment - 3 Feb 2026

@richard67
Thanks for pointing this out.

You’re right — those changes were not related to this PR. I’ve cleaned up
the branch and removed all unrelated commits so the PR now only addresses
the contact custom field display issue.

avatar sathwikre
sathwikre - comment - 3 Feb 2026

Suggested change accepted and conversation resolved

avatar Fedik
Fedik - comment - 3 Feb 2026

I am sorry but this fix is incorrect.
The fields should be rendered by Form class as rest of the fields.

The positioning need to be defined somewhere in the Contact Model or by Custom Fields plugin for the Contact form.

avatar sathwikre
sathwikre - comment - 3 Feb 2026

Thanks for the clarification.

Understood — rendering the custom fields directly in the template is not
the correct approach. I see now that the positioning logic should live in
the Contact model or be handled by the Custom Fields integration so that
the Form class is responsible for rendering, consistent with other
components.

I’ll take another look at how this should be implemented properly.

avatar richard67
richard67 - comment - 3 Feb 2026

@sathwikre Another thing is that it seems to be a new feature, so a PR should be made for the 6.1-dev branch.
See also https://github.com/joomla/joomla-cms?tab=readme-ov-file#which-branch-should-my-pull-request-target

avatar brianteeman
brianteeman - comment - 3 Feb 2026

@richard67 to me its a bug as you can currently set the display position of a custom field for a contact but it is ignored. This pr would fix that bug

avatar richard67
richard67 - comment - 3 Feb 2026

@richard67 to me its a bug as you can currently set the display position of a custom field for a contact but it is ignored. This pr would fix that bug

@brianteeman I see. Well then it should of course be done for 5.4-dev (if fixing the bug does not need to introduce a new feature),

Add a Comment

Login with GitHub to post a comment