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

file .module in my custom module

Someone could explain me what is the function of the .module file in a custum module?

Thanks!!!

External menu link access control

Hello,

is there a best practice for implementing access checks of menu links that link to external URLs?

Jsonapi patch and revision not updated, presave hooks not working

Hi all.

When updating a bundle from jsonapi (patch) the revision of the entity is not updated.

I am trying to create a hook in order to somehow force the increment of the revision id by 1, but with no luck.

E.g. the jsonapi patch does not comes through 'presave' hook (if i am not wrong).

Do you have any ideas on how i can manage this?

Thank you in advance.

Adding other types for bookExport?

In the book module it's possible to export a book to various formats. In Drupal 9 (and I guess 8) this is done through BookController::bookExport($type, NodeInterface $node) which requests the contents of the book from the method BookExport::bookExport{$type}($node), where $type and $node are passed from the URL.

Commerce Postal Code Filter module in Drupal 8 version.

Hi,

I need Commerce Postal Code Filter module in Drupal 8 version.
my issue when user fill specific postal code then only shipping pf product are available.
example: country: India, state: Maharashtra, city: Mumbai, postal code: 400060 then if user type postal code: 400069 then shipping are not available.

list of postal code available:

400060

400001

400002

400056

apart from this postal code then shipping are not available for Product.

Syntax error with custom sort in mysql query

Hi,

I am trying to make a custom sort in my query like the following:

$available_sources_text = db_query("SELECT * FROM `heritage_source_info`WHERE text_id = :textid AND format = :format ORDER BY FIELD(type,'moolam','translation','commentary')", [':textid' => $textid, ':format' => 'text'])->fetchAll();
 

This throws a syntax error. Please let me know what is the correct syntax for ordering?

Thanks

Pages

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