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.
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.
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.
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.