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

set Focus in form_alter

Is it possible to focus on a specific field in form_alter?
I saw that there is a module that does this but I would like to understand how to do it programmatically in form_alter

Whats the earliest point a drupal site can detect if a visitor has visited site before?


I am trying to redirect visitors if it is their first time on site.

I beleive in drupal 7, this could be done on itialization using init().

Im using a gated content module to check with cookies if a user has already visited the site before. But this uses JS and is executed once dom is fully loaded.

Im trying to find a way to detect at the earliest point. Before any content is load if possible.

What sort of function should I be looking at?

I know is a generic question but just looking for a starting point. Thanks

How can I fetch specific record from database table through PHP?

Hello there,

I need some help related to php. I have connected my DB with frontend web application through PHP. But I have a little bit problem with it. I want to fetch specific record from the database. Can anyone guide me how can I do it. I will appreciate your suggestions.

Thanks in advance.

Regards: [ link spam redacted]

Devel Module

What's going on with the Devel module? I frequently get the following: (In this case I was executing dpm($variables); in a theme_preprocess_menu function but this happens in other situations too.)

The website encountered an unexpected error. Please try again later.
Error: Class "Doctrine\Common\Util\Debug" not found in Drupal\devel\Plugin\Devel\Dumper\DoctrineDebug->export() (line 25 of modules/contrib/devel/src/Plugin/Devel/Dumper/DoctrineDebug.php). 

Efficient way to get entities related data


I'm quite new in Drupal environment, sorry beforehand in case I'm asking something obviuos.

I have the scenary where I need to get some info from related entities. What I have seen so far is to construct an array of nodes id and then getting the specific fields. In some cases that is not really efficient.

Is this the only way to do it? Is there any way to "Query join entities getting field values"?.

Scenario example:

Entity1     Entity2    Entitiy3

E1Field1   E2Field1  E3Field1

E1Field2   E2Field2  E3Field2

Pager element not showing on form

I have a simple tableselect element inside my form and the tableselect rows are populated using a pager as follows:


Subscribe with RSS Subscribe to RSS - Module Development and Code Questions