Support

Akeeba Ticket System

#33440 Enabling GMail API for mailfetch

Posted in ‘Akeeba Ticket System for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Ticket System version
n/a

Latest post by on Saturday, 22 August 2020 17:17 CDT

weeblr

Hi guys,

Updating to ATS 3.4.2 I enjoy having to reconfigure email fetching. Being familiar with Google oauth, it was not that bad but I'm stuck at the step where I'm supposed to "Sign in with Google".

 

1. App is created, with client ID and secret filled in

2. Click "Authorize GMail" button

3. Nothing happens. Litterally. 

- no error in console

- no XHR or otherwise request except for the gmail_pressed.png and gmail_focus.png images being loaded.

- tried in current Edge 84.0, Chrome 84.0, Firefox 78.0.2

- Dev tools shows no blocked requests

- I disabled ALL extensions to be on the safe side, although I don't run any security or privacy extension

Due to time constraints, I started debugging a bit and found by adding some console.log that the eventListener added on the Sign-in button was never called for some reason. 

I added another click handler calling the same code, using document.getElementById('an_id_added_to_the_button') insted of the original akeeba.System.iterateNodes('button.plgAtsMailFetchGmailButton' + akeeba.System.addEventListener

and from there the click handler was triggered and I was able to complete the sign-in (emails are now fetched).

Just leaving this here as I found it, I could not dig deeper.

Cheers

Yannick

 

 

nicholas
Akeeba Staff
Manager

I believe this is linked to another JavaScript issue I was hunting down two days ago that has to do with the script load order.

I have been refactoring our JavaScript to remove attribute based event handlers and make all our JS load deferred. The problem is that we have scripts which depend on one another. Being defered means that the load order is not guaranteed. This was not properly addressed in 3.4.2. I have a solution for that but I need to go through all the JavaScript again to make sure I am not missing anything.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr

OK, good that you're on it. The odd things are:

 

- those bits are harcoded script tags in the HTML

- no console error which should probably happen if the akeeba.System bits are not there yet.

 

That said, I have completed the gmail workflow so I'll leave it to you.

 

Cheers

 

nicholas
Akeeba Staff
Manager

The problem was with the loading order of the scripts. The inline script generated by the form field was running before the System.min.js file got loaded.

Thank you for the heads up!

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!