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

I need to insert a field when creating a content-type for testing on phpunit

I have this content being created and I need a simple text field inside of it, so when I run the testing method it goes to the node/add/mytest and find the change that the module makes on the label of the submit button.

the tests are passing, but I dont know how to insert a any field via 'drupalCreateContentType()'

$this->drupalCreateContentType([

'type' => 'testing','name' => 'mytest',]);

Error when I try to migrate from D6 to D9.

Hello, I'm trying to move a really easy site from 6 to 9, the problem is that I get this error:

Question about paage content rendering with Twig

Hello,

this is probably a stupid question but after several searches I did not find how to display with Twig the content of a node with a personalized display:

{{ page.content }} : Twig code for default display
node.mydisplay : machine name of my personalized display

What is the corresponding Twig code to display page.content with "mydisplay" ?

Thanks a lot !

Add simple php form to Drupal

Hello, 

I have created a php form for a client. They want to implement this in their Drupal 9 website - it's a form that looks up some values in the database and returns some results. The form code has input fields and a submit button. On submit, the form runs a query based on the submitted values and returns some results. I can supply code if necessary but this is not the problem.

How should I go about this in Drupal 9?

Drupal open link in new window

Hi, I have a view with a button to call up a module. I would like the recall of this module to take place in a new window that overlaps the current one and with different sizes
I tried this code, but it opens the ion module a new tabe and resizes the window
 

<a href="/giorni" class="button"  target="_blank" resizable=0, width=300, height=200 > GIORNI  </a>

Temporarily close and open default db connection in Drupal

I'm trying to force Drupal to close it's default db connection and then open it again for certain long running processes (downloads for instance). The problem is that we want to have wait_timeout set to a fairly low value in mysql to make use of resources and close the connection while doing larger downloads or other long running processes that doesn't need database.

Pages

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