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

Custom sorting using a MySQL statement instead of simple field

I'm using a view to list products from db index. I want to implement a custom sorting (my goal is to sort by current taxonomy term page, products having a specific node field field_MY_FIELD_NAME = CURRENT_TID, showing up first)

First using hook_views_data_alter I override the sort of an indexed field that I have chosen as a sort criteria inside the view

Need to clear cache for functions to be called more than once

First Drupal 9 site and custom module. I am having to constantly clear the cache for my module functions to be called more than once. Where might I look to disable all caching - or what might I be doing incorrectly that my path is not triggering my _controller functions more than once without clearing the cache?

Developing first module in D9 is failing

Hello,

I am developing a first module in D9 and it is failing. 

xampp folder structure:

https://ibb.co/LC2TQQy

Module directory:

https://ibb.co/7kkZgZP

https://ibb.co/FBndcTB

Controller directory:

C:\new-xampp\htdocs\drupal-9.0.0\modules\custom\hello\src\Controller\HelloController.php

hello.info.yml:

Installing multiple patches on multiple modules

Hi there,

I found codes for installing a patch with composer like that:

{
  "patches": {
  "drupal/h5p": {
      "trying_access_array_h5p_3199600": "https://www.drupal.org/files/issues/2022-07-04/trying_access_array_h5p_3199600.patch"
    }
  }
}

How can I add another patch for another module. I would like to add the patch from https://www.drupal.org/project/exif/issues/3172682 as well. Is it only possible to add patches for one module?

Ajax callback not working on form elements that previously were rendered by another ajax call

I have a form with one input which asks the user to select 'entity_id' which is populated via entity reference and on selection it updates the work_email field for the user as part of ajaxcall updateNameFields.Intially the form is created as a table container with 5 rows and two columns 'entity_id' and 'work_email'.Form has a button to add new item/rows using another ajax call updateNames.This works good too.Problem is the ajax call (updateNameFields) on the newly added row is not getting called .

I am new to Ajax and looking for any input which would help to fix this issue.

CKEditor 5 fails on custom module

I made a small custom module to add my own Amazon link filter. I can't get CKEditor 5 to install without this error:

CKEditor 5 only works with HTML-based text formats. The "AmazonLink Filter" (filter_amazonlink) filter implies this text format is not HTML anymore.

I found several discussions but none seemed to help my problem. The filter worked perfectly  on CKEditor 4. Here is my FilterAmazonlink.php

Pages

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