version of the OAuth2 Server library could not be detected.

Created on 23 May 2024, 6 months ago

Problem/Motivation

After installing and naming the library in the correct location, library report show the error :
version of the OAuth2 Server library could not be detected.

I am using version 1.8 found here:
https://github.com/bshaffer/oauth2-server-php/archive/refs/tags/v1.8.0.zip

Steps to reproduce

Download and Install the module and dependencies.
Download and install the library to:

sites/all/libraries/oauth2-server-php

Proposed resolution

Locate what is being looked for and where - find what is missing or missed placed.

πŸ› Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States goose2000

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @goose2000
  • Status changed to Closed: won't fix 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States goose2000

    Regardless of how the Libraries report page displays, I found everything to be working, studying the init() function below, when I deleted the library directory, it for sure triggered the warning/error message therein. Put it back and all was fine. Closing.

    /**
     * Implements hook_init().
     *
     * Nags the user about the missing library on OAuth2 admin pages.
     */
    function oauth2_server_init() {
      $item = menu_get_item();
      if (is_array($item)) {
        if ($item['access'] && strpos($item['path'], 'admin/structure/oauth2-servers') === 0) {
          $path = oauth2_server_get_library_path();
          // Check for the existence of one file from the library.
          if (!$path || !file_exists($path . '/src/OAuth2/Server.php')) {
            $message = t('The OAuth2 server library is required for the OAuth2 module to function.
            Download the library from <a href="https://github.com/bshaffer/oauth2-server-php" target="_blank">GitHub</a> and place it in <em>!path</em>.', array('!path' => $path));
            drupal_set_message($message, 'error');
          }
        }
      }
    }
Production build 0.71.5 2024