Okay
  Public Ticket #2830640
Google Calendar integration
Closed

Comments

  • Alayn started the conversation

    I am trying to link an employees schedule to their google calendar. I have already followed all the steps in detailed  and watched a video. I have deleted and created a new google project from multiple different accounts but I am unable to get the sign in function to work. 

    I have performed all the administrative steps to set this up. I then go to sign into google account in the employee area and it give me the standard verification messages that have been described. I clinic continue through all of them and check the give permission checkbox after signing into google with her account. Once that is complete it redirects be back to the employees panel but when I clinic the employees name it still says sign into good and it doesnt say the account has been added. Thank you

  • [deleted] replied

    Hi Alayn

    Thank you for reaching out to us.

    You need to check the redirect URI in your database and change it if it isn't the same as your website's domain. Also, please check if this URI is the same in your Google account console.

    In your database, you have to find the wp_options table:

    6172199762.png

    In your case, it is possible for it to have a different prefix but it will end like your_prefix_options. 

    Then you have to find the option name amelia_settings in this table.

    1791739968.png

    When you find that you have to edit that property and to find there the string redirectURI , so you will probably find something like this:

    2773446103.png

     It needs to have the escape characters " \ ", so don't remove those. Simply check if the URI is the same as in Amelia/Google Calendar Settings and if it isn't, please modify it here. Please note that if you use https you will need to update it also in redirectURI option.

    When you finish with this please check if the URI is the same in the field Authorized redirect URL's on "Create OAuth client ID" section in your Google credentials section.

    7826777834.png

    Sometimes this issue comes up, mostly when there is security involved so there is a mismatch in http/https and sometimes users don't press Enter (after typing the domain in the required field in 'Authorized redirect URIs') to add it before clicking on 'Save' in the Google Cloud Platform. So the field stays empty and causes the issue. This is why you need to go on in the database and change it manually. 

    Please let me know if this helped.


  • Alayn replied

    I have checked all the addresses. I have attached the pictures. Capture 1 was the first location in the database that I found the address. This was correct. Capture 2 was the second location I found the address in. This did not have the part after wp-admin so i added that in. Then capture_3 is the google console information. Unfortunately this did not work. I tried making a new employee and tried it again and it did not work. Please let me know if I need to change the URL in the capture 2 image back to where it was. Thank you. 

  • [deleted] replied

    Hi Alayn

    The settings look ok. The plugin may have added too many connection tokens in the database.

    To verify this, please go into wp_amelia_providers_to_google_calendar database table, and check if the same User Id is associated to multiple tokens. If it is, please delete them all and try again.

    If that doesn't resolve the issue, please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. 

    You can write credentials here just check Private Reply so nobody can see them except us.


  •   Alayn replied privately
  • [deleted] replied

    Hi Alayn

    Unfortunately we are not able to log in using those credentials, please check them

    3278350794.png


  •   Alayn replied privately
  • [deleted] replied

    Thank you , we were able to log in.

    The problem can be that some of JS scripts on page is removing required URL parameter (from address bar) that google API has set as part of redirect URL. That parameter is named "code" and is removed on every page.

    To resolve the issue without turning off plugins or switching theme (I would need to do that in order to find where this issue happens), please add this WordPress action in "mu-plugins/functions.php" that will return required parameter in Address Bar.

    function custom_amelia_admin_js() {
        if (!empty($_GET['page']) && $_GET['page'] === 'wpamelia-employees' && !empty($_GET['code'])) {
            $code = $_GET['code'];
            echo "
            <script>
              var url = new URL(window.location.href);
              url.searchParams.set('code', '" . $code . "');
              window.history.replaceState(null, null, url);
            </script>
            ";
        }
    }
    add_action('admin_footer', 'custom_amelia_admin_js');
    

    Do let me know if you still have the same issue.

  • Alayn replied

    hi would you be able to provide details on how to go about doing this? 

  • [deleted] replied

    Hi Alayn

    As I mentioned before you would need to add this WordPress action in "mu-plugins/functions.php" file on your computer that will return required parameter in Address Bar.

    function custom_amelia_admin_js() {
        if (!empty($_GET['page']) && $_GET['page'] === 'wpamelia-employees' && !empty($_GET['code'])) {
            $code = $_GET['code'];
            echo "
            <script>
              var url = new URL(window.location.href);
              url.searchParams.set('code', '" . $code . "');
              window.history.replaceState(null, null, url);
            </script>
            ";
        }
    }
    add_action('admin_footer', 'custom_amelia_admin_js');

    I will forward this to our Level 2 as well to keep investigating, and see if there are any other solutions we can offer you.


  • Alayn replied

    yes but this means nothing to me. Where do i go to do that. What exactly do it click to get to that location?

  • Alayn replied

    OK i was able to have my hosting company upload the code for me in the file. Unfortunately it gave me the following error when I tried to get to the wordpress website login at danceruniversity.com/wp-admin

    function custom_amelia_admin_js() { if (!empty($_GET['page']) && $_GET['page'] === 'wpamelia-employees' && !empty($_GET['code'])) { $code = $_GET['code']; echo " "; } } add_action('admin_footer', 'custom_amelia_admin_js');


    I had to delete the code

  •  2,572
    Aleksandar replied

    Hello Alayn

    This is caused by a conflict with some other plugin, for sure.

    We fixed the issue on your website by adding the following code into /wp-content/plugins/ameliabooking/view/backend/view.php:

    <?php
    if (!empty($_GET['page']) && $_GET['page'] === 'wpamelia-employees' && !empty($_GET['code'])) {
            $code = $_GET['code'];
            echo "
            <script-->
              var url = new URL(window.location.href);
              url.searchParams.set('code', '" . $code . "');
              window.history.replaceState(null, null, url);
            
            ";
        }
    ?>
    

    This will be added in the next update, so you won't need to do it again. Kind regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • kevinruess replied

    Just a note that I had a similar issue and this fixed helped me solve a conflict with a plugin MailOptin - Lite. I used the Health Check & Troubleshooting plugin to figure out which plugin was causing the issue (a critical tool for WP sites these days).


    Thanks so much for this open forum where we can find out solutions to our own difficult technical issues!

  •  2,572
    Aleksandar replied

    Hello kevinruess

    Thank you for sharing that with everyone!

    If you have any questions or issues, please feel free to open a new ticket, and we'll gladly help.


    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables