for example everytime my editor goes in a node that has broken links he see in the message box the report about broken links but the role editor does not have ANY of the given permissions specific for linkchecker module
Link check of http://www. domain .com/testpage failed once (status code: 301).
perhaps a new permission should be set to allow a role to see reports on node edit
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | linkchecker-hide-messages-1886890-24.patch | 11.33 KB | cboyden |
| #23 | linkchecker-hide-messages-1886890-23.patch | 11.31 KB | cboyden |
| #22 | linkchecker-hide-messages-1886890-22.patch | 11.31 KB | cboyden |
Comments
Comment #1
hass commentedIf someone has permission to edit a node / field, he see the message on node edit form. What's wrong with this?
Comment #2
giorgoskI would just like more granular report accessing the checker links
since in my use case the person who corrects the content
does not know enough to actually correct the links
there is the seperate site administrator that would try to resolve the broken links issues
Comment #3
giorgoskif that is not good enough reason please close issue
Comment #4
cboyden commentedSeveral of my site admins have also asked for this feature. Here's a patch I'm testing on these installations now - it adds a permission to see broken link messages in context, then checks for that permission before setting messages on the node, comment, and block edit forms.
Comment #6
cboyden commentedThe patch is failing because it hides the broken link messages and those tests check for that message text to appear. I will try patching the test to create and load a user with the new permission first.
Comment #7
cboyden commentedThis patch includes a change to the LinkCheckerInterfaceTest->setUp() function that adds the 'see contextual messages' permission for the test user.
Comment #9
cboyden commented#7: linkchecker-hide-messages-1886890-7.patch queued for re-testing.
Comment #10
hass commentedThis patch looks good to me, but can you add an additional test to verify that the permission grant/revoke are both checked, please? By adding this permission in these late state we remove the message for everyone who has the module installed. We should add an upgrade hook to add this permission to all roles. This should also happen on hook_install.
Comment #11
cboyden commentedI added install and update hooks - they grant the permission to all roles except anonymous. Also added a test, based on the existing interface test, that revokes the permission and checks that the messages are not showing on the edit forms.
Comment #12
cboyden commentedThe new update hook throws an error if the module has been installed but is disabled when it runs.
Comment #13
hass commentedThe reason should be that you run functions that are located inside user.module.
These are not available when running .install files. You need to load the user module file before using these functions.
e.g.
drupal_load('module', 'user');Comment #14
bwood commentedHere's a re-roll of #11 which works with the latest -dev.
Comment #15
hass commented#13
Comment #16
kyleheney commentedAny chance this gets committed to an updated release version?
Thanks
Comment #17
cboyden commentedLoading the user module didn't fix the error in the update hook when the module had been installed and later disabled. I've attached an updated patch that's rerolled against the latest dev and also skips granting the permission if the module has been disabled.
Comment #18
joelpittetThe permission should probably be a bit more specific to linkchecker because it could conflict with contextual, context, or other modules.
There are some nitpicky coding standards on the array ending parenthesis indent that could be cleaned up as well.
Comment #19
cboyden commentedThanks for the review @joelpittet, I've attached an updated patch that changes the permission name to "see linkchecker messages in context" and fixes the array closing indents.
Comment #20
hass commentedI do not understand this logic... we run a linkchecker update, but linkchecker is disabled? Ok, this is possible, but why not adding the permission to every role?
Why has this test removed?
Comment #21
cboyden commentedIf the module has been installed, but later disabled, its update hooks still run. But because the module is disabled, you get an error when running the previous version of the update hook. See https://www.drupal.org/node/737816#comment-7398132 and the rest of that issue for discussion of the problem. It was reported in 2010 and looks like it hasn't yet been fixed in D7 or D8. A possible solution, instead of skipping the permission grant, would be to bypass the problematic functions and update the permissions directly in the database. But that seems like overkill.
I will take a look at the missing test, it might have gotten messed up in one of the re-rolls.
Comment #22
cboyden commentedUpdated patch fixes the missing test and also some coding standards issues in the updated code (bracket indentation, spaces, class comments).
Comment #23
cboyden commentedPatch re-rolled against latest dev.
Comment #24
cboyden commentedRe-rolled patch to apply to latest release.
Comment #25
quadrexdevD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.
Everyone can apply the patch above (not tested by the maintainers, tested by the community) to their D7 projects.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.
Thanks!