🇮🇹Italy @MarcoPBazz

Account created on 31 October 2012, about 12 years ago
#

Recent comments

🇮🇹Italy MarcoPBazz

An example of how to declare the field to Views in hook_views_data(), from my comment on #2981047: Allow adding computed bundle fields in Views:

It's working form me (Drupal 9.5x + computed 4.0.0-alpha2) as I can show my computed field, but if I try to filter but I get "missing or broken handler for this element" as message.

Here's my code in my .views.inc file

function mymodule_views_data_alter(&$data) {

  $data['node_field_data']['myfield'] = [
    'title' => 'Myfield title',
    'entity field' => 'myfield',
    'field' => [
      'id' => 'field',
    ],
    'filter' => [
      'title' => t('Myfield title'),
      'field' => 'id',
      'id' => 'myfield',
    ],
  ];

}

What am I missing?

Production build 0.71.5 2024