The Inputstream module is only useful when multiple modules are all trying to use the same stream at the same time. It's not very likely to happen to most users so I think the Inputstream module should be optional for the REST Server. Implementing a fallback for the cases where it isn't installed is easy - take a look at how I solved it in the OAuth module: https://github.com/voxpelli/drupal-oauth/commit/6ccb0d87fbf704ebfb6e7544...
(The suggest property in the info file is used by Module supports and there is a discussion at #328932: Modules and partial dependencies - enhances[] and enhancedby[] field in modules' .info.yml files about supporting it at Drupal.org and perhaps in future versions of Drupal core)
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | services-1017036.patch | 853 bytes | kylebrowning |
| #4 | 1017036.patch | 1.42 KB | gdd |
| #3 | 1017036.patch | 1.43 KB | gdd |
Comments
Comment #1
gddMaking this a 7.x issue since it affects both.
Wouldn't this then break situations where for instance, you are using both oAuth and REST (since each would want to read the stream and only one could.) I would love to remove the dependency, but I don't want to make things more difficult for people either.
Another option would be to just move the InputStream code into Services but that seems silly kind of.
I like the suggests property but I mean, if it can actively break your site then its not really a 'suggestion' in my book.
Comment #2
voxpelli commentedLooking at it now my workaround in the OAuth module for the lack of the Inputstream module was wrong - I opened a new issue for that: #1017220: Deactivate body_hash-checking when Inpustream isn't installed
The OAuth module only uses the Inputstream module to check the validity of an optional body hash, which isn't part of the core OAuth specification. When #1017220: Deactivate body_hash-checking when Inpustream isn't installed is solved the only downside of not having Inputstream installed when using Services and OAuth together is that any client supporting body hashes won't have them validated. If we only document that fact well in the OAuth module it won't be an issue. (Since the OAuth module is currently lacking documentation completely nobody knows they can include the body_hash now anyway :P)
Comment #3
gddI'm convinced, can someone sanity check this patch?
Comment #4
gddNo this one.
Comment #5
voxpelli commentedLooks good to me - maybe you should add some documentation of Services support for Inputstream in the readme or so?
Comment #6
gddThis has been committed to 7, needs to be rerolled for 6
Comment #7
voxpelli commentedWe've got a cool status for that ;)
Comment #8
kylebrowning commentedCommitted, attached patch