Installation & support
Install Drupad module on your site
You need to install the Drupad companion module:
- Download the Drupad module for your site version from Drupal.org,
- Extract the downloaded module archive,
- Upload the extracted
drupaddirectory to yoursites/*/modulesdirectory, - Log into your Drupal site, visit the
Administer > Build > Modulespage and activate Drupad module, - Set the permission
use Drupad applicationto whatever roles you wish, - You’re done!
Optional Go to Administer > Site configuration > Drupad to configure options, like filtering content types.
Additional modules
Drupad integrates with the following modules, so you may want to install them:
You need to install the Drupad companion module:
- Download the Drupad module for your site version from Drupal.org,
- Extract the downloaded module archive,
- Upload the extracted
drupaddirectory to yoursites/*/modulesdirectory, - Log into your Drupal site, visit the
Modulespage and activate Drupad module, - Set the permission
use Drupad applicationto whatever roles you wish, - You’re done!
Optional Go to Administration > Configuration > System > Drupad to configure options, like filtering content types.
Additional modules
Drupad integrates with the following modules, so you may want to install them:
Support
If you have questions, we are reachable on:
- Twitter for general questions,
- Drupal.org for bug reporting and support request.
Troubleshooting
Some people have reported problems to log in to their site with Drupad. It turns out that most of them are running Drupal with a PHP - CGI environnement. There are some workarounds to make it work, even though this is an effort that needs to continue.
The following may help.
Drupal 6 instructions
Edit .htaccess
Add one of the following code snippet in your Drupal root .htaccess file:
- after this line
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA], - and before the closing tag
</IfModule>at the end of the file.
CODE SNIPPET #1
# -- CODE SNIPPET #1 --
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# -- CODE SNIPPET #1 --
CODE SNIPPET #2
# -- CODE SNIPPET #2 --
RewriteCond %{HTTP:Authorization} !^$
RewriteRule ^(.*)$ index.php?q=$1&login=%{HTTP:Authorization} [L,QSA]
# -- CODE SNIPPET #2 --
Quit Drupad application
When I say quit, I mean kill it.
- Leave Drupad,
- double tap the Home button,
- tap and hold the Drupad icon,
- tap the red minus sort of badge on the Drupad icon.
Truncate sessions table
This step is optional, but is safer.
Truncate the sessions table or empty whatever sessions mecanism you use.
If you don’t know what I’m talking about, don’t worry this shouldn’t affect you if you never succeed to log in with the app.
Try again to login from the app
That’s it.
If this doesn’t work, try again but this time using CODE SNIPPET #2.
Drupal 7 instructions
Edit .htaccess
Add one of the following code snippet in your Drupal root .htaccess file just before the block:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
CODE SNIPPET #1
# -- CODE SNIPPET #1 --
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# -- CODE SNIPPET #1 --
CODE SNIPPET #2
# -- CODE SNIPPET #2 --
RewriteCond %{HTTP:Authorization} !^$
RewriteRule ^(.*)$ index.php?q=$1&login=%{HTTP:Authorization} [L,QSA]
# -- CODE SNIPPET #2 --
Quit Drupad application
When I say quit, I mean kill it.
- Leave Drupad,
- double tap the Home button,
- tap and hold the Drupad icon,
- tap the red minus sort of badge on the Drupad icon.
Truncate sessions table
This step is optional, but is safer.
Truncate the sessions table or empty whatever sessions mecanism you use.
If you don’t know what I’m talking about, don’t worry this shouldn’t affect you if you never succeed to log in with the app.
Try again to login from the app
That’s it.
If this doesn’t work, try again but this time using CODE SNIPPET #2.
Warning Please note, that this code snippet is less secure, because your credentials, which are sent in the request headers from the application, will be redirected and rewritten as a HTTP GET parameter. Even though they aren’t sent in clear (base 64 encoded, which is weak), they can be logged by your webserver or whatever your server does, but you know more on that than me.
If you don’t want to use this last method. Then we (you and me and the Drupal community) need to find a better solution:
- use Apache mod_php rahter than CGI
- find and develop a whole new authentication mecanism
Failed to parse the response
Drupad use JSON as a format between your Drupal site and the iOS app.
If you get a message like The request did not success, unable to parse the response you may want to try the following to ensure that your Drupal installation works properly.
Drupal 6 instructions
Edit drupad.module
Comment line 61.
if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Drupad')) {
// return FALSE; // <-- Comment this line
}
On line 111 comment && strstr($_SERVER['HTTP_USER_AGENT'], 'Drupad'):
if (arg(0) == 'drupad' /*&& strstr($_SERVER['HTTP_USER_AGENT'], 'Drupad')*/) {
Test from your browser
Now try to access this URL from your browser to inspect for any PHP warning or error message:
URL: http://domain.tld/?q=drupad/check-config/version
- version: the Drupad API version
DRUPAD_CURRENT_VERSIONdefined on line 8 of drupad.module (ex: 1.4)
Example with http://domain.tld/?q=drupad/check-config/1.4
{"meta":{"version":"1.4","drupal_version":"6.22","version_match":true},"content":{"callbacks":["comments","content","content-forms","users","updates","status-report","offline","cron-tasks","dblog","cache"],"modules":["comment","node","content","user","update","system","dblog"],"permissions":["access comments","administer comments","post comments","post comments without approval","access content","administer nodes","create \/ edit content with Drupad","administer users","administer site configuration","access site reports"]}}
If you see PHP warning or error, try to fix them or ask for help on Drupal.org as they break JSON fromatting.
Drupal 7 instructions
Edit drupad.module
Comment line 78
if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Drupad')) {
// return FALSE; // <-- comment this line
}
Test from your browser
Now try to access this URL from your browser to inspect for any PHP warning or error message:
URL: http://mydomain.tld/?q=drupad/check-config/version
- version: the Drupad API version
DRUPAD_CURRENT_VERSIONdefined on line 11 of drupad.module (ex: 1.4)
Example with http://domain.tld/?q=drupad/check-config/1.4
{"meta":{"version":"1.4","drupal_version":"7.10","version_match":true},"content":{"callbacks":["comments","content","content-forms","users","updates","status-report","offline","cron-tasks","dblog","cache"],"modules":["comment","node","field","user","update","system","dblog"],"permissions":["access comments","administer comments","post comments","post comments without approval","access content","administer nodes","create \/ edit content with Drupad","administer users","administer site configuration","access site reports"]}}
If you see PHP warning or error, try to fix them or ask for help on Drupal.org as they break JSON fromatting.
Warning We will improve this debugging part so that you no longer need to get your hands into the code.
Password protected site
If your website is protected by an .htaccess & .htpasswd, Drupad can’t log in.
Will there is not much we can do about it. One workaround is to add to your .htpasswd credentials list, login and hashed password from the Drupal user which will connect from Drupad.
