Hot answers tagged

3

$form['#validate'] will not work as that form "This form works by submitting the hash and timestamp to the user.reset" aka redirects you to the user.reset from what you can do is something like temp replace this form with a custom one though. however i don't really see the point /** * Implements hook_form_alter(). */ function yourmodule_form_alter(&...


2

You should use hook_node_presave if you want to change a field's value as the hook is invoked from node_save() before the node is saved to the database. And as leymannx stated, make sure you clear the cache before implementing a new hook.


1

You can attach custom tags to any render array from where it bubbles up into the HTML head. In the following sample I'm adding structured data when a certain block is viewed. $value then contains what's being printed between the opening and closing script tag. /** * Implements hook_block_view_BASE_BLOCK_ID_alter(). */ function ...


1

You can't do that, at least with standard Drupal setup. Probably you can code a hack that allows it, but is not how Drupal is designed. Besides this, you can use current role system to achieve what you want. You only need to add more roles. You want edit own articles, view own articles and delete own articles to be independent. You can define 3 roles, and ...


1

You miss ] in the selector ':input[name="field_type[und]"' code test with the following it will work. ':input[name="field_type[und]"]' => ['value' => 'interne'], Update: The state work with any valid JQuery selector, so if you looking to target it with select selector instead of :input you can use this: 'select[name="field_type[und]"]' => ['...


Only top voted, non community-wiki answers of a minimum length are eligible