Feature Language Change Conflicting Files Updates Requested PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar CraftException
CraftException
11 Jun 2025

Pull Request for Issue # .

Summary of Changes

Added getField method to FieldsHelper.php to get a single field instead of every field of an item.

Testing Instructions

Actual result BEFORE applying this Pull Request

If you want to get a single field of an item, you have to foreach trough every field, until you found the correct field.

Expected result AFTER applying this Pull Request

You can now just use this function.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
5.00

avatar CraftException CraftException - open - 11 Jun 2025
avatar CraftException CraftException - change - 11 Jun 2025
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Jun 2025
Category ⇒ Administration com_fields
avatar CraftException CraftException - change - 11 Jun 2025
Labels Added: PR-6.0-dev
avatar CraftException CraftException - change - 12 Jun 2025
The description was changed
avatar CraftException CraftException - edited - 12 Jun 2025
avatar CraftException CraftException - change - 17 Jun 2025
Labels Added: Feature
avatar Ruud68
Ruud68 - comment - 20 Jun 2025

Is there a reason why you do not do a $this->getFields(...) and then return the field with Id if it exists?
That would save a lot of (duplicated) code in the new function?

so something like this:

public static function getField(
        $context,
        $fieldId,
        $item = null,
        $prepareValue = false,
        ?object $valueToOverride = null,
        bool $includeSubformFields = false
    ) {
        $fields = $this->getFields($context, $item, $prepareValue, $valuesToOverride, $includeSubformFields);
        $fields = array_column($fields, NULL, 'id');
        return $fields[$fieldId] ?? null;
}
avatar HLeithner
HLeithner - comment - 31 Aug 2025

This pull request has been automatically rebased to 6.1-dev.

avatar HLeithner HLeithner - change - 31 Aug 2025
Title
…
Added getField method to FieldsHelper.php
[6.1] Added getField method to FieldsHelper.php
avatar HLeithner HLeithner - edited - 31 Aug 2025
avatar HLeithner
HLeithner - comment - 17 Mar 2026

This pull request has been automatically rebased to 6.2-dev.

avatar HLeithner HLeithner - change - 17 Mar 2026
Title
…
[6.1] Added getField method to FieldsHelper.php
[6.2] Added getField method to FieldsHelper.php
avatar HLeithner HLeithner - edited - 17 Mar 2026
avatar CraftException CraftException - change - 31 Aug 2026
Labels Added: Updates Requested PR-6.2-dev
Removed: PR-6.0-dev
avatar joomla-cms-bot joomla-cms-bot - change - 31 Aug 2026
Category Administration com_fields ⇒ Repository SQL Administration com_admin Postgresql com_banners com_categories com_config com_fields com_finder com_installer com_menus com_modules com_tags com_templates com_users Language & Strings
avatar github-actions[bot]
github-actions[bot] - comment - 31 Aug 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

avatar Webman-WebDesign Webman-WebDesign - change - 1 Sep 2026
Status Pending ⇒ Closed
Closed_Date 0000-00-00 00:00:00 ⇒ 2026-09-01 07:11:27
Closed_By ⇒ Webman-WebDesign
Labels Added: Language Change Conflicting Files
avatar Webman-WebDesign Webman-WebDesign - close - 1 Sep 2026

Add a Comment

Login with GitHub to post a comment