This module provides a facility to editors/content publishers, to check embedded link's validity before publishing the content. If the content has broken links in the body field, then it won’t get published.
It provides a process which would check link by visiting the destinations and evaluating the HTTP Response code.
If we compare Linkchecker detects broken links from content after save.
How to Install
Download the module from this page.
Install the module in your Website.
Activate the module by visiting module configuration page.
Configure the module on "admin/config/system/stop-broken-link-in-body".
Configuration to restrict the number of links to validate default value 30.
Select content type for restricting the broken links in the body field.
Note:
-Currently it only checks for body field
-This module my be vulnerable to SSRF attacks.
Project's Page:
https://www.drupal.org/sandbox/shaktik/2612690
Module Source Information
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/shaktik/2612690.git stop_broken_link_in_body
cd stop_broken_link_in_body
Manual reviews of other projects:
- https://www.drupal.org/node/2668474#comment-10967997
- https://www.drupal.org/node/2676060#comment-11013407
- https://www.drupal.org/node/2677890#comment-10990777
- https://www.drupal.org/node/2545938#comment-10254769
- https://www.drupal.org/node/2683891#comment-10967647
- https://www.drupal.org/node/2687395#comment-10969747
Comments
Comment #2
shaktikComment #3
shaktikComment #4
joachim CreditAttribution: joachim commentedCould you take a look at https://www.drupal.org/project/linkchecker and explain how this module differs from that please?
Comment #5
shaktik@joachim
Linkchecker detects broken links from content after save.
My module prevents the broken links to be entered in content and prevents the form submission by throwing the error if there is a broken link in the entered content.
Comment #6
PA robot CreditAttribution: PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #7
Shamsher_Alam CreditAttribution: Shamsher_Alam commentedWorking Fine for me...
Comment #8
manauwarsheikh CreditAttribution: manauwarsheikh commentedComment #9
manauwarsheikh CreditAttribution: manauwarsheikh commentedComment #10
manauwarsheikh CreditAttribution: manauwarsheikh commentedComment #11
manauwarsheikh CreditAttribution: manauwarsheikh as a volunteer commented@joachim: Well! This module provides a add-on feature, editors/publishers would get list of broken links before publishing the content. I have used/and been using link checker module, which provides a facility, once the contents are published by running a "check". On the other hand, this module provides just one step before!
Hope you get my point, currently we are working to extend scope of this module, I would appreciate you, if you can share more cases, if you have any to extend the scope.
Comment #12
sudishth CreditAttribution: sudishth as a volunteer and commentedWorking Fine for me...
useful module
so this module is perfect for me
thank!
Sudishth
Comment #13
shaktiksudishth, Shamsher, manauwar
Thanks for review.
Comment #14
nikhilanant CreditAttribution: nikhilanant commentedIts working on my local.
Its working fine.
Comment #15
shaktik@nikhilanant
Thank for review.
Comment #16
naveenvalechaModule limits to body field only ? As per current implementation we can't extentd it to other fields. Why not create a filter instead and it will allow site admins to use on any input format as they like ?
Is there any scope to extend it to other fields ?
if you are planing to change as suggested above. please ignore review below
Move the admin settings form to a helper .admin.inc file it will give little performance hit
Use the default values with the variables http://cgit.drupalcode.org/sandbox-shaktik-2612690/tree/stop_broken_link...
WHy there is LANGUAGE_NONE constant ? Use field_get_items instead. http://cgit.drupalcode.org/sandbox-shaktik-2612690/tree/stop_broken_link... Handle multiple values for the body field.
Why double santization here http://cgit.drupalcode.org/sandbox-shaktik-2612690/tree/stop_broken_link... t() will take care for you.
Add a hook_help and use the readme template for the readme.txt
For long term, define a new permission and use that for the menu path http://cgit.drupalcode.org/sandbox-shaktik-2612690/tree/stop_broken_link...
prefix the variable 'select_node_types' with module name
Comment #17
shaktikHi Naveen,
Big thanks to review but listing issues not major bug or concern.language_none is used for default language so no need to use field_get_content.SO i think related to extended features i am planing to enhance it will be on next release.But for now its fine and i have fix these issues those are very relevant for fixing.
prefix the variable 'select_node_types' with module name:No need to use this prefix.
Why double santization here http://cgit.drupalcode.org/sandbox-shaktik-2612690/tree/stop_broken_link... t() will take care for you.-I have allready checked its not dropping any problem.
Move the admin settings form to a helper .admin.inc file it will give little performance hit-On this i am doing fixing.
No need to implement hook_help on my concern.
Thanks
Comment #18
shaktik@Naveen
Moved admin settings form to a helper.admin.inc.
Comment #19
Shamsher_Alam CreditAttribution: Shamsher_Alam commentedWork fine
Comment #20
shaktikComment #21
klausiRemoving review bonus tag, you have not done all manual reviews, you just posted the output of an automated review tool. Make sure to read through the source code of the other projects, as requested on the review bonus page.
Comment #22
shaktikComment #23
shaktikComment #24
klausiRemoving review bonus tag, you have not completed 3 manual reviews?
Comment #25
shaktikcompleted 3 manual reviews hence agin tagging.
Comment #26
surabhi-gokte CreditAttribution: surabhi-gokte at Srijan | A Material+ Company commentedWorking fine for me. Following are the steps followed :
1. Take a git clone of the module in /sites/all/module/contrib
2. Go to Modules page in your site and enable the module.
3. Go to admin/config/system/stop-broken-link-in-body
4. Select content type for restricting the broken links in the body field and Save.
5. Add some content to the content type and try some incorrect urls.
6. The content will not be saved and an error message will be generated.
Comment #27
klausimanual review:
The wrong check_plain() usage is a blocker right now, you need to know when to use it and when not.
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #28
shaktikComment #29
shaktikklausi,
Thanks for your review! I implemented your recommendations and tips.
I sincerely apologize for the issue faced.
Comment #30
shaktikComment #31
shaktikComment #32
shaktikComment #33
zeeshan_khan CreditAttribution: zeeshan_khan as a volunteer commentedManual review:
All issues mentioned by @klausi, seems to be resolved. However found one small potential issue see #8, Please fix that also then I'll be happy to move this into RTBC :)
Thanks for your contribution! ;)
Comment #34
shaktikHello zeeshan,
Thank you for your Accurate review, updated point no 8 please check.
Comment #35
zeeshan_khan CreditAttribution: zeeshan_khan as a volunteer commentedManual review:
Fixed above mentioned issues! Moving this to RTBC.
Only thing which is left is to get review bonus ;) then you are good to go :)
Thanks for the hard work!
Comment #36
naveenvalechaNice Module!
Manual Review (91ed95) :
$form_state['values']['body'][LANGUAGE_NONE][0]['value']
Use the field_get_items function to extracting the values. Will this work for only single valued field not multiple value ?Moving to N/W due to open questions, Rest looks good to me to go.
Comment #37
shaktikThanks @naveenvalecha for your suggestions/questions, please find my answers below:
1. Removed the used variable stop_broken_link_in_body_restrict_the_number in hook_uninstall.
2. added proper access argument in hook_menu
3. Already specified on project page page in Notes section after @klausi feedbacks.
4. Very good catch ;), added check/loop to handle multiple body fields.
5. Added proper comments about regex and functionality.
6. My bad ;) will take care from next time.
Many thanks for reviewing this :)
Comment #38
PA robot CreditAttribution: PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxshaktik2612690git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #39
shaktikFixed all automated review issues.
Comment #40
zeeshan_khan CreditAttribution: zeeshan_khan as a volunteer commentedLooks good to me :)
Comment #41
shaktikComment #42
shaktikComment #43
er.pushpinderrana CreditAttribution: er.pushpinderrana as a volunteer and at Publicis Sapient for Publicis Sapient commentedManual Review:
'access arguments' => array('access administration menu'),
: that permission is not defined by your module in hook_permission()?Even this permission is not part of Drupal core too. You should define some permission to access this say "administer stop broken link body" or something similar?
FYI... This permission is part of https://www.drupal.org/project/admin_menu module.
The misleading and undefined permission is a blocker right now, otherwise this would seem good to go.
Comment #44
shaktikHi pushpinderrana,
Thanks for review my module.
1) Added hook_permission().
2) Added hook_help().
all issues fixed not an application blocker.
Comment #45
klausiLooks good to me now.
Since this was already RTBC and the only confusing thing was the used permission I think we can approve you.
Thanks for your contribution, Shakti!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #46
sudishth CreditAttribution: sudishth as a volunteer and commentedI reused it on my new development project it working fine