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

Undefined variable: base_url

 Undefined variable: base_url in WesiteURL_page_alter() (line 182 of /home/kratomus/public_html/sites/all/themes/WebsiteURL_new/template.php).

How can I solved this . Every time a user needs to checkout , they get a server error message saying can not communicate with server .

Any help is appreciated .

uc_greenmoney

01/19/2022 - 09:47

How to display unique nodes for a page?

The scenario is like this: we have a news website, every page display different type of news nodes. We have to set the site in this way that, for a single page, no news node should be duplicate while displaying.

Entity reference in form_alter

In a content type I have an entity reference with an autocomplete field
I need to get the ID of the entity refrerence field inside the form_alter, in modification of the node.
Through the callBack I use this code and I get the ID to be able to upload

$nid = $form_state->getValue('field_richiedente')[0]['target_id'] ;
$node = \Drupal::entityTypeManager()->getStorage('node')->load($nid);

and everything is fine

In form_alter when I modify the node I cannot use the $form_state and I use $form[]

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'), 
}

Pages

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