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)

Comments

dww’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Priority: Major » Critical
Issue tags: +project, +drupal.org D7

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. Therefore, fixing this isn't just an optional nice-to-have, but frankly, is a critical blocker for the d.o upgrade.

mustanggb’s picture

Are there any ideas on what to "replace" it with (other than the obvious autocomplete)?

dww’s picture

I just updated the summary with some alternative ideas. I still lean towards autocomplete.

webchick’s picture

Given #1, probably autocomplete is the way to go here.

webchick’s picture

Issue summary: View changes

added some possible alternatives and more motivation based on the D7 porting problem

senpai’s picture

Issue summary: View changes

Removing "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.

senpai’s picture

Title: Fix the UI at node/add/project-issue » Re-architect the project-dropdown UI selector on node/add/project-issue to prevent server crashes
mitchell’s picture

>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.

dww’s picture

Status: Active » Postponed

If we're going autocomplete, the first order of business is #1571398: Port 'Project selection widget' setting (project_issue_autocomplete).

dww’s picture

Issue summary: View changes
senpai’s picture

Issue summary: View changes

Adding a postponed-by link.

senpai’s picture

Status: Postponed » Active
Issue tags: +sprint 6
bdragon’s picture

Status: Active » Needs review
StatusFileSize
new2.5 KB

Easy peasy lemon squeezy.

rgristroph’s picture

Status: Needs review » Needs work

The 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 ?

bdragon’s picture

1) 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.

bdragon’s picture

Status: Needs work » Needs review
senpai’s picture

Assigned: Unassigned » bdragon

Assigning to @Bdragon.

mikey_p’s picture

I 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...

senpai’s picture

Assigned: bdragon » mikey_p

Needs review again on patch #11 above, now that project duplicate titles have been fixed. Assigning to @mikey_p

dww’s picture

Assigned: mikey_p » bdragon
Status: Needs review » Fixed

There 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

Status: Fixed » Closed (fixed)

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

dww’s picture

p.s. I just added drupalorg_project_update_7006() to force this to be configured right on upgrade:

/**
 * Force the project selection widget to use auto-complete.
 */
function drupalorg_project_update_7006() {
  variable_set('project_selection_widget', 'auto');
}

http://drupalcode.org/project/drupalorg.git/commit/3e55eff

dww’s picture

Issue summary: View changes

Changing "Related Tasks" to "Related Issues".