Instead of duplicating (incomplete) views, just add an "Issue tags" filter to advanced search

dww - March 2, 2009 - 23:52
Project:Comment alter taxonomy
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:dww
Status:closed
Issue tags:drupal.org upgrade
Description

Instead of having separate views, which aren't as feature-rich (e.g. #376658: Project search box not auto-complete when browsing by tag, etc), why not just add an "Issue tags" filter to the regular advanced search views:

http://d6.drupal.org/project/issues/search
http://d6.drupal.org/project/issues/search/drupal

E.g.

http://d6.drupal.org/project/issues-term/346

becomes:

http://d6.drupal.org/project/issues/search?tag=drupal.org+upgrade

As with the "Search for" filter, we could do this conditionally if comment_alter_taxonomy is enabled (although I don't know how to programatically set the vid correctly in the default view -- might be easy, just haven't thought about that).

Thoughts?

(Marking this as a d.o upgrade issue since it's something we can now easily fix on d.o after the D6 ugprade since it's all views).

#1

aclight - March 3, 2009 - 00:40

I think that's a great idea. Unfortunately I won't have time to review or commit but feel free to do so yourself.

One potential problem: what if there were multiple vocabularies that were alterable on issues via CAT. How would the default view that comes with PI handle this? I guess it would just add them all to the view, right (though the issue of figuring out which vid to use could be problematic, as you point out).

#2

dww - March 5, 2009 - 03:44
Status:active» needs review

Yes, we just add them all as separate filters. And it's easy to do so -- we just add a filter for every vocabulary that's applied to issue nodes. I think that's a sane default. Any site that's defining additional vocabs on issue nodes and they don't want exposed filters for them can remove the filters from their views.

Two patches:

- Add a private helper function to project_issue.views_default.inc to programatically add these exposed filters to the two advanced search views.

- Change comment_alter_taxonomy to fix the links when you click on one of those term links, it constructs the appropriate per-project advanced search URL to filter by the term, and remove *all* of the views integration. ;)

Any objections?

AttachmentSize
389096-2.comment_alter_taxonomy.patch 29.58 KB
389096-2.project_issue_default_views.patch 2.23 KB

#3

dww - March 8, 2009 - 01:44
Status:needs review» needs work

At dinner (with webchick and others), there was wide-spread desire for a linkrot-preventing menu item that redirects you to the right place. Guess I'll have to work on that...

#4

starbow - March 14, 2009 - 18:52

This sounds like a great addition.

#5

dww - March 23, 2009 - 22:14
Status:needs work» needs review

This adds the legacy redirect code to comment_alter_taxonomy. Tested pretty heavily locally. Deployed on d6.d.o for more testing. Behold:

Valid options:
http://d6.drupal.org/project/issues-term/346
http://d6.drupal.org/project/issues-term/drupal.org+upgrade
http://d6.drupal.org/project/issues-term/488
http://d6.drupal.org/project/issues/3060/term/346
http://d6.drupal.org/project/issues/drupal/term/346
http://d6.drupal.org/project/issues/drupal/term/drupal.org+upgrade
http://d6.drupal.org/project/issues/drupal/term/488
http://d6.drupal.org/project/issues/drupal/term/needs+documentation
http://d6.drupal.org/project/issues/drupal/term/needs%20documentation
...

Invalid terms:
http://d6.drupal.org/project/issues-term/100
http://d6.drupal.org/project/issues-term/zzz
http://d6.drupal.org/project/issues/3060/term/zzz
http://d6.drupal.org/project/issues/drupal/term/100
http://d6.drupal.org/project/issues/drupal/term/zzz

Invalid projects:
http://d6.drupal.org/project/issues/11/term/346
http://d6.drupal.org/project/issues/11/term/zzzz
http://d6.drupal.org/project/issues/droopal/term/zzzz
...

(Note, the last few of these display an unrelated bug: #396114: accessing /project/user gives page not found but shows project table (just no issues) which is really #406578: Replace hook_help() hacks with a cleaner solution for the dynamic headers on issue views)

Any complaints?

AttachmentSize
389096-5.comment_alter_taxonomy.patch 33.76 KB
389096-5.project_issue_default_views.patch 2.87 KB

#6

dww - March 23, 2009 - 22:18
Title:Instead of duplicating (incomplete) views, just add an "Issue tags" filter to advanced search?» Instead of duplicating (incomplete) views, just add an "Issue tags" filter to advanced search

#7

hunmonk - March 23, 2009 - 22:55
Status:needs review» reviewed & tested by the community

found a few very minor code clarity issues which have been corrected. tested at d6.d.o, and all seems to work perfectly.

#8

aclight - March 23, 2009 - 23:17

I'm still out of commission for the next few months. I just gave hunmonk and dww commit access. Unless Damien wants to review feel free to commit what you need to this module. I don't want to hold you up.

#9

dww - March 24, 2009 - 00:20
Status:reviewed & tested by the community» needs work
Issue tags:+needs drupal.org deployment

Cool, thanks aclight. Just committed to HEAD in both modules. I'll mark this fixed once it's deployed for real.

#10

dww - March 24, 2009 - 01:02

#11

System Message - April 7, 2009 - 01:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.