Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Services-Client saves data in the $_SESSION Object, which is not the problem. But the problem here is, that one data object use a constant. Which is not available in drupal_session_start().
Complete message:
Notice: Use of undefined constant OAUTH_COMMON_TOKEN_TYPE_REQUEST - assumed 'OAUTH_COMMON_TOKEN_TYPE_REQUEST' in drupal_session_start() (line 287 of /var/www/mysite/includes/session.inc).
Related links:
- http://drupalcode.org/project/services_client.git/blob/refs/heads/7.x-1....
- http://drupalcode.org/project/services_client.git/blob/refs/heads/7.x-1....
- http://drupalcode.org/project/oauth.git/blob/refs/heads/7.x-3.x:/include...
- #1757380: Undefined Constant Error
- #1515450: Use of undefined constant OAUTH_COMMON_TOKEN_TYPE_REQUEST in cache.inc
One solution is to store the data via cache_set/get.
Comment | File | Size | Author |
---|---|---|---|
#4 | services_client.1976516.4.patch | 1.98 KB | tobiasb |
#1 | services_client.1976516.patch | 3.44 KB | tobiasb |
Comments
Comment #1
tobiasbOk here is the patch with the cache solution.
Comment #2
mhrabovcin CreditAttribution: mhrabovcin commentedWhat if multiple users will try to authenticate against one site?
I don't think this will work, because of possibility of multiple users authenticating different endpoints. What I think would work is to store token ids rather than whole token objects in $_SESSION array.
Comment #3
mhrabovcin CreditAttribution: mhrabovcin commentedComment #4
tobiasbOk thats true.
Comment #5
mhrabovcin CreditAttribution: mhrabovcin commentedCommitted, thanks!
Comment #6.0
(not verified) CreditAttribution: commentedadded a solution