AEM forms/ Adobe Form submission failure on publish instance. Error code: AEM-AF-901-004 - aem

AEM version/SP: 6.5.11
AEM forms add-on package: adobe-aemfd-linux-pkg-6.0.566-NPR-37836-B0001.zip
I've created an AEM form on author instance. The form submission is working in author instance. When I publish the form from the console & test it in publish instance, the form submission is failing.
Types of submit action tested:
No action configured
Forms Portal Submit action
Send PDF via email
Send email
Submit to Rest endpoint
Use asynchronous submission - i) Redirect to URL ii) Show message
To summarize, I've tested multiple variations of form submit actions. But none of the scenario is working.
Alert message[Screenshot attached]:
[AF] [AEM-AF-901-004]: Encountered an internal error while submitting the form.
The difference that I observe in author-submission & publish-submission is that:
/aem-forms-01/jcr:content/guideContainer.af.internalsubmit.jsp
This above mentioned request is failing in publish instance.
In publish instance the request attributes are:
the error code I see is Status Code: 500 Server Error
the request header for content type is - Content-Type: text/html;charset=utf-8
whereas, in author instance the request header shows content-type as - application/json [screenshot attached].
From the error logs I understand that
In author instance the form data is submitted as application json, as expected, and so it works.
In publish instance the form data is submitted as plain text format and the data is expected to be in json format hence get following error:
com.adobe.aemds.guide.internal.impl.servlet.GuideInternalSubmitServlet Expected a ':' after a key at character 7 of {"guideState":{"guideDom": [...error trace continued]
Kindly provide suggestions to resolve this issue in AEM publish instance
Please refer the following screenshots.

If you have dispatcher at front, add the following rule to allow those URLs to be served:
/0229 { /type "allow" /method "POST" /path "/content/forms/af/[A-Za-z0-9-]*/[A-Za-z0-9-]*/jcr:content/guideContainer*" /extension '(jsp)'} # allow POSTs to submit AEM Forms under /content
Review configurations at https://experienceleague.adobe.com/docs/experience-manager-65/forms/install-aem-forms/configure-aem-forms/configure-adaptive-forms-cache.html?lang=en

Related

Odoo12: Receiving CSRF validation failed on path '/website_form/crm.lead' on form submission

I'm receiving the below error from an attempt to use a webform to make a Lead. When making the form Odoo 12 also won't let me access any of the existing fields in the Lead model. The following error (from the logs) is all the information that I have along with the form error on the website. This issue is only for the CRM and Tasks all other forms submit just fine.
I'm trying to build a form to submit a Lead.
Instead of the form submitting I recieve the following error in the logs.
2019-08-07 10:37:50,152 28624 WARNING tdb_test_2019-08-07_c1
odoo.http: CSRF validation failed on path '/website_form/crm.lead'

Orchard's Web Request Workflow activity

I'm currently running Orchard v1.9.3, and I would like to use Orchard's web request workflow activity to make an API call to MailChimp's API (http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#create-post_lists_list_id_members). I was able to determine the value for the URL field should have the following form:
https://us14.api.mailchimp.com/3.0/lists/My_MailChimp_list_id/members/
Since I'm saving data to my MailChimp list, I'm going to select "PUT" for the verb drop down field. Based on MailChimp's API documentation, I was going to enter the following value in the "Headers" field:
'content-type: application/json'
MailChimp expects a JSON-formatted request, so I'm going to choose "Json" in the "Form Format" drop-down field.
The part that I'm struggling with is the "Form Values" field. According to the API docs, the data should have the following format, "'{"email_address":"urist.mcvankab+3#freddiesjokes.com", "status":"subscribed"}'". I know MailChimp expects my e-mail address in lieu of "urist.mcvankab+3#freddiesjokes.com", but I don't understand how to map the first name, last name, and email address values from my Orchard form into this Json request.
According to the documentation you linked to, the API expects a POST request. But maybe it supports PUT all the same, I don't know.
Regarding your question, you can access the submitted FORM values via the following token:
#FormSubmission.Field:MyFieldName
So for example, if the Dynamic Forms field name you used is named EmailAddress, your JSON should look something like this:
{
"email_address":"#FormSubmission.Field:EmailAddress",
"status":"subscribed"
}
PS: Kudos for using Dynamic Forms and the Web Request Activity!

Validate a file when creating content in Alfresco

I want to upload some XML files to Alfresco, so the create con tent form has an input file form element.
I need to check if the XML is well-formed, and I already have the backend validation functions triggered on ResourceBehavior.onContentUpdate. If the XML is malformed, I want to notify the user with a dialog window.
So far, I can prevent the user to submit malformed XML by throwing an exception when the XML is malformed, but I can't figure out how to have share to display an error message.
I have been looking at all the validation JS in share, but remember, file input forms need to be submitted first so that you can have a look at its content, thus the validation has to be server-sided.
Any pointers on where should I begin?
The problem you are going to have is that your backend behaviour is not aware of the specific client session that made the changes and what client session it is that needs to be notified.
If you want to display a useful message then you are going to have to write some additional Share customisation. Some options which you can explore are having an action or webscript that returns whether the XML is valid or not and customising the Share upload form to execute this action/webscript after the file has been uploaded and then return the relevant message to the user.
You'll find a pretty detailed post on modifying the upload form here:
http://www.ixxus.com/blog/2011/09/customising-upload-files-dialog-alfresco-share
If you're feeling lazy then I'd consider just aborting the file creation if the XML is invalid during an onCreate behaviour and then the user will see an 'Internal Error'.

Processing tokens through Drupal Rules

I am using the Rules module to respond to specific events and send email alerts. This part of my project works fine.
My problem is I need to include some dynamic data in the email message. For this I am using Tokens but the tokens do not get processed and replaced with the neccessary text. This means the email gets delivered with tokens in the message.
Can anyone suggest how I can solve this problem either programmatically or via some configuration I am missing?
I'm using Rules for emails also and hav not encountered any issues using tokens
This is an example of the body of the email from one of my rules
New Issue --> [node:url]
Title - [node:title]
Description - [node:body]
Author - [node:author]
Priority - [node:field-issue-priority]
Category - [node:field-issue-category]
Maybe you do not have the proper format?

404 when post submitted; found when directly called

I have a ColdFusion enabled form (for validation) submitting to a separate page. When this form is submitted it is showing me a 404 on the action page, yet when I directly load the action url into the address bar it shows up (errors appear, but that's ok). This is by far one of the most odd issues I have encountered.
Form page: http://www.jefferson.edu/population_health/_archive/contact_me.cfm
Action page: http://www.jefferson.edu/population_health/_archive/contact_action.cfm
Even if I try passing the form variables via URL it gives me a 404.
My gut is that there is another service on that machine that is trying to take over the request whenever you submit data and binding it to another webserver...which, of course, it can't find the right page based on it's own webroot.
If you click http://www.jefferson.edu/population_health/_archive/contact_me.cfm, it loads fine and returns 200 header with IIS as the server, but if you click http://www.jefferson.edu/population_health/_archive/contact_me2.cfm it throws a 404, as expected, but it's properly handled with a custom 404 and the header response is still IIS. But if you click http://www.jefferson.edu/population_health/_archive/contact_me.cfm?foo=bar, it returns an ApacheSling default 404 and header information saying the server is "Day-Servlet-Engine/4.1.12".
Your page is posting to the page contact_action.cfm ... in your question you indicate that the proper page should be "mailaction.cfm".
If the action page is actually mailaction.cfm then you simply need to change the action attribute of your cfform.