Prevent redirect after submitting the form

Prevent redirect after submitting the form

In Drupal 7 profile2 module, want to make profile2 edit form to stay on the form itself after clicking SAVE button. With the following code, it stays on the form itself and displays the values correctly. But it does not save actually. When coming back to the form, it... read more
Prevent redirect after submitting the form

Alter label with token

I am trying to build a questionnaire that simply replaces (alters) the label of a list field. I am doing so by replacing a token from views (embed) and implementing hook_form_alter() in a separate module. How can I save that value and write it to the database? I am... read more
Prevent redirect after submitting the form

How to prevent other roles from publishing content

I am new to Drupal. I am working on a website where I have 2 user roles: Site admin and editor. The site admin has all permissions. I want the editor to only have the permission to edit content but not to publish or edit them. He can view his edited content but cannot... read more
Prevent redirect after submitting the form

Domain Access And Subfolders

This has indeed been asked somewhere but still no answer. Is there a way to have domain access provide links like example.com/site1 instead of side1.example.com Thank you read more
Prevent redirect after submitting the form

Passing arguments to a block

I am working on trying to understand the secrets of custom-developed blocks. Namely, I have a use case where a block need to pull content via EntityFieldQuery (this could be done with Views, but I like a challenge) and the contents loaded need to adjust based on a URL... read more
Prevent redirect after submitting the form

Loading a form from a form include file in a module

I have an external form that needs to be loaded inside a template file, used by a block. Right now, i’m a bit confused as to how to load this .inc. Looking at the API docs point to module_load_include() which I’ve tried with no luck (see example 1, from... read more
Prevent redirect after submitting the form

How to prevent Drupal export XML formatter adding paragraphs?

I’m exporting nodes as XML and with fields in most nodes set to “Plain text” format. Everything is fine when I’m editing them, but when exporting an extra paragraph (<p>) tag is added around text (using “Default” formatter).... read more
Prevent redirect after submitting the form

Unable to set file upload destination private when programmatically creating new content type with file field

I am creating a module to upload video to an in house media converter – as part of the module installation I create a new content type called “user video” which has a file field as part of it. I need to set this file field so it saves to the private... read more
Prevent redirect after submitting the form

Can’t login: user/login redirects to index page

My Drupal 7 user, user login and admin pages all redirect to the index page. I am unable to login at all. This problem came up recently after the site had been unchanged for months. I can’t think of a single reason this started happening all of a sudden.... read more
Prevent redirect after submitting the form

Firing a Ctools Modal on a link click

Once again, I am stuck asking questions on CTools that people have asked a million times before. I have a view that displays a list of custom-developed entities (built with ECK) and each one has a link that should show a Ctools-driven modal. I looked at a few... read more
Prevent redirect after submitting the form

form_set_error() redirects to raw ajax response page

I have a page with a simple view. Above the view there is a menu link that when clicked loads a node form with a required file field. The form is fetched and loaded using ajax_commands into a div on the current page. The problem is when I submit the form without... read more
Prevent redirect after submitting the form

How to add another condition to a specific active facet?

I did try to add a condition using hook_views_pre_execute or hook_views_query_alter, but since Im usiong SearchAPI, theres is no point apparently in using these functions (no $query in views_query_alter, and no query too in views_pre_execute Maybe using... read more
Prevent redirect after submitting the form

Arrange formatted fields in Views row using a template

I want to render the rows of my “Recent content” Views page using a template in order to subdivide the rows into multiple divs, freely move around the rendered fields within these divs, and apply some custom PHP where needed. Idea A (fails): I could achieve this by... read more
Prevent redirect after submitting the form

how to dynamically set query parameter on menu item

Hello I am a very experienced web dev who is brand new to Drupal and learning to build my first site in it. I have a very simple site I am converting from pure code (html, css, jquery, angular, bootstrap, php) to drupal so that I can add a CMS backend to the site. On... read more
Prevent redirect after submitting the form

URL paths in optimized CSS sometimes are https instead of http

The expanded URLs inside my optimized CSS files are sometimes getting generated with https instead of http. This appears to happen randomly. Doing a cache clear, recreates the optimized CSS and usually the URLS are correctly expanded using http. The source CSS files... read more
Prevent redirect after submitting the form

Use computed fields as Apache solr facets

Today I wanted to add a computed field to my facet to make a faceted search using that field but when checking the facets page that field wasn’t in the allowed field to make facets. When i realized none of my computed fields was in that list i came to the... read more
Set value for start/end date field labels in hook_form_alter

Set value for start/end date field labels in hook_form_alter

how can I replace the labels of start/end date for a date field via form_alter? the code below only works for the fieldset. The “to” needs to be removed. $form[‘field_my_dates’][‘und’][‘0’][‘#title’] =... read more
Prevent redirect after submitting the form

Simplenews + Mime Mail + SMTP = occasional blank email

I have a client site that uses the Simplenews module with the Mime Mail and SMTP Authentication modules. The subscriber list has a little over 300 email addresses, and when newsletters go out the cron sends out batches of 100 messages per hour. Things usually go off... read more
Some fields are not sorting properly in view

Some fields are not sorting properly in view

I’m trying to create a directory list in view. But some of the fields are not properly sorting. See the below image for my view configuration. And the output of the view. Update: Style setting Update: Field Settings Grouping Please anyone help me to get the... read more
Prevent redirect after submitting the form

How to change the markup for a field

I’d like to change the output from the field formatter view from the Field API. I’d like a cleaner markup without unnecessary tags. What’s the best way to clean up field formatter view output? Many thanks. Ideally to change from this: <div... read more