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

Link to file missing in drupal 9

I have spun up a new drupal site 9 and the link to file option is missing on the edit screen. I have a link option but only to a URL. Can you please let me know what is missing from my drupal install to link to a local pdf file?

Thank you

Getting error while adding/rearranging sort in Views. Drupal\Core\TempStore\TempStoreException: Couldn't acquire lock to update

I am trying to add/rearrange a sort criterion in view in drupal 8.x, but getting error Drupal\Core\TempStore\TempStoreException: Couldn't acquire lock to update item 'search' in 'tempstore.shared.views' temporary storage.  

Is there anyone who can help in this regard. Thanks in advance!

Unit Tests - Class to be tested not found

Hello,
I am trying to understand Unit testing (Drupal 9). To this purpose I am going through the pertinent chapter of Daniel Sipos' book "Module Development". Somehow class Calculator is not recognised. Here comes a code snippet of both CalculatorTestClass and Class Calculator (to be tested).
(1) from file ~/drupalroot/web/modules/custom/hello_world/src/Calculator.php

Required field state not working

Hello, new with Drupal, doing my first project on it. I'll try to be as short as possible.

I have a form field, type file, which by default is required. And i want this state to change based on another field's state. More precisely, a checkbox type field. You can see the problem in this image (follow the links for the images, sorry but i didn't manage to understand how to embed an image on this forum):

https://ibb.co/zNfG7yP

How to call a function of a contributed module in my custom module

I want to use the return value of a function used inside another, contributed module – but i don't know how to get there ... :-(

Query, multivalued field in condition

I need to filter some data in bae to a multivare Entity reference field.
If I have to filter an entity reference field for a multivalue I have understood how to do it but I have not understood how to do the opposite.
The field is an entity reference field_categoria, multivalued entity reference, I tried various possibilities but none of them work for me

Pages

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