Problem/Motivation
Currently, project_issue_link_filter_callback
checks that the "issue" is published, but that's making an assumption that might not always be desired.
Admin or priviledged users might have permissions to see unpublished nodes and still want the filter to be applied.
We might want to add special markup in the template for these cases too, but right now we don't have the opportunity for it.
Steps to reproduce
As superadmin or user with permissions to see unpublished nodes, type [#1234] where 1234 is an unpublished issue. The text will not be replaced by a link, even if the user has permissions to see it.
Proposed resolution
Allow modules to alter the behaviour if needed.
Comment | File | Size | Author |
---|---|---|---|
#5 | Screenshot 2022-07-29 at 12.14.45.png | 16.91 KB | fjgarlin |
#5 | Screenshot 2022-07-29 at 12.13.02.png | 13.1 KB | fjgarlin |
Issue fork project_issue-3300635
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 #2
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedReferenced two issues affected by this behaviour.
Comment #3
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedComment #5
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedI used the code in the MR: https://git.drupalcode.org/project/project_issue/-/merge_requests/2
Then, in another module, implemented the hook like this:
I logged in as user uid = 1 and unpublished the comment.
Note that if no other module alters the data, the behaviour is exactly the same as we have now.
Comment #6
drummWe should do this with a separate filter in drupalorg module that we configure to run after the project_issue filter. project_issue leaves [#123] untouched when an issue isn’t matched, so it would be left for us to process. Then we can cleanly disable project_issue module, and keep the [#123] links in documentation and other non-issue content.
Comment #7
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedCool. In that case, nothing to do here. Thanks for the guidance.