Per a recent comment on the devel list and a brief chat with killes in IRC, attached find a small drupal.org-specific module for consideration. All it does is add another block that duplicates the search block but is natively restricted to project nodes. The idea is to make finding a project easier, especially a project that already exists before you write a duplicate of it. (Although it of course has other value as well.) I'd think it a "disabled by default and user-enabled" block, like Contributor Links.
There's still an issue where the colon gets auto-escaped in the URL, but it still works properly and shows up correctly in the textfield. It's just in the location bar that it looks off. Suggestions on how to fix that, if we need to, are welcome.
(Rename from .txt to .module to get around file type limitations.)
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 168819_project_search_block_uninstall.patch | 685 bytes | aclight |
| #15 | 168819_project_search_block_help_text.patch | 2.06 KB | dww |
| #8 | 168819_project_search_block_8.patch | 1.85 KB | aclight |
| #1 | drupalorg.info | 80 bytes | Crell |
| drupalorg.txt | 1.02 KB | Crell |
Comments
Comment #1
Crell commentedAnd the info file.
Comment #2
Crell commentedI guess this should be refiled to this module now. :-)
Comment #3
dwwThere's nothing drupal.org-specific about this block (except what paths we want it enabled on, but that's just block configuration either way). I could certainly see other sites wanting this functionality, too. Please re-write this as a patch against project.module, then we'll get it on d.o.
Thanks!
-Derek
Comment #4
Crell commentedAgainst project module? That would introduce a search module dependency, wouldn't it?
I suppose ideally it would be a generic search-block-per-nodetype feature of the search module, but I'm not even going to try doing that to D6 at the moment. :-)
Comment #5
dwwActually, I think project_issue already depends on core search for the advanced search functionality. Although I never studied it closely, I'm pretty sure it's just re-using core's search indexes, etc. So, that should either explicitly list the dependency in the .info file, or move the "advanced search" to be conditionally defined. Here, you should be able to conditionally define this block via
if (module_exists('search')), much like we add functionality if core's taxonomy.module is enabled. Thanks!Comment #6
pasqualleThis is a much needed feature. +10 :)
The patch missing some key features. Should be something like this.
and
or
The module category should be considered also somehow. There are too many modules..
Comment #7
pasquallecheck these:
http://sourceforge.net/search/
http://www.phpbb.com/community/search.php
Comment #8
aclight commentedHere's a patch to project that is almost the same as from the original post but just reworked to be part of the project module.
@Pasqualle: Though I like your idea, I think that's a bit of scope creep for this issue. Also, with the pending port of project* to Drupal 6 (and, more importantly, to use Views 2), I think it's best to hold off on something like what you suggest until that point. It may be that once we get Views integration it'll be trivial to add all kinds of additional search features to such a block or page.
Comment #9
dwwEvil, I can't get my local d.o test install profile to index content for search, even manually calling cron. :( But, otherwise, this looks fine, and appears to be doing what it's supposed to. Committed to HEAD. Thanks, folks, and sorry for the delay.
See also #289929: Provide Module/Theme Search Blocks which greggles just posted which does d.o-specific stuff like restricting to either modules or themes.
Comment #10
dwwGrrr, I have no idea why but this doesn't seem to be working on d.o, even though it worked fine on a test site (other than my test site didn't index any search items). But, at least when you used the block, you got sent to the right place.
Once I put this on d.o, if you put anything in the search box and press submit, you just go to an empty http://drupal.org/search/node page with nothing selected or pre-filled. :( Any ideas?
Comment #11
dww- Maybe some block-level caching or something is breaking this?
- Perhaps someone else on the infra team has an idea, so I'm moving this there...
Comment #12
dwwFYI: I configured the block to appear on http://drupal.org/project/project for testing, if anyone else wants to take a look.
Comment #13
john morahan commentedSomething (what?) is setting the action to search/node and this form doesn't exist there on d.o. It probably does on your test site though?
Comment #14
dwwInteresting. For some reason, on my local test site, the $form doesn't have an '#action', but on d.o, I get this:
A little CVS archeology shows that d.o still hasn't been updated with the backport from #104662: Search blocks breaks if the block is not visible on the search page. (current revision on d.o is 1.209.2.5, latest in DRUPAL-5 is 1.209.2.6).
However, there are some local modifications to search.module for xapian stuff, so I'm hesitant to run the cvs update that will fix my current problem. The cvs update will do this:
@xapian aware people: can I run that update without breaking xapian? Seems like it should be safe, but I wanted to double check to be sure.
Thanks,
-Derek
Comment #15
dwwI found killes in IRC, and he confirmed that the update should be safe, so I ran the update. As expected, everything is working fine now. Rolled it out on d.o at project* and search/node*. I also added a block setting for the help text to use, so we could add a little something site-specific to help people out (see attached patch if you care). Seems like this is now happy, so marking it fixed.
Comment #16
dwwMoving back home for posterity... ;)
Comment #17
aclight commentedThat last patch didn't add the new variable created to the list of variables to be deleted in hook_uninstall(). The attached patch does so.
Comment #18
dwwYup, good catch, thanks. Committed to HEAD and DRUPAL-5.
Comment #19
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.