In _services_process_resource() at line 161 of services.resource_build.inc, there is code which makes relationships, actions, and targeted actions inherit properties from previously defined resources if they are not present. Relationships inherit from 'retrieve', while actions and targeted actions inherit from 'update'. I find this really confusing. I'd rather have all the properties be explicitly stated in the resource definition, which is clearer and open to less confusion. I just lost a hour or so chasing down a problem where I had set a relationship's access callback to be nothing (implying it should use user_access()) but instead it kept getting replaced with the retrieve resource's access function. Even if the inheritance thing doesn't get pulled out, that is actively a bug.
Comments?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1060124-remove-inheritance.patch | 1.81 KB | ygerasimov |
| #4 | 1060124.patch | 2.1 KB | gdd |
Comments
Comment #1
Hugo Wetterberg commentedYeah, that feature is pretty logical, but nevertheless dubious in a Drupal context, as it's not a common Drupal pattern. The sensible thing would probably be to pull the inheritance stuff out of the D7 branch and fix the bug in D6.
Comment #2
voxpelli commentedI agree that it might get confusing so I'm in favor of removing it.
Comment #3
ygerasimov commentedI also think that it is confusing and inheritance should be removed.
Comment #4
gddPatch
Comment #5
ygerasimov commentedA bit too much has been removed. We need to remove only inheritance part. Everything else should stay. Please review attached patch.
Comment #6
gddNice catch, this has been committed, marking for backport
Comment #7
kylebrowning commentedThis is already done in 6.x actually. IM not sure if it never made it to the 7.x version, or if someone removed it, but its gone.