- last update
11 months ago 2 pass
I would like to use contextual filters within a view of Fragments, but currently there is an error that occurs when trying to add one for `Fragment type`
Delete the following line in `fragments/src/Entity/FragmentViewsData.php`
<?php
namespace Drupal\fragments\Entity;
use Drupal\views\EntityViewsData;
/**
* Provides Views data for fragment entities.
*/
class FragmentViewsData extends EntityViewsData {
/**
* {@inheritdoc}
*/
public function getViewsData() {
$data = parent::getViewsData();
// This one vvv.
$data['fragment_field_data']['type']['argument']['id'] = 'fragment_type';
// This one ^^^.
$data['fragment_field_data']['user_id']['help'] = $this->t('The user authoring the fragment. If you need more fields than the uid add the fragment author relationship');
$data['fragment_field_data']['user_id']['filter']['id'] = 'user_name';
$data['fragment_field_data']['user_id']['relationship']['title'] = $this->t('Fragment author');
$data['fragment_field_data']['user_id']['relationship']['help'] = $this->t('Relate fragments to the user who created them.');
$data['fragment_field_data']['user_id']['relationship']['label'] = $this->t('author');
return $data;
}
}
Delete the line listed above.
None that I know of?
None that I know of?
None that I know of?
Needs review
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.