Modal view not working in Firefox v82 or v83

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
ckebbell
Veteran Member
Posts: 30
Joined: 2020-01-28 18:09

Modal view not working in Firefox v82 or v83

Post by ckebbell » 2020-11-18 16:23

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?

ckebbell
Veteran Member
Posts: 30
Joined: 2020-01-28 18:09

Re: Modal view not working in Firefox v82 or v83

Post by ckebbell » 2020-11-30 11:17

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 925 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 925 times

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 968
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Modal view not working in Firefox v82 or v83

Post by jsetzer » 2020-11-30 11:41

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
Kind regards,
<js />

ckebbell
Veteran Member
Posts: 30
Joined: 2020-01-28 18:09

Re: Modal view not working in Firefox v82 or v83

Post by ckebbell » 2020-11-30 13:42

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

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 968
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Modal view not working in Firefox v82 or v83

Post by jsetzer » 2020-11-30 13:55

Thanks, same to you!
Kind regards,
<js />

User avatar
a.gneady
Site Admin
Posts: 1145
Joined: 2012-09-27 14:46
Contact:

Re: Modal view not working in Firefox v82 or v83

Post by a.gneady » 2020-11-30 14:43

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.
:idea: Calendar plugin: Organize your data into beautiful calendars.
:arrow: Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
:arrow: Summary Reports plugin: Build powerful reports and charts for your AppGini apps.
:arrow: Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.

ckebbell
Veteran Member
Posts: 30
Joined: 2020-01-28 18:09

Re: Modal view not working in Firefox v82 or v83

Post by ckebbell » 2020-12-08 10:21

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?

federico
Posts: 25
Joined: 2020-10-29 14:52

Re: Modal view not working in Firefox v82 or v83

Post by federico » 2020-12-08 15:21

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

User avatar
a.gneady
Site Admin
Posts: 1145
Joined: 2012-09-27 14:46
Contact:

Re: Modal view not working in Firefox v82 or v83

Post by a.gneady » 2020-12-11 18:59

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.
:idea: Calendar plugin: Organize your data into beautiful calendars.
:arrow: Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
:arrow: Summary Reports plugin: Build powerful reports and charts for your AppGini apps.
:arrow: Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.

ckebbell
Veteran Member
Posts: 30
Joined: 2020-01-28 18:09

Re: Modal view not working in Firefox v82 or v83

Post by ckebbell » 2020-12-21 12:28

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.

User avatar
a.gneady
Site Admin
Posts: 1145
Joined: 2012-09-27 14:46
Contact:

Re: Modal view not working in Firefox v82 or v83

Post by a.gneady » 2020-12-22 16:30

Thanks and same to you :)
I'll include this fix in the next release.
:idea: Calendar plugin: Organize your data into beautiful calendars.
:arrow: Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
:arrow: Summary Reports plugin: Build powerful reports and charts for your AppGini apps.
:arrow: Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.

ckebbell
Veteran Member
Posts: 30
Joined: 2020-01-28 18:09

Re: Modal view not working in Firefox v82 or v83

Post by ckebbell » 2020-12-23 11:37

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.

ckebbell
Veteran Member
Posts: 30
Joined: 2020-01-28 18:09

Re: Modal view not working in Firefox v82 or v83

Post by ckebbell » 2021-01-22 12:52

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');
});

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 968
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Modal view not working in Firefox v82 or v83

Post by jsetzer » 2021-01-22 13:21

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?
Kind regards,
<js />

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 968
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Modal view not working in Firefox v82 or v83

Post by jsetzer » 2021-01-22 16:01

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.
Kind regards,
<js />

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 858
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Modal view not working in Firefox v82 or v83

Post by onoehring » 2021-01-26 08:33

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

ckebbell
Veteran Member
Posts: 30
Joined: 2020-01-28 18:09

Re: Modal view not working in Firefox v82 or v83

Post by ckebbell » 2021-02-08 01:52

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.

Post Reply