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

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

Git (Gitolite) module. Help me configure the module

Good afternoon, colleagues. We use the git module on the site (drupal 7) (previously it was called Gitolite, https://www.drupal.org/project/gitolite). The question arose 1) Where to register a private key so that the module can sync with the git server? Where is it stored? 2) now we use drupal6 and the gitolite module. by the cron, we call "drush gitolite". Authorization gitolite occurs at the key of the user from which you run drush.

Time field

In a Content Type I need 2 fields now.
In a 3 field I must have the difference between the time of arrival and that of departure.
In order not to install a new module, I would prefer to use the DateTime field but as far as I could see the date field I cannot hide it.
Any suggestions?

Pages

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