5 * Provide views data for redirect_404.module.
8 use Drupal\redirect_404\SqlRedirectNotFoundStorage;
11 * Implements hook_views_data().
13 function redirect_404_views_data() {
16 // Only define views data if the service uses our specific implementation.
17 if (!\Drupal::service('redirect.not_found_storage') instanceof SqlRedirectNotFoundStorage) {
21 $data['redirect_404']['table']['group'] = t('Redirect 404');
23 $data['redirect_404']['table']['base'] = [
25 'title' => t('Fix 404 pages'),
26 'help' => t('Overview for 404 error paths with no redirect assigned yet.'),
29 $data['redirect_404']['path'] = [
31 'help' => t('The path of the request.'),
40 $data['redirect_404']['langcode'] = [
41 'title' => t('Language'),
42 'help' => t('The language of this request.'),
44 'id' => 'redirect_404_langcode',
51 $data['redirect_404']['count'] = [
52 'title' => t('Count'),
53 'help' => t('The number of requests with that path and language.'),
56 'click sortable' => TRUE,
63 $data['redirect_404']['timestamp'] = [
64 'title' => t('Timestamp'),
65 'help' => t('The timestamp of the last request with that path and language.'),
68 'click sortable' => TRUE,
75 $data['redirect_404']['resolved'] = [
76 'title' => t('Resolved'),
77 'help' => t('Whether or not this path has a redirect assigned.'),
83 'label' => t('Resolved'),
88 $data['redirect_404']['redirect_404_operations'] = [
89 'title' => t('Operations'),
90 'help' => t('Provide operation buttons to handle the 404 path.'),
92 'id' => 'redirect_404_operations',
93 'additional fields' => ['path', 'langcode'],
94 'real field' => 'path',