kochm / wp-mendeley-plugin

WordPress plugin for showing data from Mendeley
7 stars 4 forks source link

Unable to load authorized folders in shared group in backend #1

Closed maedoc closed 3 years ago

maedoc commented 8 years ago

I'm using version 1.1.7, database version 2. I clicked Request Collection Ids and see the groups that I'm authorized to access, but no folders within the group (there are 4).

Debug output shows

Mendeley Collection IDs

Currently, the plugin asks the user to specify the ids of Mendeley folders or groups to display the documents in the collection. Pressing the button bellow will request and print the list of folders and groups with the corresponding ids from the user account that authorized the access key to look up the ids you need.

Request: https://api.mendeley.com/groups/?limit=500

Response: HTTP/1.1 200 OK Content-Type: application/vnd.mendeley-group.1+json Date: Tue, 26 Jan 2016 14:42:32 GMT Vary: Accept-Encoding Vary: Accept-Encoding X-Mendeley-Trace-Id: fV5RE1IditQ Content-Length: 522 Connection: keep-alive [{"name":"INS publications","description":"","disciplines":["Biological Sciences"],"tags":[],"photo":{"standard":"http://s3.amazonaws.com/mendeley-photos/awaiting.png","square":"http://s3.amazonaws.com/mendeley-photos/disciplines/small/biological-sciences.png"},"webpage":"","id":"11dd9e26-858f-306f-a539-b0a1b2cef6cd","created":"2015-12-02T15:35:38.000Z","owning_profile_id":"c6c6e88a-a1f0-3156-a724-ec16198bd807","link":"http://www.mendeley.com/groups/7954281/ins-publications/","access_level":"public","role":"normal"}]

Groups

INS publications, 11dd9e26-858f-306f-a539-b0a1b2cef6cd
Request: https://api.mendeley.com/folders/?limit=500

Response: HTTP/1.1 200 OK Content-Type: application/vnd.mendeley-folder.1+json Date: Tue, 26 Jan 2016 14:42:33 GMT Vary: Accept-Encoding Vary: Accept-Encoding X-Mendeley-Trace-Id: qRzR3Uc6pe0 Content-Length: 2 Connection: keep-alive []

Folders

But from the debug output, it looks like this is not the plugin fault but Mendeley's API.

Now I see in doc of folder api, if no group id is specified, only user's folders are returned.

Where in the code would this be done? (I'm relatively rusty on PHP).

maedoc commented 8 years ago

We have only one group, so I hardcoded it in the folder list request, changing

$url = "folders/?limit=500"; // 500 is the maximum possible

to

$url = "folders/?group_id=asdf-asdf-asdf-asdf-asdf&limit=500"; // 500 is the maximum possible

(in case this helps any one else)

kochm commented 8 years ago

Up to now we have not made use of the possibility to have folders in groups ... that is why there is no direct support for this in the plugin ...

dinel commented 3 years ago

Closing this ticket.