Drupal

Drupal Role Specific Development Feedback

On rare occasions you may have to work on a production site and need some development feedback. If you want to control which role sees your output, this snippet can help. With this logic in place, only appropriate roles will see your working on the site.

Drupal Display PHP Errors on One Domain of Multi Site

When using a multi-site setup, You may want errors only to appear for one site. In that case, use $_SERVER[‘HTTP_HOST’] in an if statement to only display PHP error messages for the domain of your choice:

How to Understand PHP Stream Wrapper Context and Options

Some have a difficult time understanding what is meant in PHP by stream wrappers, context options and parameters. Judging by a few conversations with other developers, its obvious there is a bit of confusion about what a stream wrapper is and why it would have a context. While the PHP documentation does adequately describe what… Read more How to Understand PHP Stream Wrapper Context and Options

drush cc Not Showing All Options (only showing 2 options cancel and drush)

Trying to clear your Drupal site chache with drusch cc or drush cc all? Drush should out put a list in response that looks like this:

But instead, you may see something that looks like this:

Chances are you are not in the document root of the Drupal site on which you are… Read more drush cc Not Showing All Options (only showing 2 options cancel and drush)

Drupal: How to solve Warning: file_put_contents The file could not be created

Sometimes when migrating or setting up a local development site you may run into an error that looks like this:

Likely the Drupal temp directory isn’t writable. An easy fix for this is to navigate to /admin/config/media/file-system and enter the correct temporary directory or if you’re not sure what it should be, then delete… Read more Drupal: How to solve Warning: file_put_contents The file could not be created

Drupal 7: How To Create a Views View from Within a Module (default view)

The whole idea in making a module is to make it, well ‘modular’, right? The person who is going to install the module should not have to create and configure a view. Chances are they would not get it just right anyway (you know, with all the exact settings the module depends upon). This is… Read more Drupal 7: How To Create a Views View from Within a Module (default view)