Problem/Motivation
$linkchecker_excludes = variable_get('linkchecker_exclude');
$form['field']['linkchecker_exclude'] = array (
'#type' => 'checkbox',
'#title' => t('Exclude field from Link Checker scans'),
'#description' => t('Force Link Checker to ignore this field when scanning content for broken links.'),
'#default_value' => $linkchecker_excludes[$form['#field']['field_name']] ? $linkchecker_excludes[$form['#field']['field_name']] : 0,
);
If the field name is not in the excludes array, you get an "Undefined array key" warning.
Steps to reproduce
Visit /admin/structure/taxonomy/TAXONOMY_NAME/fields/FIELD_NAME for a field that is not excluded from linkchecker.
Proposed resolution
This fixes the issue.
'#default_value' => isset($linkchecker_excludes[$form['#field']['field_name']]) ? $linkchecker_excludes[$form['#field']['field_name']] : 0,
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork linkchecker-3360756
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
ranjit1032002Comment #4
solideogloria commentedI fixed it in the merge request. Please review.
Comment #5
sgdev commentedThis is a common sense patch. Thanks for the fix.
Comment #8
vladimirausThanks! Committed! 🍻