Redirect after user creation via form

Redirect after user creation via form

What would be the proper hook to redirect after the user registration form is submitted and is in valid state? I’m trying to automatically create a certain content-type node when a user registers and I want to redirect the user to that node’s edit form... read more
Redirect after user creation via form

Programmatically change the available options in a views exposed filter

I have an existing view in which I want to change the available options in a view exposed filter. I can’t manipulate the form because the modifications are dependant on other views data, so I thought I could use a view hook: function... read more
Redirect after user creation via form

Pseudo field show/hide setting per node

I have created a pseudo field using hook_entity_extra_field_info() and displaying markup using hook_entity_view(). How can I create a checkbox setting in node create form so that I can show / hide this pseudo field per node? read more
Redirect after user creation via form

How do I validate the term title in hook_taxonomy_term_presave()?

How do I validate the term title in hook_taxonomy_term_presave()? Is there a way to proceed with the validations in hook_taxonomy_term_presave()? @Edit I rendered taxonomy add term form via “Inline Entity Form” module and here form_alter fails when it... read more
Redirect after user creation via form

How do you join a custom table to a node from a field with hook_views_data()

I have a custom table that contains (for simplicity) two fields: id client_id On my node content type, I have an integer type field called: field_dashboard_id. All my nodes have the field_dashboard_id set to ids from the custom table. I have a content view that I... read more
Redirect after user creation via form

In a template, is it possible to get the content of a block by the block ID?

I am working with some view templates in Drupal 8, and I have the block ID of another view block I want to pull into the template. Is it possible to use the block ID to get the content of a block in a template? If this is not possible in Twig, how could I achieve this... read more
Redirect after user creation via form

Print password confirm field in user register template file

I’m trying to theme the user registration form in Drupal 8. I have defined a custom template for user registration form and printing the fields with the following code. {{ form.field_profile_title }} {{ form.field_profile_first_name }} {{ form.account.mail }}... read more
Populating select list from a taxonomy term field

Populating select list from a taxonomy term field

I’m trying to populate a select list dynamically by pulling its values from a taxonomy term field linked to the current-user account. Just to clarify, below function is a hook defined by a module that came with a custom installation profile. It is basically used... read more
Redirect after user creation via form

How can I get additional fields from Search API query?

I have Search API DB backend where I will be retrieving thousands of results and I need some fields to get out of there as well, beside search item id, since doing additional query to MySQL with IN condition consisting of thousands of entries is nonsense. Can’t... read more
Redirect after user creation via form

Allow role to edit node with same taxonomy term

I would like to allow a user to edit some node that have the same taxonomy term. I created a taxonomy for enterprise and I referenced it in a field of user profile. I used this taxonomy in a content type too. I wonder if it’s possible to allow users to edit only... read more
Redirect after user creation via form

Get path from router and redirect after autocomplete selection

I have a form that is inflated inside a box. In that form I have an autocomplete field. I want to allow the user, when they select an item from the autocomplete’s suggestions they are automatically redirected to the appropriate page. My current idea is to handle... read more
Redirect after user creation via form

Alter existing routes doesn’t work

I’m working on a D8 project trying to add custom access rules to some pages. I want to restrict access to specific users based on their id. I checked this and seems easy but I can’t make it work! I want to change the access for the route... read more
Redirect after user creation via form

How update programmatically node entity with empty field_image?

i need to make an import from one mysql table in my base. I create node with : $value= array( ‘type’ => strtolower($typeProduit), ‘field_1’=>”test”, ‘title’=>”test”, ‘body’ => array(... read more
Redirect after user creation via form

How do I show an Open/Save file dialog using an AJAX callback?

In the form builder I have the following code. $form[‘export_to_pdf’] = [ ‘#type’ => ‘submit’, ‘#value’ => $this->t(‘Pdf Format’), ‘#attributes’ =>... read more
Redirect after user creation via form

How to test any features that require authentication?

I am just getting started with BeHat and I’m able to successfully run tests that do not require authentication. But, anything that requires authentication is failing. STATEMENT (or any logged in statement) Fails with ERROR MESSAGE . But, if I add... read more
Redirect after user creation via form

Custom entity datetime field in calendar

I created an entity in a module, using code. I generated skeletons with drupal console generate:entity:content (without bundles), and then added a datetime field to my TestFieldEntityItem.php, in baseFieldDefinitions(). $fields[‘test_date’] =... read more
Redirect after user creation via form

Form submission in modal is throwing an error

I have a Form which on submit calls another form via ajax and embeds it into a modal popup (Drupal8 standard) and when I click on submit of that modal form , I get a Drupal ajax error (I think it’s due to the fact that ajax tries to find the from on the wrong... read more
Redirect after user creation via form

How do I bulk delete taxonomy terms?

I’m looking for a way to delete about 1300 taxonomy terms (of 5250 in total) and their association with nodes. I firstly thought to delete the content of these tables: taxonomy_index taxonomy_term_data taxonomy_ter_field_data taxonomy_term_hierarchy... read more
Redirect after user creation via form

Front page returns 403 for unauthorized users

I’m trying to get a D7 staging site’s git repo up-to-date with its production server repo. In other words, I changed A LOT of stuff on staging (by running git fetch <branch> && git reset –hard). Now the site is up-t-date and works... read more
Redirect after user creation via form

Tell taxonomy links to use route in custom module

I have a module where I created a route /page/tag/{term} that uses a controller for modifications to how the term page is handled. The problem is that when any page displays these term links, they don’t use the custom route, but the default /taxonomy/term/{id}.... read more