2022 Developer Survey is open! Take survey.

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
0 votes
0 answers
25 views

Custom Simple Action after updating a node

I am trying to create a simple way to execute certain actions on the database every time when I update a node. I have been looking at Drupal's Action module, however I can't find any good manuals ...
user avatar
  • 101
1 vote
0 answers
32 views

Create a Context/Condition and get a view display used on the page

I want to create a context/condition plugin that checks the total results returned from a view display on the page (its a block), and if its less/greater than a certain figure, hide certain peripheral ...
user avatar
  • 26.3k
0 votes
1 answer
85 views

Migrate PHP version - The "" plugin does not exist

I'm using Drupal 9.3.11 on PHP 7.3. Site is running perfectly. I need upgrade to PHP 8, but I am getting this error. Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin ...
user avatar
  • 141
1 vote
1 answer
72 views

TypeError: Argument 1 passed to ........ ::__construct() must implement interface Drupal\Core\Cache\CacheBackendInterface, array given, called in

I'm getting an error when I wrote the code using Dependency injection: TypeError: Argument 1 passed to Drupal\sydneypro_exchange_rates_block\Plugin\Block\ExchangeRatesBlock::__construct() must ...
user avatar
  • 33
0 votes
0 answers
24 views

How do I get JS event attached to multiple views rows

I am creating a custom views field and need it to have JS attached to it's on click functionality. When I get one views result, it works perfectly, but when I have multiple results, it only attaches ...
user avatar
0 votes
1 answer
64 views

How can I display user information along with its choices?

Usually, polls are anonymized. We need to process total votes, percentages... Now, in the context of Ukraine invasion, an institutional client wants to enhance an Advanced poll existing implementation,...
user avatar
  • 3,432
-1 votes
2 answers
69 views

Dependency injection in create() method of block plugin with derivatives

I am trying to extend the menu_block module to allow it to work with domains (via the domain module). In order to do this I am extending the MenuBlock class, and trying to access the domain.negotiator ...
user avatar
0 votes
0 answers
30 views

Why would a contributed module try to load one of its files from a custom directory?

I built a module on a local instance in my module/custom directory; I then published it on drupal.org, as Group by Field Widget. For some reason, when I install the release 1.1.1 via Composer, I get ...
user avatar
  • 139
1 vote
1 answer
39 views

Use deriver in Drupal Migration yml

I am trying to use the deriver key in a migration yml to have dynamically build migrations for each bundle of an Entity Type (Drupal 9). I read this and I am trying to use the deriver key to point to ...
user avatar
  • 1,203
0 votes
0 answers
17 views

How can I use the join handler plugin with groups and multiple conditions?

I'm trying to build a custom view filter and in the query method I need to create this join. LEFT JOIN node__field_list list ON node_field_data.nid = list.entity_id AND list.deleted = 0 AND (list....
user avatar
0 votes
1 answer
55 views

How to provide an array of values from a context provider

I'm looking into building a custom Context Provider, specifically to provide "groups of the current user". I'm building this for another plugin, a Condition plugin, whose purpose is to ...
user avatar
  • 1,134
0 votes
1 answer
63 views

How to use sql MAX() function in views plugin query

I am creating a custom views filter for a custom views field. The following SQL will accomplish the filter I seek: select nid, moderation_state, content_entity_id, MAX(content_entity_revision_id) ...
user avatar
1 vote
1 answer
24 views

Custom field formatter fails in create()

PHPStorm, PHP 7.4 IDE highlights $container->get('date.formatter'), with "Expected parameter of type '\Drupal\Core\Datetime\DateFormatterInterface', 'object' provided" This function is ...
user avatar
  • 11
1 vote
2 answers
305 views

How to use migrate process plugin concat on multiple values?

I am trying to import from a csv that has multiple files in the same column, e.g. title,gallery,tag node1,img1.jpg|img2.jpg|img3.jpg,2 node2,img4.jpg,2 node3,img5.jpg|img6.jpg,3 I need to prepend the ...
user avatar
  • 13
1 vote
0 answers
58 views

How do I override /libraries/ckeditor-wordcount-plugin/lang/some.js?

I'm using ckwordcount module which basically adds nice max length and counter features to text Fields, and relies on WordCount Plugin for CKEditor Editor. Most of the translations in the plugin lang ...
user avatar
  • 3,432
1 vote
0 answers
34 views

The form argument Drupal\terminal\Form\TerminalCliForm is not a valid form

I've read through other questions regarding the same error message. They all seem to end up being due to typos or the file path. I don't believe that is the case here, but we'll see. I have a working ...
user avatar
1 vote
1 answer
91 views

Why custom condition is not containing parent entity?

I'm using: Drupal 9.1.7 Commerce 2.24 I'm trying to create my custom condition (based on https://docs.drupalcommerce.org/commerce2/developer-guide/core/conditions). However parent entity is always ...
user avatar
  • 4,955
0 votes
0 answers
362 views

How to filter entity_autocomplete results by content type and a field

I am trying to implement an entity autocomplete field in a form where the autocomplete entities are filtered by content type and a certain field of that content type. I know I can filter the ...
user avatar
0 votes
1 answer
67 views

Purpose of "views_date_format_sql" module

i got back a projet which is using the module views_date_format_sql. This module is not compatible with D9, so I'm trying to find a replacement But I don't get what this module is supposed to do. If I ...
user avatar
0 votes
0 answers
165 views

Views query plugin Undefined Index error

I have been trying to build a custom views query plugin but Im getting an undefined index error for each field that i'm mapping. The filters im using for the endpoint do work when i check them. This ...
user avatar
  • 1
0 votes
1 answer
41 views

Class Drupal\dfm\EventSubscriber\DfmSubscriber not found when try to remove the Drupella File Manager

I installed the Drupella File Manager module for Drupal 8.8, but I have Drupal 8.7. I received this error. Call to undefined method Drupal\Core\File\FileSystem::scanDirectory() I don't need the ...
user avatar
  • 123
1 vote
0 answers
35 views

What is The Best Practice for Custom Plugin Files Placement

I'm going to create a custom plugin type, so I need to create a plugin manager, plugin base, plugin Interface and a plugin annotation, the annotations goes to ModuleRoot/src/Annotation but for the ...
user avatar
0 votes
0 answers
106 views

Skip_on_empty row method working, but entity still created

I am migrating a field in a node to a paragraph. I am trying to only create the paragraphs where the field has values. That field is an entity reference to another node. source: plugin: d7_node ...
user avatar
  • 169
1 vote
1 answer
74 views

How do I create a block in a module that can be referenced via an entity reference field?

I'd like to be able to reference my programmed block as a field in a paragraphs. I've Generated a module with drupal console - drupal generate:module Used the template for a block from the example ...
user avatar
  • 1,319
-1 votes
1 answer
115 views

Can't get annotated plugin discovery to fire

I've checked Debug plugin discovery and tried restarting Apache and setting $settings['class_loader_auto_detect'] = FALSE; in settings.php, with no change. I have a custom module. Setting a breakpoint ...
user avatar
1 vote
1 answer
56 views

How to remove non breaking space from body/value in migration process?

I am successfully migrating the content from Drupal 7 to Drupal 9. However, I am getting some extra non-breaking spaces I'd like to remove. I tried using a basic str_replace plugin, but that doesn't ...
user avatar
5 votes
2 answers
294 views

How can I let a plugin depend on another module?

Is it possible to let a plugin depend on a module (other than the declaring one)? Use case: I want to create a field widget plugin that should depend on the 'date_all_day' contrib module, but I don't ...
user avatar
  • 3,472
0 votes
0 answers
91 views

How to delete taxonomy terms created with entity_generate process plugin?

I have this json. { "ProductKey": "145.1", "Product": { "Title": "Product title", "StartDate": null, ...
user avatar
  • 2,699
0 votes
1 answer
68 views

File structure of libraries folder and detection of module external plugins

The module CKeditor anchor link require a CKEditor plugin. Can this plugin be placed in subfolder of the /libraries folder or does it have imperatively to be placed at the root of /libraries ? More ...
user avatar
  • 2,765
0 votes
1 answer
33 views

How to create a view filter plugin to filter a column created by a view field plugin

I have created a view field plugin to display an "internal status" for each node in a view. Those status are not stored in a table (and should not) because each status may vary depending the ...
user avatar
  • 554
0 votes
1 answer
195 views

why am i getting a Drupal\Component\Plugin\Exception\PluginNotFoundException: when the plugin does exist? [closed]

I wrote a custom source plugin and put it in migd8_node_blog/src/Plugin/migrate/source/Node.php with <?php /** * @file * Contains \Drupal\migd8_node_blog\Plugin\migrate\source\Node. */ ...
user avatar
  • 1
0 votes
1 answer
82 views

How To Set Order State Completed after Notification?

I am Writing a Payment Gateway(Onsite) Plugin For Commerce 2, I am Stuck with Checkout Flow Step Transitions. Let Me Explain: I am extending the OnsitePaymentGatewayBase and in the createPayment() ...
user avatar
0 votes
3 answers
220 views

Constraint on paragraph field not working

Here is a very simple code: 1-My constraint plugin (MyConstraint.php) /** * @Constraint( * id = "MyConstraint", * label = @Translation("Never Validated", context = "...
user avatar
  • 554
1 vote
1 answer
30 views

How to get instance of Module / Plugin / Widget of Vote Object in THEME_preprocess_node? [closed]

My drupal site is using the Fivestar Module or from the Vote Up Down Module. Multiple of my content types are using various implementations of these as fields (specifically comments and my primary ...
user avatar
  • 164
1 vote
1 answer
587 views

How can I implement paging for a custom query plugin which displays data from an external API?

Hi I have a requirement to display the data from external api but should not be imported into any entities. What I did is I have written a custom view query plugin which displays the data from ...
user avatar
  • 19
2 votes
1 answer
342 views

custom action plugin with ConfigurationForm

I am trying to create a custom action with Configuration Form Field . I am able to create Action and it is being displayed on content page ( /admin/content ) , but I am not able to find the path to ...
user avatar
0 votes
0 answers
96 views

How to place a plugin block to twig template without any contributed module?

I am using Drupal 8. Have created a custom module, added custom block "LskyTestVideo", created a new page template with its own controller ("LskyOpenTokTestController"). In ...
user avatar
1 vote
1 answer
86 views

Non-Config Menus

I have this requirement where I would need to create a menu every time a user creates a new instance of a custom entity I'm building. One can easily do this with Menu::create() on entity creation, but ...
user avatar
  • 1,134
2 votes
1 answer
849 views

Adding Constraint to entity referenced Paragraph field

I'm attempting to follow this documentation to add a custom constraint to a field in a Paragraph but I'm having trouble in adding constraint to that field. Currently I have book content type with ...
user avatar
1 vote
1 answer
515 views

Migrating content with referenced taxonomy field is to be migrated by term name

Is it possible to migrate content with term reference fields, but instead of referencing terms by their tid they are referenced by their term name? instead of this: field_tags: plugin: ...
user avatar
3 votes
1 answer
92 views

How can I determine which module is associated with a field plugin?

I'd like to implement an entity hook, and act on all fields defined by Computed Field FieldType plugins. So I either need a list of all FieldType plugins provided by the module or need to know which ...
user avatar
  • 1,931
0 votes
1 answer
196 views

Add custom orderBy in ViewsSort plugin

I'm attempting to sort the results of a View by matching one of the Entity IDs in the result set to the referring URL Entity ID. I'm trying to do this in a custom Views Sort plugin. I did some ...
user avatar
  • 195
2 votes
0 answers
234 views

migration using csv and yml for multivalued image field

some problem with sub-process plugin. Here are my yml and csv files. uuid: c0948690-b539-421e-b306-6a49d14afd64 langcode: en status: true dependencies: { } id: migration_multivalues class: null ...
user avatar
  • 21
1 vote
0 answers
52 views

How are custom classes auto-discovered and picked up?

I've been trying to get this sub module working for the better part of 8 hours, but I cannot get any debug/log statements to fire inside the sub module. Since its only 3 files, I copy pasted the code ...
user avatar
  • 195
0 votes
1 answer
131 views

How do plugins store their configuration/field data?

I'm creating a custom Commerce License and I notice that I'm handling defaultConfiguration(), buildConfigurationForm(), submitConfigurationForm(), and buildFieldDefinitions(), but I cannot figure out ...
user avatar
  • 1,761
0 votes
1 answer
58 views

Get the values of a checkbox field in node when evaluating in block condition plugin

I have a field that is a checkbox with multiple values... I'm trying to do an evaluation in a condition plugin where I'm checking against the checked values. For a boolean field, the syntax is: $value ...
user avatar
  • 441
0 votes
1 answer
432 views

Consume external API from custom block

I am currently writing a custom module - block plugin for Drupal 8 - How do i go about consuming/sending external API data and displaying them using blocks? Is this the standard way - consume/send ...
user avatar
  • 3
3 votes
2 answers
1k views

Restful permission is required

I've created a @RestResource plugin to provide a REST endpoint to get some data, but when I try a GET from Postman it shows this error: { "message": "The 'restful get ...
user avatar
1 vote
0 answers
57 views

How to test a custom filter on existing view?

I programmatically created a new (custom) filter for the user's view (admin/people). Code for the filter: hook_field_views_data_alter() Plugin > views > filter class The filter works ...
user avatar
0 votes
1 answer
44 views

Check access to existing plugin block

I have a programmatical plugin block defined in theme region. I need to check access to this block in my module hook. The following code creates a new instance, but I need to load an existing plugin ...
user avatar
  • 137

1
2 3 4 5