adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
737 stars 745 forks source link

[Form] Update Log mode for form actions after form submission #2637

Open Rahul-Kumar-AIG opened 9 months ago

Rahul-Kumar-AIG commented 9 months ago

Bug Report

Current Behavior

OOTB form actions only have .jsp files to render , but AEM is looking for .html files to render .

Steps to reproduce the issue --

Step 1) Add a OOTB Form Container component in a page and configure it , Step 2) Select Store Content / Mail / Post form Data in Action Type field , Step 3) Populate other fields with their respective values in dialog and save it , Step 4) Add form text field(s) and a submit button, Step 5) Configure form text fields with their respective values , Step 6) View page as published, Step 7) fill the form and submit it, Step 8) following logs will be visible in error.log file (error logs are mentioned below as per the Action Type selected ) --

1)for Store Content action type --> *ERROR* [[0:0:0:0:0:0:0:1] [1702550894373] POST /content/we-retail/language-masters/en/men.html HTTP/1.1] org.apache.sling.servlets.get.impl.DefaultGetServlet No renderer for extension html, cannot render resource ResourceWrapper, type=foundation/components/form/actions/store, path=/content/we-retail/language-masters/en/men/jcr:content/root/responsivegrid/container, resource=[JcrNodeResource, type=weretail/components/form/container, superType=null, path=/content/we-retail/language-masters/en/men/jcr:content/root/responsivegrid/container]

2)for Mail action type --> *ERROR* [[0:0:0:0:0:0:0:1] [1702545457570] POST /content/we-retail/language-masters/en/men.html HTTP/1.1] org.apache.sling.servlets.get.impl.DefaultGetServlet No renderer for extension html, cannot render resource ResourceWrapper, type=foundation/components/form/actions/mail, path=/content/we-retail/language-masters/en/men/jcr:content/root/responsivegrid/container, resource=[JcrNodeResource, type=weretail/components/form/container, superType=null, path=/content/we-retail/language-masters/en/men/jcr:content/root/responsivegrid/container]

3)for Post form Data action type --> *ERROR* [[0:0:0:0:0:0:0:1] [1702544561813] POST /content/we-retail/language-masters/en/men.html HTTP/1.1] org.apache.sling.servlets.get.impl.DefaultGetServlet No renderer for extension html, cannot render resource ResourceWrapper, type=core/wcm/components/form/actions/rpc, path=/content/we-retail/language-masters/en/men/jcr:content/root/responsivegrid/container, resource=[JcrNodeResource, type=weretail/components/form/container, superType=null, path=/content/we-retail/language-masters/en/men/jcr:content/root/responsivegrid/container]

Expected behavior/code

Logs should be in Info or Warn mode .

Environment

Possible Solution

Additional context / Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.

HitmanInWis commented 3 months ago

@Rahul-Kumar-AIG please rename this issue something to the tune of the bug, which is "Unexpected ERROR logging on form submit"

The issue is occurring from this sequence of events:

I dont see this happening on the store option. Since my AEM server has /libs/foundation/components/form/actions/store/store.jsp it makes sense the error is not thrown on that action.

The error is, however, thrown on the RPC and Mail actions as you mention.

Note that store.jsp referenced above is simply an (effectively) empty JSP, so I think adding the same (or an empty .html file) to the actions will prevent the ERROR logs from happening.