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

THIS FORUM IS NOT FOR "What module..." or module support questions-- it's for module development and code related questions.

The module development and code questions forum is intended to aid those who are developing modules or writing code for Drupal.

Please note that this forum is also not intended for "Is there a module that does..." or "I need help with module x..." questions. It's also not a place to ask developers to write your code for you. Please respect this.

Please do not post general discussions intended to target module developers. If the question you have isn't specifically related to writing a drupal module, please post it in a more appropriate forum.

  • If you you have drupal installed already and are seeking a module that does a specific task, have a question about a specific module and what it does or if it will fit your use case, please place your questions in the Post installation forum.
  • If you have a problem or question about a specific module, you should create an issue in the module's issue queue (after checking for an existing issue first).
  • If you don't have drupal installed yet, please place your questions in the Before you start forum.

When use entity ? (D8)

Let's look two modules: voting_api and dblog from core. Voting_api uses entity for storage and manage votes. In other words each vote is entity. Dblog module does query in db and each log message simple row in db table. But each log message possible considered as entity. Why ? How do I determine when use entity ?

Custom Field Type: Enable second textbox

Hi All,

I'm developing a module with a custom field type that allows the user to insert a zip code and then select the city (Yes, I live in a country where several cities can use the same zipcode).

What I have already is:
- FieldType, FieldWidget and FieldFormatter
- ZipAutoCompleteFormatter

I can type a zipcode and then the autocomplete works as expected and I can pick a zipcode.

Now I want to able to fill the select with only the possible cities, when the I picked my zip code.

My Widget looks like this:

Getting X-Frame-Options issues, but with an AJAX file

Hi all,

Full disclosure: I an new to Drupal and am really struggling to get my head around it, so please keep that in mind if answering.

I'm setting up a site on my local dev box. I have to set up a module here, which I have mostly done, but I am getting an error when I trigger the module's AJAX functions:

[Solved] How to hook into Commerce after payment complete

I need to be able to run code that does not output any data to the user after a user's checkout is complete, but I can't seem to figure out how Commerce wants me to do it. I don't see any *.api.php files that would give me payment hooks. It looks like Commerce wants me to create a separate Checkout Flow plugin that would add the step I want, but I can't seem to find documentation about implementing my own Checkout Flow.

Can you guide me to the right path of running my code when the checkout is complete? Am I on the right path? Can you point to Checkout Flow development docs?

I can't remove #theme_wrappers functions from $variables in hook_preprocess_HOOK

Hi! I want to remove fieldset wrapper around radios element in my custom form. For this I use hook_preprocess_HOOK:

function mymodule_preprocess_radios(&$variables) {
  $variables['element']['#theme_wrappers'] = [];
}

But fieldset wrapper all the same remains in output html on page.
How to remove fieldset tag ?

Pages

Subscribe with RSS Subscribe to RSS - Module Development and Code Questions