Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The code that adds the default values to the exposed filters in linkchecker.module cause an 'Undefined index' error when the filters are deleted.
Steps to reproduce
Edit the "Broken Links Report" view and delete the "Result" and "Status code" filters.
Proposed resolution
Add a couple checks to the alter hook to make sure the filters exist before adding the new options. There may be a more elegant way of doing this, but I needed a patch quick.
Remaining tasks
Review, maybe come up with a better solution?
Comment | File | Size | Author |
---|---|---|---|
#14 | 3186322-test-only.patch | 5.25 KB | eiriksm |
#12 | 3186322-test-only.patch | 3.23 KB | eiriksm |
| |||
#10 | 3186322-test-only.patch | 2.76 KB | eiriksm |
#5 | 3186322-test-only.patch | 2.64 KB | eiriksm |
Issue fork linkchecker-3186322
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 #3
eiriksmHad the same problem.
I don't see what the states part is trying to achieve, so I was planning on opening a similar issue, but this works!
Comment #4
eiriksmI am going to write a quick test for this
Comment #5
eiriksmAdded a test in the fork, and here is test only patch that should be failing.
Comment #7
eiriksmComment #8
JeroenTThe state was added in #3112908: Adjustments to "Broken Links" view.
When you filter on a result (e.g. "Server Error (5xx)") the code field doesn't make any sense. The result filter makes it possible to filter on a group of HTTP status codes while the code field makes it possible to filter on a single http status code.
Comment #9
eiriksmAhh, I see that now. Thanks!
I will just update my test to test that as well, so we get coverage for it.
Comment #10
eiriksmNew test only patch
Comment #12
eiriksmNew test only patch
Comment #13
eiriksmOuch. I was fearing that was the case. No php notice fails in webdriver tests. Probably add them both then?
Comment #14
eiriksmNew test only with both a functional test and functionaljavascript test, that should hopefully fail, while the MR should pass.
Comment #16
eiriksmComment #17
JeroenTLooks good to me.
Comment #18
eiriksmComment #20
eiriksmThanks! Committed!