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

Command icon 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

solideogloria created an issue. See original summary.

ranjit1032002’s picture

Assigned: Unassigned » ranjit1032002

solideogloria’s picture

Assigned: ranjit1032002 » Unassigned
Status: Active » Needs review

I fixed it in the merge request. Please review.

sgdev’s picture

Status: Needs review » Reviewed & tested by the community

This is a common sense patch. Thanks for the fix.

VladimirAus made their first commit to this issue’s fork.

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Committed! 🍻

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.