I'm following this tutorial: http://www.sitepoint.com/creating-a-textblock-module-in-drupal/

Near the beginning it states:

"Now let’s create two files textblock.info with the following content... This creates a module called textblock, and then creates an empty file called textblock.module."

I'm not sure if I've encountered an error or if I'm misunderstanding it. If I created the textblock.info, should it automatically generate/create the empty module? Is there any additional step I need to take for the process to work? I ask because no "textblock.module" was created. I had to create manually, which is fine. I just want to verify how this process is supposed to work however.

Comments

WorldFallz’s picture

Can't speak to the tutorial, but creating a .info files doesn't automatically create anything.... you need to crate the module file yourself.

jaypan’s picture

The text in that tutorial is messed up. Quote:

Now let’s create two files textblock.info with the following content:

;$Id$
name = textblock
description = A module to display a block of text
core = 7.x
files[] = textblock.module

This creates a module called textblock, and then creates an empty file called textblock.module. This will be the file where we will put the code to hook into the different hooks provided by Drupal which we will need to write for our textblock module.

There are all sorts of problems with the above quote:

1) "Now let’s create two files textblock.info with the following content:"
If you were to follow the directions, you would make two files with the same name and the same content - which won't work. The text *should* read:

"Now let’s create a file named textblock.info with the following content:"

2) files[] = textblock.module
This is outdated. You do not need to add files using the files[] = FILENAME.ext anymore. This was in pre-release versions of Drupal 7, and I don't believe it ever made it into the final release. You can skip this line of code altogether.

3) "This creates a module called textblock, and then creates an empty file called textblock.module."
While it does create a module called textblock, it does not create the empty file, you need to do that on your own. Which answers your initial question, though WorldFallz had already answered it.

In that one block of text, there were three glaring issues. As such, I'd suggest dropping that tutorial altogether and trying to find another one, there may be many more issues as you go further into the tutorial.

Contact me to contract me for D7 -> D10/11 migrations.

iainp999’s picture

Hi,

As Jaypan pointed out, that's not a particularly great tutorial. When I first got started with Drupal module development, I found the book "Pro Drupal Development" to be really useful.