• Resolved peter8nss

    (@peter8nss)


    I’m getting error “No such directory found in this gallery – it may have been deleted or renamed.” when fetching second set of images from a shortcut folder.

    I think the problem is in function “check_directory_in_directory” as the parent Google returns is the underlying folder’s parent rather than the shortcut’s parent. Hence there is a mismatch and an exception is raised from this code:

    if ( ! in_array( $parent_id, $response->getParents(), true ) ) {
    					throw new Directory_Not_Found_Exception();
    				}
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter peter8nss

    (@peter8nss)

    nb: I’m not seeing this behaviour on all shortcut folders. I need to check why some are and some are not.

    Thread Starter peter8nss

    (@peter8nss)

    I think the randomness I’m seeing is because the folder verification and page fetches are both being done asynchronously at the same time. I think the use of “Utils::all” at the end of API_Client::execute is intended to cause an error to be returned if either fails, but I don’t think that will always be reached. If the page fetch returns first, then I think its use of wp_send_json, in the response processing, will effectively stop the processing (by calling “wp_die” or “die”) before that check is reached.

    It seems a bit strange to queue the page fetch before you have confirmed the path is valid. And as noted at the start, I’m not sure the path checking works for a google shortcut anyway.

    Thread Starter peter8nss

    (@peter8nss)

    If you replace “wp_send_json( $page )” by “return new FulfilledPromise( $page )” you can defer calling “wp_send_json” until after the “all” aspect of the promise has been evaluated. Then just apply wp_send_json to the first non-null response from “API_Client::execute”.

    Doing this for Frontend Page and Gallery classes seems to remove the randomness of the folder verify checks. Unfortunately, that means all shortcut folders then fail the verification.

    Plugin Author Michal Janata

    (@kalich5)

    Technical improvements please directly on GitHub.

    https://github.com/skaut/skaut-google-drive-gallery/issues

    Plugin Author Marek Dědič

    (@marekdedic)

    Hi,
    thanks, I’ve seen the issues on GitHub and will look into it, there is some issue with shortcuts in general. It seems that the problem happens when the shortcut name is different from the original folder name, so maybe in the meantime that could help.

    Thanks,
    Marek

    Plugin Author Marek Dědič

    (@marekdedic)

    Should be fixed as of 2.13.11.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Second page of shortcut folder causing an error’ is closed to new replies.