Skip to content

When things go wrong

jeff-h edited this page Feb 16, 2016 · 4 revisions

There are a number of common (and some not-so-common) issues that can trap even seasoned developers. If you're tearing your hair out, have a glance through the following potential issues. We've attempted to order them with the most likely problems first.

--

Did you empty caches and rebuild the registry?

Your new custom classes and RESTful plugins must be discovered by Drupal, and any resource endpoints they define must be stored in the menu cache.

$ drush rr
$ drush cc all

--

Have you patched the Entity API module?

RESTful requires that entity.module be patched with https://drupal.org/node/2086225#comment-8768373.

--

Works on local but not on production?

Do things work locally but do not when pushed to a production server? If your local filesystem is not case-sensitive (e.g. OS X with the default HFS+ filesystem), you might have capitalised one of the plugin folders incorrectly. e.g. spelling "Resources" as "resources". This will still work locally, but break on a filesystem which does not ignore capitalisation.

--

Did you increment your new resource's version number?

If you're extending a resource that RESTful provides out-of-the-box (e.g. users) but you haven't incremented your version number, RESTful may not use your resource, instead using the default one. e.g. if you're extending RESTful's users v1.0, be sure to call yours users v1.1 or higher.

--

Getting unexpected 401's when authenticating with tokens from a different domain (using CORS)?

If you are attempting to authenticate using the token auth resource in conjunction with CORS (i.e. from another domain) there is a known issue you should be aware of. See A warning regarding CORS and authenticated resources for more.

Clone this wiki locally