adobe / aem-core-forms-components

Apache License 2.0
26 stars 50 forks source link

Custom Functions Error in adaptive Forms #1060

Open shravanthprasad opened 8 months ago

shravanthprasad commented 8 months ago

Expected Behaviour

Rule editor to set value of component using function output

Actual Behaviour

Error function not found

image

Reproduce Scenario (including but not limited to)

1.Create a client library with a custom function 2.Add clientlibrary to form container 3.Go to form field and click on rule editor 4.Create a rule and set value of field from function output 5.Close 6.Switch to preview mode

Steps to Reproduce

Platform and Version

AEM 6.5.17 Core components version 2.23.4 Form Core Components version 1.1.32

AEM Version (mention the exact version in case of cloud SDK)

AEM 6.5.17

AEM Forms Version

1.1.32

Sample Code that illustrates the problem

/**

rismehta commented 8 months ago

@shravanthprasad, we have a test collateral for this use case. You can review the test specification at https://github.com/adobe/aem-core-forms-components/blob/master/ui.tests/test-module/specs/customFunctionTest.spec.js and the corresponding form collateral at https://github.com/adobe/aem-core-forms-components/blob/master/it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/af2-custom-function/basic/.content.xml, along with the client library available at https://github.com/adobe/aem-core-forms-components/tree/master/it/apps/src/main/content/jcr_root/apps/forms-core-components-it/clientlibs/clientlib-it-custom-function

rismehta commented 8 months ago

@shravanthprasad, can you attempt the use case on version 6.5.19? According to version metrics, (https://github.com/adobe/aem-core-forms-components/blob/release/650/VERSIONS.md) support for 1.1.32 is only available after 6.5.18.

shravanthprasad commented 8 months ago

@shravanthprasad, can you attempt the use case on version 6.5.19? According to version metrics, (https://github.com/adobe/aem-core-forms-components/blob/release/650/VERSIONS.md) support for 1.1.32 is only available after 6.5.18.

Hi @rismehta - Thanks for your response. We are on AEM 6.5.17 currently and upgrade to 6.5.19 is planned in second half of 2024. Downgraded to version 1.1.26 and I still see the same issue. Upon further analysis, I see the servlet(AdaptiveFormCustomFunctionProviderServlet) is not present in bundle(com.adobe.aem.com.adobe.aem.forms.af.rest) which handles the custom function request http://localhost:4502/adobe/forms/af/customfunctions/L2NvbnRlbnQvZm9ybXMvYWYvbm93LWFlbS1mb3Jtcy9yaXNlLXVw The bundle version is 0.0.90 in AEM 6.5.17

shravanthprasad commented 8 months ago

@rismehta - We were trying to set value of dropdown component(options) using custom functions in rule editor. But since custom functions is a blocker on AEM 6.5.17 because of above issue, do you have any workaround/suggestion for implementing dropdown options from clientside?

rismehta commented 7 months ago

We were trying to set value of dropdown component(options) using custom functions in rule editor. But since custom functions is a blocker on AEM 6.5.17 because of above issue, do you have any workaround/suggestion for implementing dropdown options from clientside?

Custom function support was introduced in a subsequent update. To utilize this feature, you may need to either upgrade or submit a hotfix request through the support channel.

shravanthprasad commented 7 months ago

We were trying to set value of dropdown component(options) using custom functions in rule editor. But since custom functions is a blocker on AEM 6.5.17 because of above issue, do you have any workaround/suggestion for implementing dropdown options from clientside?

Custom function support was introduced in a subsequent update. To utilize this feature, you may need to either upgrade or submit a hotfix request through the support channel.

Thanks @rismehta - We have raised a support ticket.

rismehta commented 6 months ago

We were trying to set value of dropdown component(options) using custom functions in rule editor. But since custom functions is a blocker on AEM 6.5.17 because of above issue, do you have any workaround/suggestion for implementing dropdown options from clientside?

Custom function support was introduced in a subsequent update. To utilize this feature, you may need to either upgrade or submit a hotfix request through the support channel.

Thanks @rismehta - We have raised a support ticket.

We've created a new release, built upon version 6.5.17, for the custom function. You can find it at https://github.com/adobe/aem-core-forms-components/releases/tag/core-forms-components-reactor-1.1.27-wcmB008. This release incorporates a workaround involving the hardcoding of the function name.