Page 1 of 1

Modal view not working in Firefox v82 or v83

Posted: 2020-11-18 16:23
by ckebbell
Hi all

I am having an issue with the PDF / Custom buttons in the new version of Firefox (bkerr is having the same issue in Chrome on this forum post viewtopic.php?f=11&t=3984).

I have created several custom buttons that open a Word document (invoices, Purchase Orders, etc) from a table, using the SelectedID of the record that is being viewed. I also have records that show an icon for a PDF document.

In Firefox v81, when I open a PDF / click on my custom button from the modal view, it works perfectly. The PDF opens in a new tab, the custom button opens my Word doc.

In Firefox v82 / v83, when I open a PDF / click on my custom button from a modal view, it opens a new blank tab. Nothing else.

I have to open the record in the Detail View for both the PDF or the custom buttons to work (so I have to go to the relevant table, then open the relevant record to be able to view the PDF / open the Custom Word doc).

I think this is something to do with the new Firefox not recognising the selectedID of the modal view, but nothing appears in my browser console.

Can anyone help?

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-11-30 11:17
by ckebbell
Please can anyone help with this? It is very very annoying! I cannot use Appgini modal views at the moment, as this issue is affecting every modal and there is nothing shown in the Firefox console to help me narrow it down.

I have attached screenshots to explain more clearly. The first screenshot is the Detail view of the parent record, showing the child tabs. If I click on the download icon of the child record (highlighted), the attachment opens fine.
DV.JPG
DV.JPG (71.4 KiB) Viewed 9276 times
The second shot is the modal view of the same child record. If I click on the download icon (highlighted) it opens a blank tab. This is happening across all my Appgini modal views - I can open the attachment from the main record but not in modal, whether it is PDF, Word, or JPG.
modal.JPG
modal.JPG (72.15 KiB) Viewed 9276 times

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-11-30 11:41
by jsetzer
Hi Christina,

I do not have a solution but I have just tested a similar scenario and must confirm this issue.

You should send a detailed bugreport to BigProf, I think.

Not working in ...
Working in ...
  • Firefox
    82.0.3
    64-Bit
  • 83.0
    64-Bit

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-11-30 13:42
by ckebbell
Thank you Jan!

I will send a bug report now via email, I am glad that someone else is experiencing the same issue (not glad, but at least I am not going crazy!)

Have a wonderful week

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-11-30 13:55
by jsetzer
Thanks, same to you!

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-11-30 14:43
by a.gneady
Hmm ... Modal window displays content in an iframe. Iframes have a sandbox attribute that determines the permissions of the iframe. AppGini apps set the sandbox attribute by default to allow-modals allow-forms allow-scripts allow-same-origin allow-popups but I guess this issue might be fixed by adding the permission allow-popups-to-escape-sandbox to the sandbox attribute. I'll inspect this and see if it works.

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-12-08 10:21
by ckebbell
Hi Ahmad

I have tried sending a bug report to the support email - however I have had a postmaster bounceback saying the message has failed due to a DNS error.

Shall I resend?

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-12-08 15:21
by federico
I have the same problem with Microsoft Edge. I can just view the file if I use the riht click - open in another tab
thanks

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-12-11 18:59
by a.gneady
For a temporary fix (will need to be re-applied if you regenerate your app) till the next release, please open the generated 'common.js.php' file in a text editor, and find this code:

Code: Select all

sandbox="allow-modals allow-forms allow-scripts allow-same-origin allow-popups"
To:

Code: Select all

sandbox="allow-modals allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"
You should find 2 occurances of this code. Please change both.

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-12-21 12:28
by ckebbell
Yay it worked!

Thank yo so much Ahmad, we can now work using our app again (and update our FIrefox!)

Have a wonderful holiday season and stay safe.

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-12-22 16:30
by a.gneady
Thanks and same to you :)
I'll include this fix in the next release.

Re: Modal view not working in Firefox v82 or v83

Posted: 2020-12-23 11:37
by ckebbell
Hi
Thank you for doing this - it works on the PDF downloads, but it doesn't work on the custom invoice buttons I created using the Udemy course :(

I can work around it by going directly to the DV of the child record and using my custom buttons, but it was easier when I could use the modal view from the parent record!

Anyway, thank you for all your hard work on Appgini, it is a wonderful tool.

Re: Modal view not working in Firefox v82 or v83

Posted: 2021-01-22 12:52
by ckebbell
Hi all

Sorry, am just bumping this one in case someone can come up with a fix for the buttons in modal view.

So, I can now open PDFs using the download link after applying Ahmad's fix.

But I cannot use my invoice buttons created - I was wrong in my earlier posts, they are actually created using Appgini Helper (code as below).

Is there a fix I can apply to the code so that it can use the modal view?

Code: Select all

//var dv = new AppGiniDetailView();
var actionbuttons = dv.actionbuttons;
var group = actionbuttons.addGroup("Accounts");

group.addButton("Create PO", function () {
	var selectedID = $j('input[name=SelectedID]').val();
	var supplierid = $j('#supplier').val();
	var jobid = $j('#jobid').val();
	var url_open = 'POrder.php?jobid=';
	window.open(url_open + jobid + '&supplierid=' + supplierid + '&jobitemid=' + selectedID + '&clear_session=1');
});

Re: Modal view not working in Firefox v82 or v83

Posted: 2021-01-22 13:21
by jsetzer
Is dv declared somewhere else, perhaps in header-extras.php

What exactly is the problem: are the buttons missing or is the called function not working?

Any errors in console?

Re: Modal view not working in Firefox v82 or v83

Posted: 2021-01-22 16:01
by jsetzer
Concat the url into a separate variable and validate the value.

Instead of window.open function you can try window.location.href property which I am using for redirecting. From my experience the href property is compatible with different browsers.

Re: Modal view not working in Firefox v82 or v83

Posted: 2021-01-26 08:33
by onoehring
Hi,

just want to add: I have a customer who had problems with JS in current browsers (Edge, Chrome, Vivaldi, Firefox (84.x)) - but not in IE6. There seem to be some changes in the security area which might cause these "problems" with "our" "old" JS.
In that case it was not an AppGini application, but a simple form, which was not submitted anymore by JS. Why? Don't know, but adding a simple

Code: Select all

document.uploadForm.submit();
made everything working as before :D
(I want to add again: No AG application and not my original code ;-) )

Olaf

Re: Modal view not working in Firefox v82 or v83

Posted: 2021-02-08 01:52
by ckebbell
Hi all sorry to post and run, life got busy for a while there!

I found a fix - it was very similar to Ahmad's fix, I found it when researching the changes in v82 of Firefox. Thank you Olaf and Jan for your assistance - it was the called function that was not working (the button was fine), it was all due to the new sandbox restrictions "feature" in v82, which was preventing my created Word invoice from being downloaded from Modal view.

To allow my word documents to open from the button in the modal view, I just had to add allow-downloads to the sandbox code. So, in common.js, I edited the sandbox line (2 occurences) to:

Code: Select all

sandbox="allow-modals allow-forms allow-scripts allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox" '
Sorry if this was very obvious to everyone else, I am a part-time coder and sometimes it takes me a long time to learn things! Thank you all for your help.