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

I can't setQuantity in a cart event

Hi everyone,

I have a problem with a setting that should occur in a cart event.

The process is as follows:

When you add a certain type of product, you can choose whether you want to take out cancellation insurance.

Once in the cart, if you delete the product, the insurance is automatically deleted (it works).

If we try to include more insurance than reserved products, the amount of insurance is automatically readjusted to the number of reserved products (it also works).

How to update a node translation programmatically

Hi team

I have an issue, I have a drupal site that has 4 languages (es, pt, en, fr)  and i would like to update a field from a node,

so how can i set a value for that field in every language?

I've tried with $node->set('field_items', $items_es);

But that just set for my default language,

Could you please help me?

Regards
Mario

modify contrib apigee_edge_teams module and how to make it as custom function

Hi, I need to add a new column in contributed module apigee_edge, so that team list can display team member name next to their email.

what I have changed: 
1. /project/docroot/modules/contrib/apigee_edge/modules/apigee_edge_teams/src/Controller/TeamMembersList.php
public function overview(TeamInterface $team) {
.......add a new table column here...
'name' => $this->t('Name'), 
}

Add different menu blocks to pages with similar url pattern

I have a menu block that is applied to pages with urls  /health and /health/*. On the same site I wanted to add a different menu block but has the same base url with a few more levels /health/something/somepage. Adding this as a block causes a conflict of course since we have the first one using /health/*.

Any suggestions on maybe adding the second block via hook saying apply it to pages with url pattern of /health/blah/blahhh?

We're on D9 and was trying to avoid installing a module to do this. 

FileRepository writedata() - large files

Hi, I have some large files (upto 1GB) that arrive via FTP, and these need adding to Drupal.

I had been using file_save_data and using a handle, but this code no longer seems to work after upgrading to 9.3.0. file_save_data() has also been deprecated, so I've updated my code to use writedata()

Term select values

Hi. Is it possible to output the text values rather than ID's of taxonomy terms in a terms select field?

So rather than;

<option value="106">AECC University College</option>

Output;

<option value="AECC University College">AECC University College</option>

Pages

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