Skip to content

[Features-Request] More hooks for handling url table custom columns #3074

@Dherlou

Description

@Dherlou

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Summary

  • some plugins use custom url table columns, e.g. user column to save the YOURLS_USER, who created the shortlink
  • it is already possible to:
    1. adjust database scheme in plugin activation hook
    2. add new column to the search and order by dropdowns with 'html_select'
    3. apply the custom column for the search/ordering with 'admin_view_search_in' and 'admin_view_sort_by'
  • however, handling the changes to the sql query and the generation of long names requires changing code of the core in two places:
    1. admin/index.php::"// Searching": requires modification to add the custom column for the 'search all' case
    2. includes/Views/AdminParams.php::get_param_long_name": currently only works for the native columns without checking for unknown columns

Motivation

  • the usage of custom url table columns is made easier without having to patch core functionalities

Describe the solution

  1. admin/index.php::"// Searching": add filter to be able to change sql search clause from within a plugin (analogous to where clause with hook 'admin_list_where')
  2. includes/Views/AdminParams.php::get_param_long_name": add filter inside the function to allow custom handling (especially for non-native columns)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions