• Resolved mattdawsonuk

    (@mattdawsonuk)


    Hi.

    I have recently updated to the ‘drive api’ version of the plugin and i am hitting a problem when granting permission in google.

    I have created a google app project and input the values into the plugin settings page which has connected successfully. When i choose ‘docs to wp’ in the settings menu of WordPress it takes me to this page (See screenshot). But when i click ‘accept’ it seems to just reload the page.

    Has anyone else experienced this or know what the problem is?

    Any help would be greatly appreciated as i am tearing my hair out at the mo!

    Thanks in advance.

    Matt

    https://www.ads-software.com/plugins/docs-to-wordpress/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Have you enabled your Drive API to your project? I had a similar problem and that was the solution for me.

    Create a new app project over at https;//console.developers.google.com. Make sure to enable the Drive API within the project (under APIs & Auth/APIs/Google Apps APIs/Drive API)

    This forum post covered a lot of issues – https://www.ads-software.com/support/topic/error-redirect_uri_mismatch-4?replies=11

    I’m no expert, but I’m happy to help if I can. You can hit me up on GChat during the work day (9am-5pm PST aka -7GMT) at tara (dot) kerwin (at) gmail.

    Thread Starter mattdawsonuk

    (@mattdawsonuk)

    Thanks for your reply tararebeka.

    Yes I have enabled the api and set up the redirect url. When using the plugin I actually get to the Google page which asks for the api permission. I get the impression I wouldn’t get that far if the api wasn’t enabled in the developer console. Also, the plugin gets to ‘connected’.

    Do you know what should happen when I click the accept button as per the screen grab I linked to in my original post?

    Matt

    It should bounce you back to the Settings page in your site.

    You can try resetting the secret in the Google App, then re-entering it into your settings.

    And this may not pertain to you, but I use two different Google IDs when I’m at work. I had a lot of trouble because I didn’t realize that it was always looking for stuff in whatever Google ID I was logged into at the time, rather than what was entered in the settings. I had to make sure that I was logged into Google with the same account I had used for my apps, otherwise it just wouldn’t work. Still happens when I run the cron to get my monthly articles even though everything is setup correctly.

    Thread Starter mattdawsonuk

    (@mattdawsonuk)

    Thanks. I’ll give that a try when I’m back at work on Thursday. And also make sure I’m signed in correctly.

    Matt

    Good luck. I know how frustrating it can be.

    Thread Starter mattdawsonuk

    (@mattdawsonuk)

    Well, the frustration is building!

    So, I am now running on a local wordpress install so i have greater control and freedom to hack things about.

    I have deleted any google app projects i had been experimenting/learning with and created a fresh one. I have also re-installed the Docs to WP plugin and cleared the database entries for the ID and Secret. I have updated to WP 4.2.2. PHP is running at Version 5.5.3. and Docs to WP is V1.1.

    I am now further ahead than i was on Monday as i can now click on Settings > Docs to WP and the side bar and it returns the correct settings page with the status of ‘connected’. This is after i accepted the api permission page. I can now see the ‘auth token’ refresh when i reload the page and i see the requests appear in the graph on the overview page for the app in the Google developer console.

    However, the posts still aren’t pulling through! I was getting the error “Syntax error, malformed JSON.” in the Abstract_Api.php. Reading this topic: https://www.ads-software.com/support/topic/10-beta-questionsissues?replies=26 i have tried removing the following code:

    switch (json_last_error()) {
    
    			case JSON_ERROR_NONE:
    				$error = null; // JSON is valid
    				break;
    
    			case JSON_ERROR_DEPTH:
    				$error = 'Maximum stack depth exceeded.';
    				break;
    
    			case JSON_ERROR_STATE_MISMATCH:
    				$error = 'Underflow or the modes mismatch.';
    				break;
    
    			case JSON_ERROR_CTRL_CHAR:
    				$error = 'Unexpected control character found.';
    				break;
    
    			// only PHP 5.3+
    			case JSON_ERROR_UTF8:
    				$error = 'Malformed UTF-8 characters, possibly incorrectly encoded.';
    				break;
    
    			case JSON_ERROR_SYNTAX:
    				$error = 'Syntax error, malformed JSON.';
    				break;
    
    			default:
    				$error = 'Unknown JSON error occured.';
    				break;
    
    		} 
    
    		if( !empty( $error ) ) {
    
    			throw new JsonException($error);
    
    		}

    I now no longer get any errors but still no posts! grrr.

    Can anyone help?? :-/

    Thanks.

    Matt

    Thread Starter mattdawsonuk

    (@mattdawsonuk)

    Breakthrough!! ?? – check your folder paths!

    I though i would give the origin and destination folder values a check and they looked odd! Along the lines of “https://drive.google.com/folderview?id=folderview?id=0AvbaiFDF9adfs8ALJDfadsf9JLKSDFjavadvasdf&usp=sharing”
    (note the double folderview?id=. I removed this and the id value below the field updated to the equivalent of: “0AvbaiFDF9adfs8ALJDfadsf9JLKSDFjavadvasdf”.

    After editing both folder fields and running the cron it now works!! ??

    Although i am left with an entry in the error log that looks like this after the import has finished: https://docs.google.com/feeds/download/documents/export/Export?id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_MsOtxY8&exportFormat=html (id replaced with X’s).

    Do i need to worry about this?

    Also, it seems that all Bold and Italic formatting is being stripped on import. Is there a reason for that? I notice this topic mentions it too: https://www.ads-software.com/support/topic/bolditalic-links-categories-authors-no-longer-transfer?replies=2.

    thanks all.

    Matt

    Congratulations!

    And yeah, we’re all still waiting on the bold/italics issue. Hands are tied until the busy guys in Bangor can fix it.

    Thread Starter mattdawsonuk

    (@mattdawsonuk)

    Just adding a note to point to my latest post about a fix for the bold and italic styling. See my post here

    Plugin Author William P. Davis

    (@wpdavis)

    Glad to hear this got resolved!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Drive 'Request Permission' Loop!’ is closed to new replies.