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

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:

Xdebug and phpStorm

In the course of trying to debug an issue in module printable (see issue queue!) I installed Xdebug and phpStorm. I am on Drupal 9.1.6, PHP 7.4.16 and Debian 10. My /etc/php/7.4/fpm/php.ini contains the following - regarding this: 

[xdebug]
zend_extension="/usr/lib/php/20200930/xdebug.so"
xdebug.log="/var/log/xdebug/log"
xdebug.mode=debug
xdebug.client_host=10.0.0.2

When trying to start debugging I get the message

Files in some folders are renamed the add "._sa.zip"

Hi there, I'm not very surpried by this problem, but it seems that there is a prozess which renamed files (for example in the libraries or main folder) with the extension "._sa.zip". Actually it is enough to rename them by deleting this appendix. 

The files seem not really been zipped.

Of course this behavior brakes some parts of my Drupal installation. I'm using Drupal 8.9.13. Because I couldn't find this problem somewhere else, I have to ask here...

Where I am doing wrong in this module example

I am testing to create a compound field, but I can not make a field. The field shows, but can not be created. 

Folder strcture: 

Pages

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