Drupal

Creating a "Related Content" Block Using Views in Drupal 8/9/10/11, based on a common content reference

This guide will walk you through creating a "Related Content" block on the node view page of a content type in Drupal. The block will list other nodes of the same content type that share a common reference.

Definition:

To create a "Related Content" block using Views in Drupal 8/9/10/11, to be shown on the node view page of one item (node/entity) of content type A,
that lists other items (nodes/entities) of the same content type A which all share the same content reference to some other particular node/entity, as that on the initial item under consideration.

Installing and configuring a fresh Ubuntu 14.04 server to host multiple Drupal websites

Here is the procedure that I normally follow for installing and configuring a fresh Ubuntu 14.04 server to host multiple Drupal websites:

Login as root, and run the following commands:

apt-get update
apt-get upgrade
apt-get autoremove
shutdown -r now

Add a new user to host the Drupal websites:

adduser USERNAME

Grant sudo permissions.:

sudo usermod -a -G sudo USERNAME

Then login as that user, and run the rest of the steps listed below.

Install latest git from official PPA:

[SOLVED][PHP PEAR] How to fix the error 'could not extract the package.xml file' and 'Download of "pecl/uploadprogress" succeeded, but it is not a valid package archive', when trying to install PECL uploadprogress using PHP PEAR on Ubuntu 14.04 Trusty

Setting up, upgrading and maintaining a clean and functional Drupal/PHP Development environment is an art, and quite a piece of cake for the skilled sysadmin. But the ever changing versions of OS packages and dependencies can bring up quite some unexpected challenges to a budding developer. Here is the solution to one such error that might eat your brains out.

Almost all usable versions of Drupal - 6, 7 and 8 - use PECL uploadprogress to show file upload progress.
And installing it on previous Ubuntu, PHP versions was as easy as running the following command:

[SOLVED][HOWTO] How to install Drush via PHP PEAR on your cPanel/WHM shared hosting server account

With SSH enabled, Drush is one of the best command-line tools that a Drupal developer/admin can have.

If you havent heard of Drush, checkout these pages to know more about it, and about how it can help make your life much saner:
https://github.com/drush-ops/drush#description
http://drush.ws/about

Here is how you can install Drush on your cPanel/WHM shared hosting account:

How to download the development snapshot / dev version of a Drupal module/theme/core for a specific date

There are often times when you need to download the development snapshot / dev version of a Drupal module/theme/core for a specific date. One common case is when you want to compare the existing version of the module code on your site with the drupal.org version of the same to check for code hacks, as you prepare to update / upgrade the Drupal module.

Here is a method to get that particular date's development snapshot:

[PATCH] How to set workflow comment during automated stated transition with Workflow Rules Set State Action on a Drupal 7 site

The Workflow module in Drupal, as part of its Rules module integration, allows you various rules based actions, of which one commonly used one is the action to change the workflow state from state to another. But that one doesn't have an option to set the comment for that state change, which can be quite useful when you see the Workflow History of a node.

I have created a patch for the latest dev version (7.x-1.0+20-dev) of the Workflow module to help you with that:

[SOLVED] Drupal - How to fix PHP Fatal error: Call to undefined function curl_init() on Ubuntu linux

One of the Drupal sites that we got to work with had this issue. The original server that the site was hosted on did not have any issue. But the issue showed up when it was transferred over to a new server.

This usually happens when you are missing the php5-curl library.

On Ubuntu, just run the following commands in your terminal to fix this:

sudo apt-get install php5-curl
sudo /etc/init.d/apache2 restart

If not on Ubuntu, check for the correct alternative to 'apt-get' for your distribution.

[SOLVED] Error when installing modules in Drupal 7 from admin/modules/install - Exception: Invalid checksum for file...calculated, 0 expected in Archive_Tar...line 635 of modules/system/system.tar.inc

Drupal 7 provides a feature that allows you to install a new module via the Drupal interface itself, without entering your hosting server's cPanel/alternative File Manager to upload files.

That works like a charm for most hosting servers and makes installing modules/themes a breeze on Drupal.

For some others, trying to install modules that way (from admin/modules/install) might just bring up something that looks like the following:
Exception: Invalid checksum for file ... calculated, 0 expected in Archive_Tar->_error() (line 635 of .../my-site.com/modules/system/system.tar.inc).

Here's how to fix this:

Subscribe to RSS - Drupal
randomness