Hi Drupal Enthusiasts,
I'm really trying to get into Drupal 7, but I'm having issues with the most basic things.
I want to develop a simple hello world Module to get started in drupal 7 module development.
I current have a .module file and a .info file which are located inside /sites/all/modules/mymodule/
mymodule.info
name = "My module"
description = This is my module. Work please.
core = 7.xNothing I do with either the .info file or the .module will let me view the module with the drupal module menu. (Clicking modules from the administration menu).
If I zip up the module into a .zip file and manually try to install it with the "Install new module" link it gives me this error.mymodule.zip contains a version of Unknown that is not compatible with Drupal 7.x.
I followed the tutorial here and those specific steps yield the same result.
I've been on google and forums for the last 4 hours and havn't found anything, could someone please help?
Thanks in Advance,
arcynum.
Comments
Start here
http://drupal.org/node/361112
Cheers,
Anil Sagar,
Lead Drupal Developer,
SourceN,
http://www.sourcen.com
http://www.anilsagar.com -- Drupal Tutorials, Drupal Tips, Drupal Performance Solutions
Allready done that.
If you read my post, you would see that I link to that node.
I followed that nodes guide, and it doesn't show up in my Module list.
Try this in info file
name = My Custom Module
description = Hello World Drupal 7
version = VERSION
core = 7.x
Cheers,
Anil Sagar,
Lead Drupal Developer,
SourceN,
http://www.sourcen.com
http://www.anilsagar.com -- Drupal Tutorials, Drupal Tips, Drupal Performance Solutions
Still no action.
Let me precurse this with a thanks, I do appreciate you helping me out.
I changed the file as per your response.
Still nothing.
I changed the file encoding to UTF-8 from ANSI just in case.
Nothing.
I've cleared the cache and ran the update.php script just in case.
Nothing.
I even downloaded a brand new empty version of drupal 7.8 in case I broke my own version.
Still Nothing.
Here's a sample from my own
Here's a sample from my own personal module. It works for me, D7.8:
mymodule.info:
name = My moduledescription = Description of my module.
core = 7.x
package = My Site Name
version = 7.x-1.0
files[] = mymodule.info
files[] = mymodule.module
mymodule.module
<?php
/**
* @file
* Custom functions for My Site.
*
*/
function mymodule_hello_world() {
}
-- David
davidnewkerk.com | absolutecross.com
View my Drupal lessons & guides
Check the module name, directory, file name
Hi,
You have to make a folder called modules in sites/all directory of your drupal installation.
Inside your modules directory create a folder called "custom_hello"
Inside your "custom_hello" folder create two files called "custom_hello.info" and "custom_hello.module"
Make sure your module files has correct extensions. Not something as custom_hello.info.txt. This is wrong.
If you follow above steps it should work.
Cheers,
Anil Sagar,
Lead Drupal Developer,
SourceN,
http://www.sourcen.com
http://www.anilsagar.com -- Drupal Tutorials, Drupal Tips, Drupal Performance Solutions
Check permissions
Check the module folder and files permissions, its possible that your web server can't read the files.
Solved
Ok. I solved this issue after much hair pulling.
I knew it would be something simple.
I was developing in Notepad++ on Windows 7.
Notepad++ line endings were set to Macintosh format (Who knows why).
You can convert a file to the Unix format (Which is needed) in notepad++ by selecting
Edit -> EOL Conversion -> UnixJust to be clear, none of the code or syntax was the issue here. Be sure you have your line endings set to Unix.