Hello, I'm tryin' to setup my first module. Created the .info and .module files on sites/all/modules/modulename, and start with a very basic block but when I enable th emodule it breaks my primary links menu (superfish menu).
Here's the simple code on .module , any idea?
Wich is the simplest way to debug this kind of problems?
Thank's for your time an patience.
<?php function modulename_block($op='list',$delta=array(),$edit=array()) { switch ($op) {
case 'list': $blocks[0]['info'] = t('module test'); return $blocks; break; case 'view':
$content = 'hello world'; $blocks['subject'] = t('module test'); $blocks['content'] = "Test"; return $blocks; break; } }
When you say that it breaks your primary links, how do you mean?
On Mon, May 30, 2011 at 6:08 AM, Marolijo marolijo@yahoo.es wrote:
Hello, I'm tryin' to setup my first module. Created the .info and .module files on sites/all/modules/modulename, and start with a very basic block but when I enable th emodule it breaks my primary links menu (superfish menu).
Here's the simple code on .module , any idea?
Wich is the simplest way to debug this kind of problems?
Thank's for your time an patience.
<?php function modulename_block($op='list',$delta=array(),$edit=array()) { switch ($op) {
case 'list': $blocks[0]['info'] = t('module test'); return $blocks; break; case 'view': $content = 'hello world'; $blocks['subject'] = t('module test'); $blocks['content'] = "Test"; return $blocks; break; }}
[ Drupal support list | http://lists.drupal.org/ ]
The primary links on my site dissapear, and the block isn't displayed (I assignad it to a section under blocks section) I google'd without luck.
thank's for your time
2011/5/30 William Smith william.darren@gmail.com:
When you say that it breaks your primary links, how do you mean?
On Mon, May 30, 2011 at 6:08 AM, Marolijo marolijo@yahoo.es wrote:
Hello, I'm tryin' to setup my first module. Created the .info and .module files on sites/all/modules/modulename, and start with a very basic block but when I enable th emodule it breaks my primary links menu (superfish menu).
Here's the simple code on .module , any idea?
Wich is the simplest way to debug this kind of problems?
Thank's for your time an patience.
<?php function modulename_block($op='list',$delta=array(),$edit=array()) { switch ($op) {
case 'list': $blocks[0]['info'] = t('module test'); return $blocks; break; case 'view':
$content = 'hello world'; $blocks['subject'] = t('module test'); $blocks['content'] = "Test"; return $blocks; break; } } -- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Just a wild guess here. Is your module named the same as your theme? If so, change one of them.
Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
From: Marolijo
The primary links on my site dissapear, and the block isn't displayed (I assignad it to a section under blocks section) I google'd without luck.
thank's for your time
Ms. Nancy Wichmann wrote:
Just a wild guess here. Is your module named the same as your theme? If so, change one of them.
Shouldn't we try to fix this in D8 by warning the user of the conflict with a drupal_set_message in the admin/modules page? Or perhaps fix the API so that it knows themes/foo is different from modules/foo.
It is a known issue because I found it by searching on DO. But, yes, it should be fixed.
Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
From: Earnie Boyd
Just a wild guess here. Is your module named the same as your theme? If so, change one of them.
Shouldn't we try to fix this in D8 by warning the user of the conflict with a drupal_set_message in the admin/modules page? Or perhaps fix the API so that it knows themes/foo is different from modules/foo.
2011/5/31 Ms. Nancy Wichmann nan_wich@bellsouth.net
Just a wild guess here. Is your module named the same as your theme? If so, change one of them.
Nancy
Yes! The module name was the same as my Zen based theme! With a simple module name change all is workin'. Is it documented?
Thank's for all your time.
Yes, it is documented. I had the same problem a couple months ago and found it on DO. It sort of makes sense, since having them the same could make for some strange hook naming collisions. But it should be more widely known because it's not unusual to name both custom themes and site-specific modules for the site/customer.
Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
From: Marolijo
Yes! The module name was the same as my Zen based theme! With a simple module name change all is workin'. Is it documented?
Great catch Nancy.
:)
On 01 Jun 2011, at 2:34 PM, Ms. Nancy Wichmann wrote:
Yes, it is documented. I had the same problem a couple months ago and found it on DO.
It sort of makes sense, since having them the same could make for some strange hook naming collisions. But it should be more widely known because it's not unusual to name both custom themes and site- specific modules for the site/customer.
Nancy
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
From: Marolijo
Yes! The module name was the same as my Zen based theme! With a simple module name change all is workin'. Is it documented? -- [ Drupal support list | http://lists.drupal.org/ ]
-- Jeff Brown
Tel:+27-74-101 5170 Fax:+27-86-532 3508 www.wildcoast.co.za
Well, not totally perfect; he could stand to study up on Drupal coding standards. But I didn't see any major flaws and the symptom was almost identical to what I saw, except my banners also suffered.
Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
From: Fred Jones
Great catch Nancy.
Yes, I second that. His code was perfect. A bit of genius to figure out the problem there. :)