Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [plugins]

Use it for Drupal 8 plugins; for plugins implemented from the Views module use views, ctools for Chaos tool suite plugins.

Filter by
Sorted by
Tagged with
-1
votes
0answers
14 views

How do I use nodeaccess?

How do I use NodeAccess? I have installed and enabled it, but I otherwise don't see any options besides the Grant node permissions on the Permissions page. Where are the actual access permission ...
1
vote
2answers
140 views

Field formatter module throws cannot declare class error

I am trying to write a custom module, which defines a field formatter plugin, but when I visit the Manage display page, I get this error: Fatal error: Cannot declare class Drupal\my_formatter\...
0
votes
1answer
44 views

Plugin Not Found Exception

I am implementing REST in Drupal 8. I have created a custom plugin for REST resource, enabled the plugin and configured permissions for that REST endpoint. After few days, I removed the code for ...
-1
votes
1answer
45 views

Why would a page created by a custom module work in my DEV environment, but produce a 404 on the live server?

I have a custom module that's creating feeds of my content for me. It's been running fine up until now. Existing feeds work, and the new feed I just added works on my development site on my local mac. ...
0
votes
1answer
37 views

Is there any PHP package that's very similar to the Plugin API? [closed]

I really like the Drupal 8 plugin system. I am now also working on a non-Drupal related project and am wondering if there's any similar solution to that on packagist.org? Was trying to find one but ...
0
votes
0answers
14 views

viewElements Fails To Fire in Custom Field Formatter

Using the code, below, in my_module in the path my_module/src/Plugin/Field/FieldFormatter/DateRangeSpecialFormatter.php the format appears both in the Views field dialog and the content type manage ...
0
votes
0answers
29 views

How to recover datas from a class of service in a custom plugin?

So to be a little clearer, I'm creating a source migrate plugin that extends SourcePluginBase and not SqlBase. I get my data from a class of service, but I would like to know how to bind them to the ...
0
votes
0answers
55 views

Set Custom Form Element Value in Extended LinkWidget Class

I have a class extending LinkWidget and would like to add a new form element. I have omitted all code except what I have added: class CustomWidget extends LinkWidget { public static function ...
0
votes
0answers
8 views

Configure ckeditor per field

I'm wanting to configure ckeditor via a custom plugin (adds a simple drop down of defined terms to insert into text), however, I need to know which field I'm editing so I can load the correct terms ...
0
votes
0answers
27 views

Apply generateOptions() to Custom query() in Views Filter Handler

I am trying to understand how I get the options from generateOptions() to apply to my query() function in a ManyToOne Class. class MyClass extends ManyToOne { public function init(ViewExecutable $...
0
votes
1answer
38 views

Update fields to use a different FieldFormatter during an update hook

I have a drupal.org module that has changed its fieldformatter ID in a later version and I need the update hook to update all isntance of the content to use the new formatter, but cant seem to figure ...
1
vote
0answers
170 views

Drupal\Component\Plugin\Exception\PluginNotFoundException: The “<whatever>” plugin does not exist

After updading a Drupal site from 8.6.16 to 8.7.1 (PostgreSQL 9.6.13 , Nginx) I get this error in almost every operation (creating a view , installing a module, creating a content type, creating a ...
0
votes
0answers
21 views

How do I override a plugin? [duplicate]

I am looking for a way to override a block plugin in Drupal 8. Most of the functionality provided by this block, part of a third-party module, fulfills the requirements. However, a couple of things ...
0
votes
0answers
162 views

Can't place a custom block

After adding a block file to src/Plugin/Block I can't add the block on the Block Layout admin page. When I filter by block name I can see it, but then when I try to place it I can't get to the ...
0
votes
0answers
54 views

How to troubleshoot a `PluginNotFoundException`?

We have a Drupal 8 site. For a while, I've been intermittently getting this entry in the watchdog log: Drupal\imageapi_optimize\Exception\PluginNotFoundException: The "resmushit" plugin does not ...
0
votes
0answers
60 views

Error Passing Function from Form Controller Across Module

I would like to access a function from my Form\Form.php in both my Plugin\Block\Block.php and MYMODULE.module. Related: How to render content generated by controller in custom block? and Inject ...
0
votes
0answers
33 views

PluginNotFoundException after moving the views_bootstrap module

I have a multisite installation with some site having a bootstrap 3.x theme and a new site that should have a bootstrap 4.x theme. All BS3 site are using the views_bootstrap module 8.3.x The new BS4 ...
1
vote
0answers
92 views

Use Drupal's Default Views Filter Handler on “Pseudo” Views field?

How do I use Drupal's core Views filter handler plugins on a custom views field? I have a custom field which has its own FieldPluginBase Class. Does not have a DB query. MYMODULE.views.inc: /** * ...
0
votes
2answers
72 views

Options form with FieldPluginBase?

I tried some variations on the code below, but I have not been able to pass my custom form options to render(). class CustomField extends FieldPluginBase { public function query() { // This is ...
1
vote
1answer
226 views

What was the motivation for developing the plugin API?

I am trying to wrap around my head as to what was the need for the Plugin API when the module system extends the Drupal core.
0
votes
0answers
87 views

Unable to load plugin definitions

I have a custom plugin. As a new user, when I try to load existing plugin definitions, it returns empty. The annotation definition: <?php namespace Drupal\cp_settings\Annotation; use Drupal\...
1
vote
1answer
128 views

Basefield 'string' shown as select list widget in entity form

I've got a custom entity ('content_sharing') and defined one of the fields as $fields['entity_definition'] = BaseFieldDefinition::create('string').... The create-form I'm showing the user is loaded ...
0
votes
1answer
48 views

Unit test a plugin

I want to add a small unit test to a migrate plugin for a migration I am building. I looked for some examples but did not find much for unit tests of a plugin. I want to run some assertions when the ...
0
votes
1answer
51 views

Use 'Search Api Attachments' file extractor in my own custom 'Search Api' processor plugin

I'm writing a custom processor for search api that will search body content of nodes for links to pdfs and extract the content from them to be indexed. It's meant to be able to do the same thing ...
1
vote
0answers
128 views

Custom feeds plugin not discovered [closed]

I am trying to create/work on an Address target plugin for the Feeds module. I have tried applying this Address target patch (shown below) from this related issue. However, the Address field on the ...
1
vote
0answers
77 views

How do i skip a row from a CSV based on the value of 2 fields within the CSV file?

I have a CSV file that contains about 200 records/rows. ID, OrgID, EstabID, OrgName, Address 1, AB234, AB234, ABC corp, 123 Main Street 2, AB234, 8989, ABC Corp-West, 456 Better Street 3, 4858, ...
0
votes
0answers
39 views

CKEditor Filter does not persist text after modifying

I wrote a filter class that strips out certain tags from the user input in the editor. For example it uses a regular expression to remove <span> tags of a certain class. The steps I took were: ...
0
votes
1answer
23 views

How do I reset my search result link?

I created a custom search plugin for a custom entity. I would like to change the link that is presented to the user on the list of results. I had originally set it to the canonical page using $entity->...
1
vote
0answers
79 views

PHP Type Error with Cached Plugin definitions in DiscoveryCachedTrait.php

We have the following set up for Drupal 8.6.3 - IIS Server, MSSQL Server, sqlsrv drivers. However, every few hours, Drupal throws PHP errors(all of them belonging to the same kind) and most pages from ...
0
votes
1answer
38 views

Get Plugin Definition methods using dependency injection

It is my first time defining a custom Plugin Type. I think that this might be a comming thing in Drupal but I was not able to find any documentation anywhere. I want to get Plugin definition methods ...
0
votes
1answer
140 views

migration process plugin not registering

My plugin aims to strip out html tags from titles being imported from xml Here is the error I'm receiving: FVFXF0ETHV2F:process$ drush mim complinet_xml_to_node Drupal\Component\Plugin\Exception\...
1
vote
1answer
618 views

How do I add the ability to change font size in CKEditor?

I'm trying to install the CKEditor Font Size Module in my my editor. I installed the module via composer and then proceeded to copy the font/plugin.js file from the Font Plugin's page into libraries/ ...
1
vote
0answers
93 views

Entity Reference Custom Entity not visible

I made the following module with a custom entity in it. This is all working fine, but now i want to make a entity reference field in some content type to this custom entity. For this i made the ...
0
votes
1answer
61 views

Plugins before event subscribers

Not sure if there's a way out of this problem but... I have a custom log module which listens for events that could come from multiple sources. All it does is listen for an event, and if it occurs ...
0
votes
1answer
21 views

define a template file for a field item in my modules

I wish to register a template file for use with a filed item, but I can't wrap my head around it. here is what I am trying to achieve. In my field widget Formatter public function viewElements(...
0
votes
1answer
124 views

EntityReferenceSelection plugin ignored

I am trying to create a simple time tracking app and for this purpose, I need an entity reference field with some additional filtering of referenced entities (only active projects can be selected). I ...
0
votes
1answer
25 views

Load the value of an entity field type in another form

I have created a custom field and I wish to load the value dynamically in another form in relation to the specific node entity the value belongs to. I understand that to get the value I have to use/...
1
vote
1answer
896 views

How to fix “Cannot read property 'icons' of null” error?

First of all, I'd like to mention this answer is not related, I'm using Drupal 8.6.1. I'm trying to create a CKEditor plugin with a new button. In the /admin/config/content page I get the error but ...
2
votes
0answers
87 views

How to describe data for a custom views filter in the my_module.schema.yml file?

I encountered with a problem. For creating a custom views filter in my own module I should also describe it in the my_module.schema.yml file. Could you clarify me, how to do it? For instance, there ...
1
vote
1answer
179 views

Migration Custom Plugin Return Value

I have a migration and it is very simple. I have a CSV file of employee number and years of service. I have added the two fields to the users in the system and populate them when the users have been ...
0
votes
1answer
223 views

CKEditor oEmbed Plugin Shows up in config but not in actual Editor instance

The issue I'm having is very similar to this question, but the solutions here did not work for me. The steps I took: Downloaded the latest version of the oEmbed plugin from https://ckeditor.com/...
3
votes
0answers
125 views

How to set the correct RSS row plugin?

I need to add an image to the RSS feed. So I create a new row plugin for the RSS and it extends RssFields row plugin. /** * Renders an RSS item based on fields. * * @ViewsRow( * id = "...
1
vote
0answers
28 views

Why methods valueValidate and valueSubmit don't execute?

I'm trying to create a views filter containing an exposed form. The filter class is inherited from FilterPluginBase. In principle, the filter almost works, but I have run into a strange problem. I ...
1
vote
1answer
87 views

The pdf_thumbnail plugin does not exist

After I tried to update the database I got the following error: Failed: Drupal\Component\Plugin\Exception\PluginNotFoundException: [error] The "pdf_thumbnail" plugin does not exist. in ...
0
votes
2answers
255 views

Get the value of one field from another in the same form

I have a form with multiple fields. How can I get the value of field B from within the formElement method of my widget class for field A?
0
votes
1answer
27 views

Lost setting of the custom field when editing a page

I created a content type with my own custom field as described in Why do I get this error when I save my custom field? The insertion of an item with this content type works, but when I want to modify ...
0
votes
1answer
73 views

Why do I get this error when I save my custom field?

I created a custom field and this is its formElement() method. public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { ...
0
votes
1answer
21 views

formatting a select custom field

I created a custom field with the following definition: public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $...
0
votes
1answer
100 views

Validation plugin for a Boolean field

I want to contextually filter my View with a boolean field, for which the "On" value is "New," so using a URL like /view/url/new. I first tried basic validation, but that would only work if my URL ...
0
votes
2answers
135 views

How does data propagate from the formElement of a Widget to the properties of a FieldItem?

Here is my custom Widget: <?php namespace Drupal\scripture\Plugin\Field\FieldWidget; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\WidgetBase; use Drupal\Core\Form\...