Attached patch is a feature request to use a Views instead of a static page, following previous issue #2938885.

I include a bulk form action plugin to delete multiple rows and exposed quick filter to search on domains (including referer) and query strings.

Module reinstallation is necessary to write Views and Action plugin config files.

We're about to use it on a live website.

Best regards.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

B2F created an issue. See original summary.

b2f’s picture

b2f’s picture

Assigned: b2f » Unassigned
Status: Active » Needs review
b2f’s picture

FileSize
36.19 KB

Updates view permission with 'manage broken link list

b2f’s picture

#4 patch above tested locally with composer-patches (https://github.com/cweagans/composer-patches).

"patches": {
    "drupal/broken_link": {
        "Adds new broken link properties": "https://www.drupal.org/files/issues/broken_link-adds-new-properties-views-support-2938885.patch",
        "Replaces broken link static admin page with a Views page": "https://www.drupal.org/files/issues/0001-2938896-Replaces-admin-list-with-Views-page_0.patch"
     }
}
manojapare’s picture

Status: Needs review » Needs work

When searching for `Request parameters` in `/admin/config/broken_link`. Getting WSOD.

Error details:
Uncaught PHP Exception Drupal\\Core\\Database\\DatabaseExceptionWrapper: "Exception in Broken Links[broken_link]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'broken_link__query_string.query_string' in 'where clause': SELECT broken_link.hits AS broken_link_hits, broken_link.updated AS broken_link_updated, broken_link.id AS id FROM {broken_link} broken_link LEFT JOIN {broken_link__query_string} broken_link__query_string ON broken_link.id = broken_link__query_string.entity_id AND broken_link__query_string.deleted = :views_join_condition_0 WHERE broken_link__query_string.query_string LIKE :db_condition_placeholder_1 ESCAPE '\\\\' ORDER BY broken_link_hits DESC, broken_link_updated DESC LIMIT 101 OFFSET 0; Array([:db_condition_placeholder_1] => %test% [:views_join_condition_0] => 0)" at /core/modules/views/src/Plugin/views/query/Sql.php line 1496, referer: /admin/config/broken_link

Also, prefer update path instead of reinstalling the module, which will be not possible without data loss.

b2f’s picture

Assigned: Unassigned » b2f
b2f’s picture

Attached a new update from broken_link.install to avoid a module reinstallation.
I also remove referers and query string filters as they don't seem to be important.

b2f’s picture

b2f’s picture

Assigned: b2f » Unassigned
Status: Needs work » Needs review
manojapare’s picture

Status: Needs review » Needs work

Patch looks good. I feel, it will be better if we keep referers exposed filter like link.

manojapare’s picture

Status: Needs work » Reviewed & tested by the community

Since we are aggregating the referers for each broken links with their count. We can avoid filter using referers. Now the update is also working fine. No need for re-installation of the module.

manojapare’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
31.83 KB

Found one issue. In admin configuartion page I can see two links for Broken Link.

Fixed the same in this patch.

b2f’s picture

Status: Needs review » Reviewed & tested by the community
manojapare’s picture

Status: Reviewed & tested by the community » Needs work

When adding views filter for Referers fields it is throwing error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'broken_link__referers.referers' in 'where clause': SELECT broken_link.hits AS broken_link_hits, broken_link.updated AS broken_link_updated, broken_link.id AS id FROM {broken_link} broken_link LEFT JOIN {broken_link__referers} broken_link__referers ON broken_link.id = broken_link__referers.entity_id AND broken_link__referers.deleted = :views_join_condition_0 WHERE broken_link__referers.referers LIKE :db_condition_placeholder_1 ESCAPE '\\' ORDER BY broken_link_hits DESC, broken_link_updated DESC LIMIT 101 OFFSET 0; Array ( [:db_condition_placeholder_1] => [:views_join_condition_0] => 0 )

manojapare’s picture

Status: Needs work » Needs review
FileSize
37.07 KB
6.16 KB

Fixed the additional fields issue with views filter and sort. Also has added referers as an exposed filter in broken link views.

ajay_reddy’s picture

Status: Needs review » Reviewed & tested by the community

This patch works fine while listing all fields in views and sorting also looks good.

  • manojapare committed 2b3d604 on 8.x-3.x
    Issue #2938896 by B2F, manojapare, ajay_reddy: Replace BrokenLink list...
manojapare’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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