On 4/25/07, <b class="gmail_sendername">Ashraf Amayreh</b> <<a href="mailto:mistknight@gmail.com">mistknight@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello all,<br><br>I ran into a very awkward bug today. I created a module and a theme for a client, and naturally, this module contained customizations and the theme was a custom made theme. I named the module and the theme with the client's name. Let's say the client was named abc so I created an abc module and an abc theme.
</blockquote><div><br>I have done the same in the past. A module called x.module, and a theme<br>called x with a file page.tpl.php. Did not have problems.<br></div><br>I did not use hook_block in that module though.<br><br>
So, to verify that you are facing an issue, I created the following:<br><br><a href="http://garland.info">garland.info</a><br>name = Garland module<br>description = Test gardland module<br>version = "$Name: $"<br>
garland.module<br>
<br><?php<br>function garland_block($op, $delta = 0) {<br>}<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">When I implemented the abc_block hook I was surprised to find that all blocks disappeared on all pages.
</blockquote><div><br>The blocks disappeared like you found out, when I enabled the above module.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Further investigation into the core and I found that the culprit was the call to theme('block') which mistakingly called abc_block thinking it was a theme override function (rather than the hook it was).
<br><br>I was wondering if this issue has been addressed before. I can think of three possible solutions:<br>1. Make it a standard that no theme and module should be named the same (weak solution)<br>2. Change all theme('block') calls to something else so no chance of conflict could occur
<br>3. Change the hook name so that it won't conflict with the theme call<br>4. Any suggestions???<br><br>Either 2 or 3 seem good enough to solve the problem. But I thought I'd gouge some opinions before wasting time on a less-than-optimal patch.
</blockquote><div><br>I think 1 can be easiest path. Forbid enabling a module with the same name<br>as an enabled theme and vice versa. So whoever is enabled first wins.<br><br>I am not sure what the impact on modules would be if 2 or 3 is done.
<br></div>-- <br></div><a href="http://2bits.com">2bits.com</a><br><a href="http://2bits.com">http://2bits.com</a><br>Drupal development, customization and consulting.