“Successful” Static Netlify Form Submissions Don't Show in Dashboard - forms

I have a completely static html form with some data using the netlify tag. When I submit it, I get a 200 and see the default success page, but do not see the submission in the Netlify Dashboard. I do see the form was recognized and has an entry in the dashboard, but it shows zero submissions.
Note that my issue is different from a similar question because this is a static form and my content-type is already "application/x-www-form-urlencoded" which was what was wrong in that other case.
I don't see anyone else describing this issue and I can't seem to find anything in the docs that I might be missing. Anyone seen this before and found a solution?
Here's the form:
<form name="registration" method="POST" class="registration-form" data-netlify="true" data-netlify-recaptcha="true">
<H2>Juneteenth Parade Registration Form</H2>
<p>The deadline to register for the parade is Fri. May 31, 2019.</p>
<fieldset>
<legend>CONTACT INFORMATION</legend>
<div class="registration-form">
<label for="name">Organization Name:</label><input type="text" id="name" name="name" required minlength="4" maxlength="128" size="64">
</div>
<div class="registration-form">
<label for="contact">Contact Person:</label><input type="text" id="person" name="person" required minlength="4" maxlength="128" size="64">
</div>
<div class="registration-form">
<label for="address">Organization Address:</label><input type="text" id="address" name="address" required minlength="4" maxlength="128" size="64">
</div>
<div class="registration-form">
<label for="phone">Phone Number:</label><input type="tel" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" placeholder="###-###-####" id="phone" name="phone" required minlength="7" maxlength="28" size="14">
</div>
<div class="registration-form">
<label for="alt_phone">Alternate Phone:</label><input type="tel" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" placeholder="###-###-####" id="alt_phone" name="alt_phone" required minlength="7" maxlength="28" size="14">
</div>
<div class="registration-form">
<label for="email">E-mail Address:</label><input type="email" id="email" name="email" required minlength="4" maxlength="128" size="32">
</div>
</fieldset>
<fieldset>
<legend>PARADE ENTRY</legend>
<div class="description">
<label for="description">Please describe the nature of your parade entry for example; float, people walking together, band, horse and buggy, decorated car, bicycles and banners.</label> <textarea id="description" name="description" rows="3" cols="64">
</textarea>
</div>
<div class="registration-form">
<input type="checkbox" id="music" name="music">
<label for="music">Playing or performing music?</label>
</div>
<div class="number-of-people">
<label for="people">Number of people expected:</label><input type="number" id="email" name="email" required minlength="1" maxlength="4" size="4">
</div>
</fieldset>
<div data-netlify-recaptcha="true"></div>
<input type="submit" value="Submit Registration" class="submit button">
</form>
And here's the request/response:
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
},
"pages": [
{
"startedDateTime": "2019-04-14T21:45:06.072Z",
"id": "page_4",
"title": "https://redacted.netlify.com/",
"pageTimings": {
"onContentLoad": 364.39100000006874,
"onLoad": 418.19699999996374
}
}
],
"entries": [
{
"startedDateTime": "2019-04-14T21:45:06.070Z",
"time": 225.2770000000055,
"request": {
"method": "POST",
"url": "https://redacted.netlify.com/",
"httpVersion": "http/2.0",
"headers": [
{
"name": ":method",
"value": "POST"
},
{
"name": ":authority",
"value": "redacted.netlify.com"
},
{
"name": ":scheme",
"value": "https"
},
{
"name": ":path",
"value": "/"
},
{
"name": "content-length",
"value": "585"
},
{
"name": "pragma",
"value": "no-cache"
},
{
"name": "cache-control",
"value": "no-cache"
},
{
"name": "origin",
"value": "https://redacted.netlify.com"
},
{
"name": "upgrade-insecure-requests",
"value": "1"
},
{
"name": "content-type",
"value": "application/x-www-form-urlencoded"
},
{
"name": "user-agent",
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
},
{
"name": "accept",
"value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3"
},
{
"name": "referer",
"value": "https://redacted.netlify.com/"
},
{
"name": "accept-encoding",
"value": "gzip, deflate, br"
},
{
"name": "accept-language",
"value": "en-US,en;q=0.9"
}
],
"queryString": [],
"cookies": [],
"headersSize": -1,
"bodySize": 585,
"postData": {
"mimeType": "application/x-www-form-urlencoded",
"text": "form-name=registration&name=Test+Org&person=Bill&address=111+Test+Dr.&phone=111-222-3333&alt_phone=444-555-6666&email=me%40example.com&description=This+is+a+test.++++++++++++++++++++++++++++&music=on&email=1&g-recaptcha-response=03AOLTBLTRjCCETaPINwgzeeptXELZzjz9ineERJ18sHv9_Pb4ou7P70RkIz4vqEJPMME01RnXgqSjs-0f_6TUjWEL3QkkFJSd2dThUktYnI5Y-Nwl8fJx4DMU9ZBPuL1MLM-vjOiRf2ZNHU13HxrSUk3ab9j31O4R8wnTtdpG_QiQwKMxZs-pM-_L29YBA1c4HGR1IZJlxGixjk06L50CLzc6cF9y_o6RHiZ8O33hJ_36sgTWEqjeSjZUU9XHRPFkkCUK9x5LK5P5j2HFOEjpA6NbOqHyTtLGUo8CnvgwlLDiovvwASyRD0vmz0gkMTHV1LBsjoAWkSACLz1o5dh2mpdsXVZUfZo-jA",
"params": [
{
"name": "form-name",
"value": "registration"
},
{
"name": "name",
"value": "Test+Org"
},
{
"name": "person",
"value": "Bill"
},
{
"name": "address",
"value": "111+Test+Dr."
},
{
"name": "phone",
"value": "111-222-3333"
},
{
"name": "alt_phone",
"value": "444-555-6666"
},
{
"name": "email",
"value": "me%40example.com"
},
{
"name": "description",
"value": "This+is+a+test.++++++++++++++++++++++++++++"
},
{
"name": "music",
"value": "on"
},
{
"name": "email",
"value": "1"
},
{
"name": "g-recaptcha-response",
"value": "[redacted]"
}
]
}
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "http/2.0",
"headers": [
{
"name": "status",
"value": "200"
},
{
"name": "content-type",
"value": "text/html"
},
{
"name": "date",
"value": "Sun, 14 Apr 2019 21:45:06 GMT"
},
{
"name": "age",
"value": "0"
},
{
"name": "server",
"value": "Netlify"
},
{
"name": "x-nf-request-id",
"value": "0cb00dd4-87f1-42a7-b737-913d0998120e-98519701"
}
],
"cookies": [],
"content": {
"size": 2121,
"mimeType": "text/html",
"text": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n\n <title>Thank you!</title>\n <link href='https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>\n <style>\n body {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n background: rgb(14, 30, 37);\n color: white;\n overflow: hidden;\n }\n\n h1 {\n margin: 0;\n font-size: 22px;\n line-height: 24px;\n }\n\n .main {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100vh;\n width: 100vw;\n }\n\n .card {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 75%;\n max-width: 364px;\n padding: 24px;\n background: white;\n color: rgb(14, 30, 37);\n border-radius: 8px;\n box-shadow: 0 2px 4px 0 rgba(14, 30, 37, .16);\n }\n\n a {\n margin: 0;\n text-decoration: none;\n font-weight: 600;\n line-height: 24px;\n color: #00ad9f;\n }\n\n a svg {\n position: relative;\n top: 2px;\n }\n\n a:hover,\n a:focus {\n text-decoration: underline;\n color: #007A70;\n }\n\n a:hover svg path{\n fill: #007A70;\n }\n\n p:last-of-type {\n margin: 0;\n }\n </style>\n </head>\n <body>\n\n <div class=\"main\">\n <div class=\"card\">\n <div class=\"header\">\n <h1>Thank you!</h1>\n </div>\n <div class=\"body\">\n\n <p>Your form submission has been received.</p>\n\n <p>\n <a id=\"back-link\" href=\"/\">← Back to our site</a>\n </p>\n </div>\n </div>\n </div>\n <script>\n (function() {\n if (document.referrer && document.location.host && document.referrer.match(new RegExp(\"^https?://\" + document.location.host))) {\n document.getElementById(\"back-link\").setAttribute(\"href\", document.referrer);\n }\n })();\n </script>\n </body>\n</html>\n"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 2210
},
"cache": {},
"timings": {
"blocked": 2.34500000006365,
"dns": -1,
"ssl": -1,
"connect": -1,
"send": 0.16100000000000003,
"wait": 221.8270000000515,
"receive": 0.9439999998903659,
"_blocked_queueing": 1.86600000006365
},
"serverIPAddress": "142.93.122.177",
"_initiator": {
"type": "other"
},
"_priority": "VeryHigh",
"_resourceType": "document",
"connection": "19503",
"pageref": "page_4"
},
{
"startedDateTime": "2019-04-14T21:45:06.311Z",
"time": 126.6409999998271,
"request": {
"method": "GET",
"url": "https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,latin-ext",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "Referer",
"value": "https://redacted.netlify.com/"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
}
],
"queryString": [
{
"name": "family",
"value": "Roboto:400,700"
},
{
"name": "subset",
"value": "latin,latin-ext"
}
],
"cookies": [],
"headersSize": -1,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "strict-transport-security",
"value": "max-age=31536000"
},
{
"name": "content-encoding",
"value": "br"
},
{
"name": "last-modified",
"value": "Sun, 14 Apr 2019 21:45:06 GMT"
},
{
"name": "server",
"value": "ESF"
},
{
"name": "access-control-allow-origin",
"value": "*"
},
{
"name": "date",
"value": "Sun, 14 Apr 2019 21:45:06 GMT"
},
{
"name": "x-frame-options",
"value": "SAMEORIGIN"
},
{
"name": "content-type",
"value": "text/css; charset=utf-8"
},
{
"name": "status",
"value": "200"
},
{
"name": "alt-svc",
"value": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""
},
{
"name": "cache-control",
"value": "private, max-age=86400, stale-while-revalidate=604800"
},
{
"name": "timing-allow-origin",
"value": "*"
},
{
"name": "link",
"value": "<https://fonts.gstatic.com>; rel=preconnect; crossorigin"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
},
{
"name": "expires",
"value": "Sun, 14 Apr 2019 21:45:06 GMT"
}
],
"cookies": [],
"content": {
"size": 4498,
"mimeType": "text/css",
"text": "[redacted]"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 854
},
"cache": {},
"timings": {
"blocked": 14.100000000016415,
"dns": 27.329,
"ssl": 46.616,
"connect": 74.052,
"send": 0,
"wait": 10.321999999880063,
"receive": 0.8379999999306165,
"_blocked_queueing": 13.277000000016415
},
"serverIPAddress": "172.217.9.170",
"_initiator": {
"type": "parser",
"url": "https://redacted.netlify.com/",
"lineNumber": 6
},
"_priority": "VeryHigh",
"_resourceType": "stylesheet",
"pageref": "page_4"
},
{
"startedDateTime": "2019-04-14T21:45:06.424Z",
"time": 48.637999999755266,
"request": {
"method": "GET",
"url": "https://fonts.gstatic.com/s/roboto/v19/KFOlCnqEu92Fr1MmWUlfBBc4.woff2",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
},
{
"name": "Referer",
"value": "https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,latin-ext"
},
{
"name": "Origin",
"value": "https://redacted.netlify.com"
}
],
"queryString": [],
"cookies": [],
"headersSize": -1,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "date",
"value": "Mon, 25 Mar 2019 20:21:40 GMT"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "last-modified",
"value": "Mon, 25 Mar 2019 20:13:46 GMT"
},
{
"name": "server",
"value": "sffe"
},
{
"name": "age",
"value": "1733006"
},
{
"name": "content-type",
"value": "font/woff2"
},
{
"name": "status",
"value": "200"
},
{
"name": "alt-svc",
"value": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""
},
{
"name": "cache-control",
"value": "public, max-age=31536000"
},
{
"name": "accept-ranges",
"value": "bytes"
},
{
"name": "timing-allow-origin",
"value": "*"
},
{
"name": "access-control-allow-origin",
"value": "*"
},
{
"name": "content-length",
"value": "15816"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
},
{
"name": "expires",
"value": "Tue, 24 Mar 2020 20:21:40 GMT"
}
],
"cookies": [],
"content": {
"size": 15816,
"mimeType": "font/woff2",
"text": "[redacted]",
"encoding": "base64"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 15920
},
"cache": {},
"timings": {
"blocked": 2.2409999998616694,
"dns": -1,
"ssl": -1,
"connect": -1,
"send": 0.08200000000000002,
"wait": 45.09700000001289,
"receive": 1.2179999998807034,
"_blocked_queueing": 1.9459999998616695
},
"serverIPAddress": "216.58.194.67",
"_initiator": {
"type": "script",
"stack": {
"callFrames": [
{
"functionName": "",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 20,
"columnNumber": 266
},
{
"functionName": "ready",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 10,
"columnNumber": 196
},
{
"functionName": "B",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 17,
"columnNumber": 6
}
]
}
},
"_priority": "VeryHigh",
"_resourceType": "font",
"pageref": "page_4"
},
{
"startedDateTime": "2019-04-14T21:45:06.431Z",
"time": 53.76699999987977,
"request": {
"method": "GET",
"url": "https://fonts.gstatic.com/s/roboto/v19/KFOmCnqEu92Fr1Mu4mxK.woff2",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
},
{
"name": "Referer",
"value": "https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,latin-ext"
},
{
"name": "Origin",
"value": "https://redacted.netlify.com"
}
],
"queryString": [],
"cookies": [],
"headersSize": -1,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "http/2.0+quic/43",
"headers": [
{
"name": "date",
"value": "Mon, 25 Mar 2019 20:21:59 GMT"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "last-modified",
"value": "Mon, 25 Mar 2019 20:12:01 GMT"
},
{
"name": "server",
"value": "sffe"
},
{
"name": "age",
"value": "1732987"
},
{
"name": "content-type",
"value": "font/woff2"
},
{
"name": "status",
"value": "200"
},
{
"name": "alt-svc",
"value": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""
},
{
"name": "cache-control",
"value": "public, max-age=31536000"
},
{
"name": "accept-ranges",
"value": "bytes"
},
{
"name": "timing-allow-origin",
"value": "*"
},
{
"name": "access-control-allow-origin",
"value": "*"
},
{
"name": "content-length",
"value": "15736"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
},
{
"name": "expires",
"value": "Tue, 24 Mar 2020 20:21:59 GMT"
}
],
"cookies": [],
"content": {
"size": 15736,
"mimeType": "font/woff2",
"text": "[redacted]",
"encoding": "base64"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 15840
},
"cache": {},
"timings": {
"blocked": 4.55399999966129,
"dns": -1,
"ssl": -1,
"connect": -1,
"send": 0.15599999999999992,
"wait": 39.65100000009211,
"receive": 9.406000000126369,
"_blocked_queueing": 3.0159999996612896
},
"serverIPAddress": "216.58.194.67",
"_initiator": {
"type": "script",
"stack": {
"callFrames": [
{
"functionName": "",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 20,
"columnNumber": 266
},
{
"functionName": "ready",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 10,
"columnNumber": 196
},
{
"functionName": "B",
"scriptId": "368",
"url": "chrome-extension://mbigbapnjcgaffohmbkdlecaccepngjd/lib/jquery-ui-1.8.6/js/jquery-1.4.2.js",
"lineNumber": 17,
"columnNumber": 6
}
]
}
},
"_priority": "VeryHigh",
"_resourceType": "font",
"pageref": "page_4"
}
]
}
}

tl;dr: Make sure your input name attributes are all unique. The submit will fail silently otherwise.
Posting this as an answer to help anyone else who runs into this. It turns out that some form errors, in this case an input with a duplicate name, will appear to submit successfully, but will actually either go to spam or be lost.
To confirm, I created a new form, identical to the first, but with all of the inputs named correctly. The form submitted fine and showed up in the dashboard immediately.
I then changed the last input to have a name already used by another input "email" in this case. The submission appeared to be successful, but the data never showed-up in the dashboard.
Changing the name back to a unique name and trying again submitted successfully and immediately showed up in the dashboard.
Here's what my mistake looked like.
<div class="registration-form">
<label for="email">E-mail Address:</label><input type="email" id="email" name="email" required minlength="4" maxlength="128">
</div>
...
<div class="registration-form">
<input type="number" id="number" name="email" required minlength="1" maxlength="4" size="4" class="number"> <label for="people">Number of people expected?</label>
</div>

I've had a similar issue with a Netlify form - showed as successful but then it wasn't actually submitted. Can you try to switch the data-netlify="true" to just netlify? That fixed the issue for me.

Related

Filter for one attribute (array) for one of its value (json)

Having the following record
{
"name": "
 Festões Plástico, 12mt x 17cm - Festas Populares",
"categories": [
"Festas",
"Casamentos",
"Decorações"
],
"hierarchicalCategories": {
"lvl0": "Festas",
"lvl1": "Festas > Casamentos",
"lvl2": "Festas > Casamentos > Decorações"
},
"description": "",
"brand": "Misterius",
"price": 14.94,
"stock": "Disponível",
"prices": [
{
"value": 12,
"type": "specificValue",
"family": "fatos",
"subfamily": "example"
},
{
"value": 13,
"type": "specificValue13",
"family": "fatos13",
"subfamily": "example13"
},
{
"value": 14,
"type": "specificValue14",
"family": "fatos14",
"subfamily": "example14"
},
{
"value": 15,
"type": "specificValue15",
"family": "fatos15",
"subfamily": "example15"
},
{
"value": 16,
"type": "specificValue16",
"family": "fatos16",
"subfamily": "example16"
}
],
"color": [
{
"name": "Amarelo",
"label": "Amarelo,#FFFF00",
"hexa": "#FFFF00"
},
{
"name": "Azul",
"label": "Azul,#0000FF",
"hexa": "#0000FF"
},
{
"name": "Branco",
"label": "Branco,#FFFFFF",
"hexa": "#FFFFFF"
},
{
"name": "Laranja",
"label": "Laranja,#FFA500",
"hexa": "#FFA500"
},
{
"name": "Verde Escuro",
"label": "Verde Escuro,#006400",
"hexa": "#006400"
},
{
"name": "Vermelho",
"label": "Vermelho,#FF0000",
"hexa": "#FF0000"
}
],
"specialcategorie": "",
"reference": "3546",
"rating": 0,
"free_shipping": false,
"popularity": 0,
"objectID": "30"
}
Now by searching for "Festas Populares" will return the record and its attributes, is it possible to also filter for one attribute array as "prices" to only return one json. for example "prices.type"="specificValue14" and "family"="fatos14" and "family"="fatos" and "subfamily"="example"
{
“value”: 14,
“type”: “specificValue14”,
“family”: “fatos14”,
“subfamily”: “example14”
}
the record return would be:
{
"name": "
 Festões Plástico, 12mt x 17cm - Festas Populares",
"categories": [
"Festas",
"Casamentos",
"Decorações"
],
"hierarchicalCategories": {
"lvl0": "Festas",
"lvl1": "Festas > Casamentos",
"lvl2": "Festas > Casamentos > Decorações"
},
"description": "",
"brand": "Misterius",
"price": 14.94,
"stock": "Disponível",
"prices": [
{
"value": 14,
"type": "specificValue14",
"family": "fatos14",
"subfamily": "example14"
}
],
"color": [
{
"name": "Amarelo",
"label": "Amarelo,#FFFF00",
"hexa": "#FFFF00"
},
{
"name": "Azul",
"label": "Azul,#0000FF",
"hexa": "#0000FF"
},
{
"name": "Branco",
"label": "Branco,#FFFFFF",
"hexa": "#FFFFFF"
},
{
"name": "Laranja",
"label": "Laranja,#FFA500",
"hexa": "#FFA500"
},
{
"name": "Verde Escuro",
"label": "Verde Escuro,#006400",
"hexa": "#006400"
},
{
"name": "Vermelho",
"label": "Vermelho,#FF0000",
"hexa": "#FF0000"
}
],
"specialcategorie": "",
"reference": "3546",
"rating": 0,
"free_shipping": false,
"popularity": 0,
"objectID": "30"
}
for some context a product can have multiple prices associated, for a specific user, or one day there is campaign giving discount, etc so for that cases want to filter price associated to the product/record.
No, this is not possible with Algolia. Records are always returned with the attributes specified inside attributesToRetrieve. These attributes are returned in full.

Saving a list of related objects in Play! Framework 1.x from a form

I have an Offer object in Play models, which can have on or more OfferLines, so I have
#Required
#ManyToOne
public Offer offer;
on OfferLine
and
#OneToMany(mappedBy="offer", cascade= CascadeType.ALL)
public List<OfferLine> offerLines;
on Offer.
When I open my form, I have the following to populate things for rendering
Offer myOffer = new Offer();
myOffer.offerFrom = currentUser;
myOffer.targetSwag = targetSwag;
myOffer.offerTo = targetSwag.Owner;
myOffer.offerLines = new ArrayList<OfferLine>();
for (Swag swagline : mySwag)
{
OfferLine offerLine = new OfferLine();
offerLine.quantity=0;
offerLine.swag = swagline;
myOffer.offerLines.add(offerLine);
}
myOffer.save();
renderArgs.put("myOffer",myOffer);
render();
and then finally, my form looks like this (indentation notwithstanding...)
#{form #submitOffer(), id:'submitOffer'}
<table border="1">
<thead>
<tr>
<th width="30" align="left">ID</th>
<th width="80" align="left">Swag</th>
<th width="30" align="left">Quantity</th>
</tr>
</thead>
<tbody>
#{list items:myOffer.offerLines, as:'offerline'}
<tr>
<td height="32" width="30"><input type="text" id="offerline.id"
name="offerline.id" value="${offerline.id}"/></td>
<td height="32" width="80">
${offerline.swag.Name}
</td>
<td height="32">
<input class="field" id="offerline.quantity" name="offerline.quantity" type="number" min="0" max="${offerline.swag.Quantity}" value="${offerline.quantity}"/>
</td>
</tr>
#{/list}
</tbody>
</table>
When I submit, I call a method like this...
public static void submitOffer(Integer amountRequested, Offer myOffer)
{
myOffer.save();
System.out.println("Requested " + amountRequested);
System.out.println("My offer coming out " + myOffer.toString());
renderJSON(myOffer);
}
but my Offerlines are not in the JSON, i.e., they don't seem to be passed back to in the Offer object. How can I edit and save a list of OfferLines related to an Offer in the one screen?
[Update] I tested the MyOffer object that's passed to the form and it has the offerlines, it just doesn't come back out again..
{
"offerLines": [
{
"swag": {
"Name": "Test Swag",
"Description": "Big ol' test swag",
"Quantity": 10,
"Owner": {
"username": "robcowell",
"password": "REDACTED",
"email": "REDACTED",
"fullname": "Rob Cowell",
"isAdmin": true,
"isActive": true,
"Photo": {
"bucket": "REDACTED",
"key": "d5654f8f-0cd0-45a2-a77f-3edda01feca0",
"contentLength": 0
},
"hasChangedPassword": true,
"id": 1
},
"Photo": {
"bucket": "REDACTED",
"key": "b0774667-a32a-4508-81ba-cdb84ebc689f",
"contentLength": 0
},
"id": 52
},
"quantity": 0,
"id": 134
},
{
"swag": {
"Name": "Swag 2",
"Description": "Swag 2",
"Quantity": 5,
"Owner": {
"username": "robcowell",
"password": "REDACTED",
"email": "REDACTED",
"fullname": "Rob Cowell",
"isAdmin": true,
"isActive": true,
"Photo": {
"bucket": "REDACTED",
"key": "d5654f8f-0cd0-45a2-a77f-3edda01feca0",
"contentLength": 0
},
"hasChangedPassword": true,
"id": 1
},
"id": 54
},
"quantity": 0,
"id": 135
},
{
"swag": {
"Name": "Swag 3",
"Description": "Mo' Swag",
"Quantity": 1,
"Owner": {
"username": "robcowell",
"password": "REDACTED",
"email": "REDACTED",
"fullname": "Rob Cowell",
"isAdmin": true,
"isActive": true,
"Photo": {
"bucket": "REDACTED",
"key": "d5654f8f-0cd0-45a2-a77f-3edda01feca0",
"contentLength": 0
},
"hasChangedPassword": true,
"id": 1
},
"id": 55
},
"quantity": 0,
"id": 136
},
{
"swag": {
"Name": "Test swag with an inordinately long name purely for the purposes of testing the rendering of these columns",
"Description": "As above",
"Quantity": 1,
"Owner": {
"username": "robcowell",
"password": "REDACTED",
"email": "REDACTED",
"fullname": "Rob Cowell",
"isAdmin": true,
"isActive": true,
"Photo": {
"bucket": "REDACTED",
"key": "d5654f8f-0cd0-45a2-a77f-3edda01feca0",
"contentLength": 0
},
"hasChangedPassword": true,
"id": 1
},
"id": 60
},
"quantity": 0,
"id": 137
}
],
"offerTo": {
"username": "todd",
"password": "REDACTED",
"email": "REDACTED",
"fullname": "Todd Halfpenny",
"isAdmin": false,
"isActive": true,
"hasChangedPassword": true,
"id": 20
},
"offerFrom": {
"username": "robcowell",
"password": "REDACTED",
"email": "REDACTED",
"fullname": "Rob Cowell",
"isAdmin": true,
"isActive": true,
"Photo": {
"bucket": "REDACTED",
"key": "d5654f8f-0cd0-45a2-a77f-3edda01feca0",
"contentLength": 0
},
"hasChangedPassword": true,
"id": 1
},
"targetSwag": {
"Name": "Todd's tshirts",
"Description": "Nice tshirts by Todd",
"Quantity": 10,
"Owner": {
"username": "todd",
"password": "REDACTED",
"email": "REDACTED",
"fullname": "Todd",
"isAdmin": false,
"isActive": true,
"hasChangedPassword": true,
"id": 20
},
"Photo": {
"bucket": "REDACTED",
"key": "f627cbcf-7eba-400d-a1f9-dcf1ab457709",
"contentLength": 0
},
"id": 53
},
"id": 133
}
Can you try the following to set the indexes to cope with arrays.
#{list items:myOffer.offerLines, as:'offerline'}
<tr>
<td height="32" width="30"><input type="text" id="offerline.id" name="offerline[${offerline_index-1}].id" value="${offerline.id}"/></td>
<td height="32" width="80">
${offerline.swag.Name}
</td>
<td height="32">
<input class="field" id="offerline.quantity" name="offerline[${offerline_index-1}].quantity" type="number" min="0" max="${offerline.swag.Quantity}" value="${offerline.quantity}"/>
</td>
</tr>
#{/list}

fancytree The font color of the moved item changes after dragging and dropping

I have a problem while using fancytree.
After checking one or more items, drag and drop, the font color of the moved item has been changed
$(function() {
// Attach the fancytree widget to an existing <div id="tree"> element
// and pass the tree options as an argument to the fancytree() function:
$("#tree").fancytree({
extensions: ["dnd5", "multi", "table"],
checkbox: true,
// debugLevel: 1,
source: [{
"title": "Books",
"expanded": true,
"folder": true,
"children": [{
"title": "Art of War",
"type": "book",
"author": "Sun Tzu",
"year": -500,
"qty": 21,
"price": 5.95
},
{
"title": "The Hobbit",
"type": "book",
"author": "J.R.R. Tolkien",
"year": 1937,
"qty": 32,
"price": 8.97
},
{
"title": "The Little Prince",
"type": "book",
"author": "Antoine de Saint-Exupery",
"year": 1943,
"qty": 2946,
"price": 6.82
},
{
"title": "Don Quixote",
"type": "book",
"author": "Miguel de Cervantes",
"year": 1615,
"qty": 932,
"price": 15.99
}
]
},
{
"title": "Music",
"folder": true,
"children": [{
"title": "Nevermind",
"type": "music",
"author": "Nirvana",
"year": 1991,
"qty": 916,
"price": 15.95
},
{
"title": "Autobahn",
"type": "music",
"author": "Kraftwerk",
"year": 1974,
"qty": 2261,
"price": 23.98
},
{
"title": "Kind of Blue",
"type": "music",
"author": "Miles Davis",
"year": 1959,
"qty": 9735,
"price": 21.90
},
{
"title": "Back in Black",
"type": "music",
"author": "AC/DC",
"year": 1980,
"qty": 3895,
"price": 17.99
},
{
"title": "The Dark Side of the Moon",
"type": "music",
"author": "Pink Floyd",
"year": 1973,
"qty": 263,
"price": 17.99
},
{
"title": "Sgt. Pepper's Lonely Hearts Club Band",
"type": "music",
"author": "The Beatles",
"year": 1967,
"qty": 521,
"price": 13.98
}
]
},
{
"title": "Electronics & Computers",
"expanded": true,
"folder": true,
"children": [{
"title": "Cell Phones",
"folder": true,
"children": [{
"title": "Moto G",
"type": "phone",
"author": "Motorola",
"year": 2014,
"qty": 332,
"price": 224.99
},
{
"title": "Galaxy S8",
"type": "phone",
"author": "Samsung",
"year": 2016,
"qty": 952,
"price": 509.99
},
{
"title": "iPhone SE",
"type": "phone",
"author": "Apple",
"year": 2016,
"qty": 444,
"price": 282.75
},
{
"title": "G6",
"type": "phone",
"author": "LG",
"year": 2017,
"qty": 951,
"price": 309.99
},
{
"title": "Lumia",
"type": "phone",
"author": "Microsoft",
"year": 2014,
"qty": 32,
"price": 205.95
},
{
"title": "Xperia",
"type": "phone",
"author": "Sony",
"year": 2014,
"qty": 77,
"price": 195.95
},
{
"title": "3210",
"type": "phone",
"author": "Nokia",
"year": 1999,
"qty": 3,
"price": 85.99
}
]
},
{
"title": "Computers",
"folder": true,
"children": [{
"title": "ThinkPad",
"type": "computer",
"author": "IBM",
"year": 1992,
"qty": 16,
"price": 749.90
},
{
"title": "C64",
"type": "computer",
"author": "Commodore",
"year": 1982,
"qty": 83,
"price": 595.00
},
{
"title": "MacBook Pro",
"type": "computer",
"author": "Apple",
"year": 2006,
"qty": 482,
"price": 1949.95
},
{
"title": "Sinclair ZX Spectrum",
"type": "computer",
"author": "Sinclair Research",
"year": 1982,
"qty": 1,
"price": 529
},
{
"title": "Apple II",
"type": "computer",
"author": "Apple",
"year": 1977,
"qty": 17,
"price": 1298
},
{
"title": "PC AT",
"type": "computer",
"author": "IBM",
"year": 1984,
"qty": 3,
"price": 1235.00
}
]
}
]
},
{
"title": "More...",
"folder": true,
"lazy": true
}
],
activate: function(event, data) {},
lazyLoad: function(event, data) {
data.result = [{
"title": "Sub item",
"lazy": true
}, {
"title": "Sub folder",
"folder": true,
"lazy": true
}]
},
renderColumns: function(event, data) {
var node = data.node,
$tdList = $(node.tr).find(">td");
$tdList.eq(1).text(node.key);
$tdList.eq(2).text(!!node.folder);
},
dnd5: {
preventVoidMoves: true, // Prevent dropping nodes 'before self', etc.
preventRecursiveMoves: true, // Prevent dropping nodes on own descendants
autoExpandMS: 1000,
multiSource: true, // drag all selected nodes (plus current node)
// focusOnClick: true,
// refreshPositions: true,
dragStart: function(node, data) {
// allow dragging `node`:
data.dataTransfer.dropEffect = "move";
return true;
},
// dragDrag: function(node, data) {
// data.node.info("dragDrag", data);
// data.dataTransfer.dropEffect = "copy";
// return true;
// },
dragEnter: function(node, data) {
data.node.info("dragEnter", data);
data.dataTransfer.dropEffect = "link";
return true;
},
// dragOver: function(node, data) {
// data.node.info("dragOver", data);
// data.dataTransfer.dropEffect = "link";
// return true;
// },
dragEnd: function(node, data) {
data.node.info("dragEnd", data);
},
dragDrop: function(node, data) {
// This function MUST be defined to enable dropping of items on the tree.
//
// The source data is provided in several formats:
// `data.otherNode` (null if it's not a FancytreeNode from the same page)
// `data.otherNodeData` (Json object; null if it's not a FancytreeNode)
// `data.dataTransfer.getData()`
//
// We may access some meta data to decide what to do:
// `data.hitMode` ("before", "after", or "over").
// `data.dataTransfer.dropEffect`, `.effectAllowed`
// `data.originalEvent.shiftKey`, ...
//
// Example:
var dataTransfer = data.dataTransfer,
sourceNodes = data.otherNodeList,
event = data.originalEvent,
copyMode = event.ctrlKey || event.altKey;
if (copyMode) {
$.each(sourceNodes, function(i, o) {
o.copyTo(node, data.hitMode, function(n) {
delete n.key;
n.selected = false;
n.title = "Copy of " + n.title;
});
});
} else {
$.each(sourceNodes, function(i, o) {
o.moveTo(node, data.hitMode);
});
}
node.debug("drop", data);
node.setExpanded();
}
}
});
});
.fancytree-drag-source {
font-style: oblique;
}
.fancytree-drag-source.fancytree-drag-remove {
opacity: 0.5;
}
/* Prevent scrolling while DND */
ul.fancytree-container {
/*
height: 200px;
overflow: auto;
*/
/* position: inherit;*/
}
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Test D'n'D - Fancytree</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="https://wwwendt.de/tech/fancytree/src/skin-win8/ui.fancytree.css" rel="stylesheet">
<script src="https://wwwendt.de/tech/fancytree/src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js"></script>
<script src="https://wwwendt.de/tech/fancytree/src/jquery.fancytree.js"></script>
<script src="https://wwwendt.de/tech/fancytree/src/jquery.fancytree.dnd5.js"></script>
<script src="https://wwwendt.de/tech/fancytree/src/jquery.fancytree.multi.js"></script>
<script src="https://wwwendt.de/tech/fancytree/src/jquery.fancytree.table.js"></script>
</head>
<body class="example">
<h1>Example: extended drag'n'drop sample</h1>
<div class="description">
This sample shows how to
<ul>
<li>implement drag'n'drop with multiple selected nodes
<li>allow modifier keys <kbd>Ctrl</kbd> or <kbd>Alt</kbd> to force copy instead of move operations
</ul>
</div>
<div>
<label for="skinswitcher">Skin:</label>
<select id="skinswitcher"></select>
</div>
<!-- Add a <table> element where the tree should appear: -->
<!--<p class="description">
Standard tree:
</p>
<div id="tree"></div>-->
<p class="description">
Table tree:
</p>
<table id="tree">
<colgroup>
<col width="*"/>
<col width="200px"/>
<col width="100px"/>
</colgroup>
<thead>
<tr>
<th></th>
<th>Key</th>
<th>Folder</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<p class="droppable">
Droppable.
</p>
</body>
This may be related to a bug that is closed with v2.30.

Delta function on calendar view is returning a duplicate key "id" in the response

I am using a delta function on the calendar view to track the changes. I am noticing that the response coming back from the query contains "id" key twice.
This is the URI used to make the delta query:
String uri = "https://graph.microsoft.com/v1.0/me/calendars/" + this.calendarId + "/calendarView/delta?startDateTime="+startStr+"&endDateTime="+endStr;
The headers I am adding to the GET request are:
"User-Agent": "Mozilla/5.0"
"Accept": "application/json"
"Authorization":"Bearer "+ accessToken
"Prefer":"outlook.timezone=\"Eastern Standard Time\""
The response that I am getting back is (values truncated/modified for security reasons, but notice the duplicate "id" key):
{
"#odata.context": ...,
"#odata.nextLink": ...,
"value": [{
"#odata.type": "#microsoft.graph.event",
"#odata.etag": ...,
"createdDateTime": "2017-09-29T13:42:30.2678102Z",
"lastModifiedDateTime": "2017-09-29T13:42:30.7678196Z",
"changeKey": ...,
"categories": [],
"originalStartTimeZone": "UTC",
"originalEndTimeZone": "UTC",
"iCalUId": "040000008200E00074C5B7101A82E008000000005644B0CB2839D301000000000000000010000000D82FB69E4CC6794B9EF363568AB26611",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Coffee",
"bodyPreview": "",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": ...,
"onlineMeetingUrl": null,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "<html><head><meta name=\"Generator\" content=\"Microsoft Exchange Server\">\r\n<!-- converted from text -->\r\n<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style></head>\r\n<body>\r\n<font size=\"2\"><span style=\"font-size:10pt;\"><div class=\"PlainText\"> </div></span></font>\r\n</body>\r\n</html>\r\n"
},
"start": {
"dateTime": "2017-09-29T16:00:00.0000000",
"timeZone": "Eastern Standard Time"
},
"end": {
"dateTime": "2017-09-29T16:30:00.0000000",
"timeZone": "Eastern Standard Time"
},
"location": {
"displayName": "Caf\ufffd"
},
"recurrence": null,
"attendees": [{
"type": "required",
"status": {
"response": "none",
"time": "0001-01-01T00:00:00Z"
},
"emailAddress": {
"name": "Betty Kennedy",
"address": ...
}
}],
"organizer": {
"emailAddress": {
"name": ...,
"address": ...
}
},
"id": "AAMkAGJmNjFhYjM1LTdlsddsa...",
"id": "AAMkAGJmNjFhYjM1LTdlsddsa..."
},
{
"#odata.type": "#microsoft.graph.event",
"#odata.etag": ...,
"createdDateTime": "2017-09-29T02:43:31.5152988Z",
"lastModifiedDateTime": "2017-09-29T02:43:32.1559359Z",
"changeKey": ...,
"categories": [],
"originalStartTimeZone": "UTC",
"originalEndTimeZone": "UTC",
"iCalUId": ...,
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Dinner",
"bodyPreview": "",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": ...,
"onlineMeetingUrl": null,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "<html><head><meta name=\"Generator\" content=\"Microsoft Exchange Server\">\r\n<!-- converted from text -->\r\n<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style></head>\r\n<body>\r\n<font size=\"2\"><span style=\"font-size:10pt;\"><div class=\"PlainText\"> </div></span></font>\r\n</body>\r\n</html>\r\n"
},
"start": {
"dateTime": "2017-09-29T19:00:00.0000000",
"timeZone": "Eastern Standard Time"
},
"end": {
"dateTime": "2017-09-29T20:00:00.0000000",
"timeZone": "Eastern Standard Time"
},
"location": {
"displayName": "Caf\ufffd"
},
"recurrence": null,
"attendees": [{
"type": "required",
"status": {
"response": "none",
"time": "0001-01-01T00:00:00Z"
},
"emailAddress": {
"name": "Jack Allen",
"address": ...
}
}],
"organizer": {
"emailAddress": {
"name": "xxxxx",
"address": "xxxx#xxxx.com"
}
},
"id": "AAMkAGJmNjFhYjdfsfsf...",
"id": "AAMkAGJmNjFhYjdfsfsf..."
}]
}
Any idea why I am getting "id" key twice?

cache-control in google dev tools

I'm playing around with Chrome Dev Tools and I have a question regarding the use of cache-control.
I have a simple app with an app.js and an application.css, and when I check disable cache in the toolbar both resources are downloaded from the server, but when I uncheck it, app.js is not downloaded again as it's in the browser cache, but the application.css is downloaded again.
I checked the response headers expecting to see a cache-control: no-cache for the application.css but... it's not there. Actually, the information in the response header regarding cache-control for application.css and for app.js is the same: there's no information.
Anyone knows or have any idea why this could be?
Thanks
EDIT: request and response headers
"request": {
"method": "GET",
"url": XXXXXXXXXX,
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Accept-Encoding",
"value": "gzip, deflate, sdch, br"
},
{
"name": "Host",
"value": XXXXXXXXXX
},
{
"name": "Accept-Language",
"value": "es-ES,es;q=0.8"
},
{
"name": "Upgrade-Insecure-Requests",
"value": "1"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36"
},
{
"name": "Accept",
"value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
},
{
"name": "Referer",
"value": XXXXXXXXXX
},
{
"name": "Cookie",
"value": XXXXXXXXXX
},
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "Cache-Control",
"value": "max-age=0"
}
],
"queryString": [],
"cookies": [
{
XXXXXXXXXX
}
],
"headersSize": 527,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Date",
"value": "Fri, 21 Apr 2017 08:41:14 GMT"
},
{
"name": "Last-Modified",
"value": "Sun, 16 Apr 2017 11:17:04 GMT"
},
{
"name": "Server",
"value": "nginx/1.10.1"
},
{
"name": "ETag",
"value": "\"58f352b0-7ad\""
},
{
"name": "Content-Type",
"value": "text/html"
},
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "Accept-Ranges",
"value": "bytes"
},
{
"name": "Content-Length",
"value": "1965"
}
],