As I was filling #2085361: Provide a field handler for serial columns that do not have decimal or separator formatting it occurred to me it would be really nice if I could set some default options for my handler in hook_views_data (or the equivalent in D8). Something like the following:
$data['versioncontrol_repositories']['repo_id'] = array(
'title' => t("Repository ID"),
'help' => t("The unique identifier of the repository"),
'field' => array(
'handler' => 'views_handler_field_numeric',
'click sortable' => TRUE,
'options' => array(
'separator' => '', // <-- Default option whenever this is used as a field.
),
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
'argument' => array(
'handler' => 'versioncontrol_handler_argument_repository_repo_id',
),
);
Comments
Comment #1
tim.plunkettTagging
Comment #2
dawehnerI went with a slightly different syntax to be similar to defineOptions().
Once you have already unit tests provided creating a new test method is really convenient.
Comment #4
dawehner#2: vdc-2085381-2.patch queued for re-testing.
Comment #6
dawehnerHere is a fix, so a bug in an unrelated place.
Comment #7
jibran6: vdc-2085381-6.patch queued for re-testing.
Comment #11
asirjacques commentedHello !
How close are we to implement that ? Is there somebody working on it ?
Comment #23
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #25
smustgrave commentedWanted to bump 1 more time if still desired?