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

Multiple submit buttons in webform

I have created to submit buttons for webform ( save changes and unsubscribe ) , I need to create two different submit handlers to call API for these buttons .. but how can I call different submit handlers in hook form alter 

My 2 submit handlers have keys actions and actions_01 so I called: 

$form['actions']['submit']['#submit'][] = 'update_subscriber';

$form['actions_01']['submit']['#submit'][] = 'unsubscribe_handler';

but on both button submit 1st handler is called 

bncreports_form_user_register_form_alter

array_unshift($form['#validate'], 'bncreports_user_register_form_validate');
array_unshift($form['#submit'], 'bncreports_user_register_form_submit');

I have the above in my bncreports_form_user_register_form_alter function. The validation works but the submit does not. Nothing gets executed. Anyone know why this could happen?

DIFF MODULE

Hi everyone,

i want to ask you something, is diff module available for drupal version 9.3.16? i cant find a way to extend the funcionality of my site with this module!

Thank you in advance!

This version is not compatible with Drupal 9.3.16 and should be replaced

I've created a new custom module and placed it in a clean D9 app which only runs additionally the examples modules.

Drush will not install this module so I stripped out everything but the info.yml and a bare .module file. That's my understanding of the minimum needed for a Drupal custom module.

I've read many sources on what the module.info.yml should say in a d9 paradigm.

Callback in entity autocomplete

Hi in a cell of the table field I have an enityt reference field with autocomplete widget
With this code, I define the field and call the entity_reference view for the list with the nodes and everything works fine

JSON:API hook not called

I have spent several days on that one. We have several nodes on our website which needs to be public, but not exposed by the JSON:API. I have created a module which call some JSON:API hook to filter out nodes, but none of those hooks are working.

For the purpose of this example, lets say my module is called "mymodule".

I have created the file "mymodule.module".

I have implemented the "hook_theme" and it works: "mymodule_theme()". So I know my module file is in used.

Pages

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