But enforcing it through code is the way to go. I frankly didn't see it as evident at all. What I saw was that I added hook_block and everything just went haywire without a warning or an error. Really didn't have the slightest idea the theme was involved. After I found that out it was simply intuitive of course.
<br><br><div><span class="gmail_quote">On 4/26/07, <b class="gmail_sendername">Gabor Hojtsy</b> <<a href="mailto:gabor@hojtsy.hu">gabor@hojtsy.hu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ashraf Amayreh wrote:<br>> I ran into a very awkward bug today. I created a module and a theme for<br>> a client, and naturally, this module contained customizations and the<br>> theme was a custom made theme. I named the module and the theme with the
<br>> client's name. Let's say the client was named abc so I created an abc<br>> module and an abc theme. When I implemented the abc_block hook I was<br>> surprised to find that all blocks disappeared on all pages. Further
<br>> investigation into the core and I found that the culprit was the call to<br>> theme('block') which mistakingly called abc_block thinking it was a<br>> 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<br>> three possible solutions:<br>> 1. Make it a standard that no theme and module should be named the same<br>> (weak solution)
<br>> 2. Change all theme('block') calls to something else so no chance of<br>> 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<br>> gouge some opinions before wasting time on a less-than-optimal patch.<br><br>I did face the same module name and theme name problem a few years back
<br>with Drupal (I still prefer PHP based themes with that .theme extension,<br>no PHPTemplate themes), so namespace clashing was evident. The solution<br>is not to have the same named module and theme. :)<br><br>Gabor<br>
</blockquote></div><br>