This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How to update type of field created with ContentEntityBase

In FillPDF, class FillPdfFormField extends ContentEntityBase. The method ::baseFieldDefinitions() uses BaseFieldDefinition::create() to create a bunch of fields. I need to write an update hook to change one of these from type string to string_long.

What is going on with this code?

I am trying to figure out why something weird is happening. I have the following in my_module.routing.yml:

my_module.test:
  path: '/my-module/test'
  defaults:
    _controller: '\Drupal\my_module\Controller\TestController::view'
    _title_callback: '\Drupal\my_module\Controller\TestController::getTitle'
  requirements:
    _permission: 'access content'

My Controller class is this:

Is it always necessary to do a dependency injection for a service within a class

Hey, there!

Is it always necessary to do a dependency injection for a service within a class if we will only use that service once inside the class? According to the Drupal documentation, is that recommended, but for practical purposes, is that useful?

drupal8 cron job and queue

 I have custom table having thousands of rows. I want to send the emails to the users by fetching the data from rows at specific time.
i am using Cron job but issue is this ---- timeout issue occurs. As fetching the thousands of rows and manipulate the data takes too much time. Can any one help me ? is there any way to use queue with cron.
thanks ..
 

Problems with ajax-addmore example and required field.

Playing around with forms and ajax but ran into problems. When I add a form element before the ones that should be added dynamically it's stops working if the element is required.  I thought I could solve it by skipping required and validate instead but it gave the same result (and I do like to have the red star :-).

I'm to much of a rookie in Drupal 8/9 to have any clue on how to solve this so I really hope there is someone with a solution.

Im running Drupal 8.9.0.

move a form element

Hello,

 Possibility to move an element of a form before another element thanks to the module create personally.

 Cordially.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions