Status Update
Comments
ad...@infinitewoofs.com <ad...@infinitewoofs.com> #2
Other than that, instanceState of the child fragment is preserved properly when navigating back and forth.. It's just that it's view is removed prematurely for some reason.
co...@hc-planning.com <co...@hc-planning.com> #3
So where do we go from here, is this a bug for you to fix, or there's something wrong with my nested navigation graph implementation, in which case I'd like you to point me in the right direction how to fix it?
jo...@pwc.com <jo...@pwc.com> #4
ek...@google.com <ek...@google.com> #5
I slowed down the animations so you can see what's happening.
Root Fragment A is the one with BottomNavigationBar on the bottom.
GREEN - Fragment A's CHILD fragment (the one that's disappearing)
RED - Destination Fragment
Press "Settings" in the action menu on the upper right to start navigation. Observe how Root Fragment A is visible during the whole animation with it's BottomNavigationBar, but it's CHILD GREEN fragment disappears immediately, as it is part of the nested navigation graph hosted in the Fragment A itself.
On the way back, Fragment A is properly recreated with it's green child fragment, and both are visible properly (when going back in the direction A <- B).
fr...@gmail.com <fr...@gmail.com> #6
I suspect this is a Fragment issue and not something Navigation can control. I'd be interested to know if you run into the same issue if you have *any* Fragment, rather than a NavHostFragment, between your child of A and A itself.
ad...@infinitewoofs.com <ad...@infinitewoofs.com> #7
I'll attach the project directly so you can test it yourself, and if it is the problem with Fragments, then let's open the issue for Fragments..
fr...@gmail.com <fr...@gmail.com> #8
js...@gmail.com <js...@gmail.com> #9
Branch: androidx-master-dev
commit c53170c58309d7370d63d5386e83fce4cee02ba2
Author: jbwoods <jbwoods@google.com>
Date: Wed Jun 26 17:58:38 2019
Avoid grandchild Fragment animations running during parent Fragment transactions
Follow-up to aosp/951635. Child fragment views are not destroyed when the parent
is animated, but grandchild fragment views are.
This change checks up the ancestor hierarchy to ensure fragment views
will not be destroyed if any of its ancestors are being removed.
Test: Added unit Test
BUG: 116675313
Change-Id: Ie65ae2fb150340b51bb0362cfa84f320ee2e8c7e
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
is...@gmail.com <is...@gmail.com> #10
kp...@gmail.com <kp...@gmail.com> #11
[Deleted User] <[Deleted User]> #12
ek...@google.com <ek...@google.com> #13
Provide a 1 line caption in 15 words capturing key details. Start with introducing it like "This image" -
od...@ciencias.unam.mx <od...@ciencias.unam.mx> #15
da...@gmail.com <da...@gmail.com> #16
lt...@gmail.com <lt...@gmail.com> #17
[Deleted User] <[Deleted User]> #18
pa...@gmail.com <pa...@gmail.com> #19
There is definitely a bug in this case.
But, when using the event from a linked spreadsheet, it works like a charm (values, namedValues, range are define and contain all answers).
ek...@google.com <ek...@google.com> #20
mf...@gmail.com <mf...@gmail.com> #21
function onFormSubmit(er) {
FormApp.getActiveForm();
Logger.log(er);
Logger.log(typeof(er));
Logger.log(er.values);
Logger.log(er.namedValues);
}
gives me
[19-01-20 11:35:27:919 PST] [object Object]
[19-01-20 11:35:27:920 PST] object
[19-01-20 11:35:27:921 PST] undefined
[19-01-20 11:35:27:921 PST] undefined
Max
sa...@gmail.com <sa...@gmail.com> #22
wc...@email.vccs.edu <wc...@email.vccs.edu> #23
function onFormSubmitBug(e) {
// Logger.log('onsubmitform');
// logging the e event, you can create a test function with that data
Logger.log("%s", JSON.stringify(e));
}
Data is all empty
[19-02-23 16:19:53:333 EST] {"authMode":{},"values":["2/23/2019 16:19:49","","","","",""],"namedValues":{"Course ID":[""],"Role":[""],"User":[""],"Timestamp":["2/23/2019 16:19:49"],"Reason":[""],"Email Address":[""]},"range":{"columnStart":1,"rowStart":2,"rowEnd":2,"columnEnd":1},"source":{},"triggerUid":"8844625953321300309"}
ri...@gmail.com <ri...@gmail.com> #24
ho...@gmail.com <ho...@gmail.com> #25
he...@gmail.com <he...@gmail.com> #26
I have recreated a new test form... with one field only: Name
Submission Script:
function submitMyForm(e) {
FormApp.getActiveForm();
Logger.log(e);
}
Added Manifest:
{
"timeZone": "Asia/Hong_Kong",
"oauthScopes": [
"
"
],
"dependencies": {
},
"exceptionLogging": "STACKDRIVER"
}
Added Trigger:
* submitMyForm
* From Form
* On Form Submit
Result:
Logger result = none
ti...@gmail.com <ti...@gmail.com> #27
tigerfire813@gmail.com; tigersnow813@gmail.com; brendaltiger813@gmail.com; mystiiisland@gmail.com; coconut.cannons@gmail.com, recognize any of these accounts? They're all mine and I am FUCKING PISSED OFF.
ti...@gmail.com <ti...@gmail.com> #28
That nifty lil trick you use to hack unactivated prepaid phones, when the owner of such phone turns it on for the first, it says deleting... Then you upload your shit on to it and highjack their phone. That one is going to the media, so everyone can know exactly how insecure their devices truly are.
ti...@gmail.com <ti...@gmail.com> #29
ti...@gmail.com <ti...@gmail.com> #30
st...@gmail.com <st...@gmail.com> #31
ao...@g.ucla.edu <ao...@g.ucla.edu> #32
The most basic example, Logger.log("%s",JSON.stringify(e)), results in the inexplicable execution logs below. The ID is incorrect, and seems to be from a different source.
[19-10-08 15:20:36:281 PDT] Starting execution
[19-10-08 15:20:36:329 PDT] PropertiesService.getScriptProperties() [0 seconds]
[19-10-08 15:20:36:347 PDT] PropertiesService.Properties.getProperty([1138776361917580536]) [0.017 seconds]
[19-10-08 15:20:36:658 PDT] FormApp.getActiveForm() [0.309 seconds]
[19-10-08 15:20:36:788 PDT] FormApp.Form.getResponse([2_ABaOnufRXrbRfaVCakRQAN56hG30QLGfveC9RJlalVpz]) [0.129 seconds]
[19-10-08 15:20:36:794 PDT] Execution failed: No response with ID 2_ABaOnufRXrbRfaVCakRQAN56hG30QLGfveC9RJlalVpz exists for this form. (line 11, file "Signup") [0.462 seconds total runtime]
pa...@gmail.com <pa...@gmail.com> #33
bo...@gmail.com <bo...@gmail.com> #34
{"authMode":{},"response":{},"source":{},"triggerUid":"2302230"}
my oauthScopes are as follows:
"oauthScopes": [
"
"
"
]
sm...@gmail.com <sm...@gmail.com> #35
function onFormSubmit(e) {
...
GmailApp.sendEmail(emailAddress, 'test values', JSON.stringify(e));
...
}
I get this in the e-mail
{
"authMode": {},
"values": [
... stuff from the form
],
"namedValues": {
... stuff from the form
},
"range": {
... the row that is edited
},
"source": {},
"triggerUid": "2412724"
}
kr...@gmail.com <kr...@gmail.com> #36
{ authMode:
{ toString: [Function: toString],
name: [Function: toString],
toJSON: [Function: toString],
ordinal: [Function: ordinal],
compareTo: [Function: compareTo],
NONE:
{ toString: [Function: toString],
name: [Function: toString],
toJSON: [Function: toString],
ordinal: [Function: ordinal],
compareTo: [Function: compareTo],
NONE: [Circular],
CUSTOM_FUNCTION: [Object],
LIMITED: [Object],
FULL: [Circular] },
CUSTOM_FUNCTION:
{ toString: [Function: toString],
name: [Function: toString],
toJSON: [Function: toString],
ordinal: [Function: ordinal],
compareTo: [Function: compareTo],
NONE: [Object],
CUSTOM_FUNCTION: [Circular],
LIMITED: [Object],
FULL: [Circular] },
LIMITED:
{ toString: [Function: toString],
name: [Function: toString],
toJSON: [Function: toString],
ordinal: [Function: ordinal],
compareTo: [Function: compareTo],
NONE: [Object],
CUSTOM_FUNCTION: [Object],
LIMITED: [Circular],
FULL: [Circular] },
FULL: [Circular] },
response: {},
source: {},
triggerUid: '3286678' }
[Deleted User] <[Deleted User]> #37
cr...@gmail.com <cr...@gmail.com>
sa...@gmail.com <sa...@gmail.com> #38
I am able to get the response back using the following code. I have tried to comment inline. The function has to be registered as onFormSubmit trigger. I used the UI to register the trigger (Edit > Current Project's Triggers), but the code way may work as well.
function myFunction(e) {
// Following is not useful. Returns: {"authMode":"FULL","response":{},"source":{},"triggerUid":"XXX"}
Logger.log("%s", JSON.stringify(e));
// Get the active form
var form = FormApp.getActiveForm();
// form.getResponses().length will give all the responses that have been received so far.
var message = 'There have been ' + form.getResponses().length + ' response(s) so far. Latest Response:\n';
// Get the item responses. Not sure how or why this is working, when print of "e" shows that response is blank. But it works.
var itemResponses = e.response.getItemResponses();
//console.log(JSON.stringify(itemResponses)); // Returns [{}]
//Logger.log("%s", JSON.stringify(itemResponses)); // Returns [{}]
// Below will directly give the response from the first item (which is the only item in my test form)
console.log("Number of responses: " + itemResponses.length + ", value: " + itemResponses[0].getResponse());
// Below will collect all the responses from all the items.
for (var i = 0; i < itemResponses.length; i++) {
var itemTitle = itemResponses[i].getItem().getTitle();
var itemResponse = JSON.stringify(itemResponses[i].getResponse());
message += itemTitle + ': ' + itemResponse + '\n';
}
Logger.log("%s", message);
}
Hope this helps.
ri...@reneodlt.com <ri...@reneodlt.com> #39
ma...@gmail.com <ma...@gmail.com> #40
Can reproduce same behavior as #38.. incredibly weird bug in my opinion
ek...@google.com <ek...@google.com>
ia...@google.com <ia...@google.com> #41
I am able to reproduce this behavior and have re-filed this internally for review.
Thank you for your continued reports and patience, any further updates will be posted here.
ia...@google.com <ia...@google.com> #42
I think that a lot of the problems encountered in this thread perhaps stem from a confusion with the fact that there are two onFormSubmit triggers. One that can be bound to the spreadsheet and one that can be bound to the form.
To use it from the form, a snippet like this works:
function createTrigger() {
let form = FormApp.getActiveForm();
ScriptApp.newTrigger('test')
.forForm(form)
.onFormSubmit()
.create();
}
function test(e){
Logger.log(JSON.stringify(e))
Logger.log(e)
Logger.log(e.response)
let responses = e.response.getItemResponses()
for (i = 0; i<responses.length ; i++){
Logger.log(responses[i].getResponse())
}
}
To get the values from the event object when triggered from the form side.
To use it from the spreadsheet, a snippet like this works:
function createTrigger() {
let ss = SpreadsheetApp.getActiveSpreadsheet();
ScriptApp.newTrigger('test')
.forSpreadsheet(ss)
.onFormSubmit()
.create();
}
function test(e){
Logger.log(JSON.stringify(e))
Logger.log(e.range)
Logger.log(e.namedValues)
Logger.log(e.values)
Logger.log(e.triggerUid)
}
Note the difference between the event object if it is bound to the spreadsheet and the form.
Some links for further reading:
FORM EVENTS
https://developers.google.com/apps-script/guides/triggers/events#google_forms_events https://developers.google.com/apps-script/reference/script/form-trigger-builder
SPREADSHEET EVENTS
https://developers.google.com/apps-script/guides/triggers/events#google_sheets_events https://developers.google.com/apps-script/reference/script/spreadsheet-trigger-builder
I will request a review of the documentation to make this clearer.
su...@smsreminder.app <su...@smsreminder.app> #43
ga...@gmail.com <ga...@gmail.com> #44
{"authMode":{},"response":{},"source":{},"triggerUid":"8034945621658090506"}
My code:
var trigger = ScriptApp.newTrigger('onFormSubmit')
.forForm(form)
.onFormSubmit()
.create();
Please shed some light if possible.
id...@google.com <id...@google.com>
id...@google.com <id...@google.com> #45
The documentation has been updated to clarify the use of the onFormSubmit
trigger for Sheets
and Forms
.
Sheets:
Form:
ka...@circlegraphicsonline.com <ka...@circlegraphicsonline.com> #46
e.response = valid on Form A
e.response = empty on Form B
re #42 -- it's not an issue with sheets/forms for most people. We're working with FORMS the whole time and there is a BUG on a copied form.
Deleting/recreating the trigger doesn't seem to change anything. Tried creating the trigger via code/via gui, no change.
using the workaround in #38 we've got things moving again to do length - 1 and get the MOST RECENT response, but we still want the INDEX in formSubmit() not the most recent.
ie, if i have 10 responses i can always get number 10 now. but if the user edits response 3 i want to get THREE as the index and that's not working.
function newFormSubmit(e){
var form = FormApp.getActiveForm();
var respIndex = form.getResponses().length - 1;
//console.log("Index = " + respIndex);
// console.log("Event obj = " + JSON.stringify(e.response));
// we want e #, not the form max #!
respIndex = e.response.responseNumber;
return;
}
how to get THREE instead of MOST RECENT?
if responseNumber doesn't work that's ok but below works in A
function onFormSubmit(e) {
var formResponse = e.response;
var itemResponses = formResponse.getItemResponses();
Description
First, please search through existing issues to ensure that the bug has not already been reported. You can start the search here:
If the issue has already been reported, you can click the star next to the issue number to subscribe and receive updates. We prioritize responding to the issues with the most stars. You can also comment on the issue to provide any details of your experience with it.
If your issue has not been reported, please provide all of the following:
-----------------------------------------------------------------------------------------------------------------------------
A short description of the issue:
The event object passed to the script when the On Form Submit trigger happens, does not have a FormResponse object in the event object.
A small code sample that reliably reproduces the issue. The sample should run as-is or with minimal setup, without external dependencies.
I have a google form, and have added a script to it.
function myFunction(e)
{
Logger.log(e);
var formResponse = e.response;
var itemResponses = formResponse.getItemResponses();
}
Then I went to Edit > Current Project Triggers
I added a new trigger, selecting myFunction, and the following settings:
Select Event Source = From Form
Select Event Type = On form submit
What steps will reproduce the problem?
1. Fill in the form
2. Hit submit
3. Look at the logs of the script to see the Logger.log output
4. Go look at the execution error logs
What is the expected output? What do you see instead? If you see error messages, please provide them.
I expect there to be a response object in the event object. Instead the event object has the following:
{authMode=FULL, source=Form, triggerUid=25580}
And I get the following error message in My Executions
ERROR
TypeError: Cannot call method "getItemResponses" of undefined.
Please provide any additional information below.