Related Issues
This is a child task of #1549808: Port the lame D6 node/add/project-issue UI to D7
This issue is postponed pending the outcome of #1571398: Port 'Project selection widget' setting (project_issue_autocomplete)
Overview
On a very large site like drupal.org, the project-dropdown selector at http://drupal.org/node/add/project-issue is utterly unwieldy and useless due to the 15,000+ options. This page needs serious love. Luckily, it's a standalone form, not a crazy multi-step node form.
Furthermore, thanks to the API limitations of D7, it's impossible to replicate the existing (terrible) drop-down with 15K choices without *also* fully loading 15K entities on the server. So this UI dropdown is most likely going to crash the d.o servers.
Here are some possible alternatives:
A) Just use auto-complete. I'm not sure I buy the premise that you don't already know the project you care about. If you're reporting a bug or requesting a feature, you're dealing with a module you installed on a site somewhere and you should be able to know. If you're dealing with d.o itself, you're kind of screwed anyway, and you really need something like #192714: Add a "Report a problem" link in d.o navigation block (in order to help avoid duplicate issues).
B) Do some kind of drill-down based on project types, categories, etc. So, e.g. on d.o, you'd start with: a select for (Drupal core|Module|Theme|Distribution|...). Then, if you picked "Module", you'd get another select for all the module categories. And then if you pick a category, you get a select with just the modules for that category. Or something.
C) Hide the page entirely. 404 FTW. ;)
D) Replace it with a page that says, in effect: "To submit an issue, you have to start from the project you care about. Go find that. Good luck."
E) Replace it with some kind of solr-backed search page to find the project you care about and the search results include prominent "submit an issue for this project" link/button.
F) Replace it with a form that pretends it's an issue form, that really searches for duplicates first, and if it doesn't find an issue, tries to suggest the project you're aiming for (somehow). ;)
#19386: Automatically search for duplicate issues/questions before submitting new issue/question
#1128044: Consider deploying uniqueness.module on drupal.org (to help prevent duplicate issues before they're submitted)
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 1044950-honor-project-selection-widget-config_2.patch | 3.27 KB | bdragon |
| #9 | 1044950-honor-project-selection-widget-config.patch | 2.5 KB | bdragon |
Comments
Comment #1
dwwThanks to D7 giving us no way to get the titles of 10K project nodes without actually
entity_load()ing all of them, I predict that https://drupal.org/node/add/project-issue will crash our web nodes once we upgrade to D7. Therefore, fixing this isn't just an optional nice-to-have, but frankly, is a critical blocker for the d.o upgrade.Comment #2
mustanggb commentedAre there any ideas on what to "replace" it with (other than the obvious autocomplete)?
Comment #3
dwwI just updated the summary with some alternative ideas. I still lean towards autocomplete.
Comment #4
webchickGiven #1, probably autocomplete is the way to go here.
Comment #4.0
webchickadded some possible alternatives and more motivation based on the D7 porting problem
Comment #4.1
senpai commentedRemoving "This came up over at #1026502: Hide sandbox projects at node/add/project-issue but really fixing this page is out of scope for the Git migration itself. Just opening this as a stake in the ground for a future effort to make this page not suck." because it now seems redundant since that other issue is fixed and committed.
Comment #5
senpai commentedComment #6
mitchell commented>Thanks to D7 giving us no way to get the titles of 10K project nodes without actually entity_load()ing all of them, I predict that https://drupal.org/node/add/project-issue will crash our web nodes once we upgrade to D7.
What about using the advanced node/entity-reference setting, use alternative list of available nodes, with a view of project titles and Materialized Views or some other views cache backend?
A few more results than 10 would be cool too.
Comment #7
dwwIf we're going autocomplete, the first order of business is #1571398: Port 'Project selection widget' setting (project_issue_autocomplete).
Comment #7.0
dwwAdding "This is a child task of #1549808: Port the lame D6 node/add/project-issue UI to D7"
Comment #7.1
senpai commentedAdding a postponed-by link.
Comment #8
senpai commented#1571398: Port 'Project selection widget' setting (project_issue_autocomplete) is fixed, so I'm reopening this one.
Comment #9
bdragon commentedEasy peasy lemon squeezy.
Comment #10
rgristroph commentedThe code looks good.
A couple of comments:
1) Shouldn't we add a setting for this to includes/admin.settings.inc or on the node type settings of the project_issue node types ?
2) I did "drush vset project_selection_widget autocomplete" to make this code actually trigger. Which should be the default, autocomplete or select ?
3) It didn't actually work. The autocomplete form does appear and the right choices do appear if I type a few characters, however when I submit it, I get an "Invalid project selected" error. It wasn't immediately obvious what the issue was. I re-installed on a clean db, starting with the projectinstall profile, and re-applied the patch, still nothing.
I did an "inspect element" in firefox on the autocomplete text field, and here's what I got:
<input aria-autocomplete="list" autocomplete="OFF" id="edit-project" name="project" value="Acquire Currency" size="30" maxlength="128" class="form-text required error form-autocomplete" type="text">I used the Chrome network inspector thingy-do and got this when I typed the first letter "A" in the field:
{Increasing my net worth:Increasing my net worth, Acquire Currency: Acquire Currency}Those are the two titles of two of the projects I defined in my test setup. Should the JSON from the autocomplete be mapping the titles to node numbers or something, instead of title to titles ?
Comment #11
bdragon commented1) A recent enough project.module already has the variable.
2) The default is select, as per what project.module
3) That was me being silly and using an autocomplete that returned titles but the validation only checked machine names. Here's a version that checks titles too.
Comment #12
bdragon commentedComment #13
senpai commentedAssigning to @Bdragon.
Comment #14
mikey_p commentedI tried testing this, but found another major bug, in that 7.x-2.x doesn't prevent duplicate titles as the 6.x version of project does: http://drupalcode.org/project/project.git/blob/refs/heads/6.x-1.x:/proje...
Comment #15
senpai commentedNeeds review again on patch #11 above, now that project duplicate titles have been fixed. Assigning to @mikey_p
Comment #16
dwwThere were a few incredibly minor cosmetic problems with the code and comments, which I corrected. Tested locally and it works great. The only issue I saw was #1733820: Make the 'project' entity reference field on issue nodes honor the 'project_selection_widget' setting but that's probably "won't fix" so I split that out separately and am calling this fixed.
Cheers,
-Derek
Comment #18
dwwp.s. I just added drupalorg_project_update_7006() to force this to be configured right on upgrade:
http://drupalcode.org/project/drupalorg.git/commit/3e55eff
Comment #18.0
dwwChanging "Related Tasks" to "Related Issues".