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

File permissions issue in public:// and private:// folders

My module needs to read and write files in the public:// and private:// folders. In the installation procedure I create the folders and files that do not exist, using the functions \Drupal::service('file_system')->prepareDirectory() and copy ().

[Solved] Unable to remove route from configuration

At one point in time I added this to mymodule.routing.yml:

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.

Pages

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