0

I use the goalgorilla/open_social profile which brings in open social with its various modules. Inside its social_user.module there is a standard hook_form_FORM_ID_alter implementation which I temporarily edit and prepend echo 'social';. I also have a custom module my_custom_module with the same hook_form_FORM_ID_alter implementation which simply contains echo 'custom';.

My problem is that no matter what, I cannot get my custom module's echo to run after the open social's one. The higher weight of my custom module does not seem to affect anything. So far I've done the following:

  1. module_set_weight('my_custom_module', 9999);
  2. Confirmed in core.extension.yml that:
social: 0
social_user: 0
my_custom_module: 9999
  1. Installed https://www.drupal.org/project/modules_weight and confirmed the expected weights at admin/config/system/modules-weight.

Where should I look at next?

7

2 Answers 2

1

You might want to read this issue. Didn't read it because there are most times better solutions by adding a callback to the form build which gets executed at the right time: #process, #after_build or #pre_render.

0

I faced the similar issue recently and figured out that some modules (like Field Group in my case) uses hook_module_implements_alter to change the order of execution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.