When adding a new issue ("node/add/project-issue"), there's a lack of a filter to check whether the projects suggested to the user have the "Enable issue tracker" option checked. The result of this is that on the select form, the user gets projects that are not supposed to track issues, and can effectively create issues linked to them.
The issues will appear then on the issues view, but if you try to filter by project, the project selected for the created issue won't ever come up as an option, because the issues view *does* actually check whether the projects to be displayed allow issue tracking or not.
I attach a patch for this, which basically passes a filter array to the "project_projects_select_options" function, so that it makes the correct query to the database.
I don't think there's something else needed for the patch, as it doesn't seem quite right to remove issues related to projects without issue tracking enabled, that have been already created. Those issues can still be seen on the Issues view, and removed from there.
| Comment | File | Size | Author |
|---|---|---|---|
| issues_for_non_issue_tracking_nodes_fixed.patch | 955 bytes | slv_ |
Issue fork project_issue-1857390
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
dwwThanks, that's a good start. However, there are other aspects to fix this bug as already reported here:
#956744: Unchecking a project's "Enable issue tracker" option doesn't do anything.
Let's continue over there. Thanks!
Comment #2
slv_ commentedHey dww,
Thanks for your quick response on this issue! I've been looking a bit at the linked issue and the ones linked from there, as well as the 6.x code. Just some thoughts:
Some of the things mentioned in #956744 are already fixed for the 7.x-2.x-dev branch, like the block "recent issues", which doesn't appear anymore for projects without issue tracking enabled.
The "issue search" form doesn't get generated for those kind of projects either, so now if you try to access the URL of a project without issue tracking enabled, like
/project/issues/{project}
you'd get a not found page, which is ok because that page is not supposed to exist.
The node add form is still there, so I agree that it needs fixing.
Is there any reason why the 7.x-2.x-dev branch should be blocked on this matter until the 6.x gets the patch? Imho, given the code has changed quite a bit for both versions, and the bug affects to different elements in both them (the 7.x being affected less), the patch for this bug, might be quite different for the two versions, so if there's someone willing to put some work for 7.x, I don't see why users of that version should wait to benefit from it.
Of course, I might not be aware of some other reasons, that's why I'm asking =).
Thanks!
Comment #3
drummThere are two selection widget options, select which you’ve worked on updating, and also an autocomplete, which is used when you have many projects, such as www.drupal.org.
Comment #4
fjgarlin commentedI checked and the autocomplete callback function is already checking that property.
In the case of drupal.org, and other parts of the module, we're using "field_project" instead of "project", so the autocomplete function is just a default one from the entity reference module if it's configured that way, and we don't have access to the results.
We can however hook into the validation and loading of the page for both new and existing issues.
See the following cases with the fixes provided in the MR. I've turned off issue tracker for "drush" in this development copy.
I think the above addresses the scope of this issue, but I also think that we should tackle the other two related issues here as they are all related to the user experience when the tracker is disabled and code created for this issue would be needed for the others (or viceversa).
I'll continue working on the rest but wanted to give an update.
Comment #6
fjgarlin commentedComment #7
fjgarlin commentedComment #8
fjgarlin commentedComment #9
fjgarlin commentedTest
Issue tracker was disabled for Drush: https://fjgarlin-drupal.dev.devdrupal.org/node/97249/edit
Fixed in this issue
* Drush does not appear https://fjgarlin-drupal.dev.devdrupal.org/node/add/project-issue
* If you preselect or select Drush you get an error message:
** New https://fjgarlin-drupal.dev.devdrupal.org/node/add/project-issue/drush
** Existing https://fjgarlin-drupal.dev.devdrupal.org/project/drush/issues/3312624
Fixed in related issues
* Project page does not show the link to issues https://fjgarlin-drupal.dev.devdrupal.org/project/drush
** Fix is in drupalorg module: #3314430: Render link to issues only if issue tracker is enabled
* Listing of issues (before 404, now shows past issues and message): https://fjgarlin-drupal.dev.devdrupal.org/project/issues/drush?text=&sta...
** Fix is in drupalorg module: #3314448: Show list of issues for a project even if issue tracker is disabled
Comment #11
drummLooks good now, thanks!