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

How to enable autocomple draggable for fields

Hi team

I'm having a issue, i've created a content type in my local machine and i can create a autocomplete draggable field
field with autocomplete draggable

but when i tried to create the same content type in production site i dont have that option
field without autocomplete draggable

am i missing something?, or i need to install some module?

Could you please help me?

Regards
Mario

How to create table with module installation and integrate with existing data

As the title suggests - I Want to create a table when the module is installed. The Drupal way to do this is to create a .install file, which is Drupal 7 way. 

1. Is there any Drupal 9+ way to do the same i.e. creating a table with module installation. 

2. Another thing is ~ how to integrate with existing data. If the module is uninstalled accidentally, I want to disable or keep the uninstalltion function blank or any other way to keep the data in the database when the module uninstalled accidentally. 

Invoke a callBack from another callBack

In a form I have various fields and in several of these (fields) I have inserted callBacks to perform calculations.
Eg all subsequent fields have their own callBack:
Field 1 callBack 1
Field 2 callBack 2
Field 3 callBack 3
In sequence everything is fine. The problem arises when after typing the data in field 3 I return to field 1 to update a value. Since the value of field 1 is used in the calculation of the callBack of field 3, I am obliged to update the value of field 3 to have the calculation done again.

Cache API call during Form API

I'm updating a D7 form for D8 and it makes a query to a public API for entities that could become Drupal nodes. Its performance is spotty, likely because as I see the Form API lifecycle that the form gets rebuilt as part of its security against hacks. And it seems to me that the re-run of the queries fail because of this.

Since the form is cached, could I cache the results of the first time the query is run so as to prevent timeout by the public API? Here's a subset of the form that is applicable.

How to add condition to view using views_query_alter

Hi team

i would like to add a 'AND' condition to my view query, i've created a hook with views_query_alter, something like this:
 

How to remove condition view using views_query_alter

Hi team

I've created a json rest api with views but i need to show items when its published, unpublished and all content, so when i use status = 1 show me published, status = 0 show me unpublished, but when i use status = All i need to show all content, but just this is not working, so i decided to use views_query_alter to change that, and delete this condition, but is not working.

This is how i'm using this hook:

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions