Skip to content

Filter inactive values in getDynamicFieldByNameAndLangcode#7

Draft
Copilot wants to merge 2 commits intotf_nira_devfrom
copilot/fix-dynamic-field-value-parameter
Draft

Filter inactive values in getDynamicFieldByNameAndLangcode#7
Copilot wants to merge 2 commits intotf_nira_devfrom
copilot/fix-dynamic-field-value-parameter

Conversation

Copy link

Copilot AI commented Jan 31, 2026

The getDynamicFieldByNameAndLangcode method was returning all dynamic field values when withValue=true, including inactive ones. This is inconsistent with other methods in the codebase (e.g., getDynamicFieldDto) which filter by isActive status.

Changes

  • DynamicFieldServiceImpl.java: Added isActive and null check when populating JSON values array
// Before
for (int i = 0; i < lst.size(); i++) {
    l.add(new JSONObject(lst.get(i).getValueJson()));
}

// After  
for (int i = 0; i < lst.size(); i++) {
    if (lst.get(i).getIsActive() && lst.get(i).getValueJson() != null) {
        l.add(new JSONObject(lst.get(i).getValueJson()));
    }
}

When withValue=false, behavior is unchanged (returns null for jsonValues). When withValue=true, only active, non-null values are now included in the response.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repository.sonatype.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/admin-services/admin-services/admin/kernel-masterdata-service org.codehaus.plexus.classworlds.launcher.Launcher test -Dtest=DynamicFieldControllerTest#t000getDynamicFieldByNameTest3 -B (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

On DynamicFieldController.java:91-91, withValue parameter value is not considering


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Nagarjunakuchi88 <64436505+Nagarjunakuchi88@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix withValue parameter not being considered in DynamicFieldController Filter inactive values in getDynamicFieldByNameAndLangcode Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments