Needs work
Project:
Droogle
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2016 at 12:22 UTC
Updated:
8 Mar 2017 at 08:14 UTC
Jump to comment: Most recent
At the view below I get this error popup when there is a preview.
maxResults is not defined
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/structure/views/view/droogle_browser/preview/panel_pane_1/ajax
StatusText: Service unavailable (with message)
ResponseText: Google_Exception: (list) unknown parameter: maxResults; in Google_Service_Resource->call() (line 151 of /libraries/google-api-php-client-git-version/src/Google/Service/Resource.php).
Comments
Comment #2
hesnvabr commentedI am also facing a same error on our localhost in drupal 8.
Comment #3
quickdraw6907 commentedI too am getting this from an fresh Pantheon (free dev) site. and the new Google API (google-drive-v3-rev1-php-1.1.4)
Side note: There is ZERO docs for this project. I had to hunt around in the complete dark finding a way to get the google drive API installed with composer. Here was the command that got me going:
composer require google/apiclient:^2.0
Full trace:
Google_Exception: (list) unknown parameter: 'maxResults' in Google_Service_Resource->call() (line 147 of vendor/google/apiclient/src/Google/Service/Resource.php).
Google_Service_Drive_Resource_Files->listFiles(Array) (Line: 49)
template_preprocess_droogle_list_files(Array, 'droogle_list_files', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('droogle_list_files', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Here is the culprit:
(from droogle.module)
function template_preprocess_droogle_list_files(&$variables) {
$service = $variables['service'];
$dir_id = droogle_get_dir_id();
$params = array(
'q' => "'" . $dir_id . "' in parents and trashed = false",
'maxResults' => 1000,
'orderBy' => 'folder',
);
Changing maxResults in the above block to the allowed pageSize param eliminates the error. But then a blank screen!
Comment #4
jaypanMy answer may not be applicable for D7, as I figured it out on D8, but the problem for me was that composer installed version 2.1.2, but this module was set up to use version 1.1.5. I need to install the library with composer using
composer require google/apiclient:1.1.5.To figure out what version you need to install, look at composer.json in the module root, and find the requirements section, and you should see the version there.