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

Create Commerce product with image

Hi, I am trying create product with images. All is done but, I cannot connect image with product.

Inline Entity Form manual AJAX to update the referenced target_id

We have a node with a single value field that uses Inline Entity Form Simple form widget. This works well for us and we do pre-populate that field in the xxxx-edit-form form_alter. So we just load the node we want to default to and assign it to the the ief widget like this:

$form['field_xxxx']['widget'][0]['inline_entity_form']['#default_value'] = $default_entity;

This works well and the edit form shows the defaulted entity in the ief reference field.

Unit Test - creation of an (own) entity with different privilegies

Hi

Im new to Unit Testing in Drupal.
I have an own (very complex) Entity witch I want to Unit test. But no idea how to start.

I want to test the creation and modification of the entity with different users becuase of there different privileges.

But how to start? Moking everything or ceating the real entity ...

Can you give me some hints or maybe lead me to some examples.
I already tried to search in the Drupal Code to find something similar ...

Thanks
 

Editable fields still needed?

Many moons ago - too many - I created editable fields. 
I was expecting not to need it in Drupal 9. 

It still, to me, feels like fundamental functionality, to be able to 'display' either the editable, or the rendered version of a field ?

Am I missing something?

Cheers
Mark.

INTERFACE between AllWebMenus [version 5.3.940] and DRUPAL 9.1

1.     The AllWebMenus Add-in
This already exists inside my AllWebMenus installation.

2.     I cannot Install The Likno JavaScript/CSS Menus Module [allwebmenus-drupal7-menu-module.zip]
on my computer.

I uploaded the entire likno_menus folder to the modules directory.
An upload result of uploading is the message “Failed to get available update data for one project.“

callBack Ajax

I have a boolean field to update through a callBack (called from another field) but it doesn't work. The text and numeric fields work but the Boolean field does not
This is the code in form_alter

          $form['field_richiedente']['widget']['#ajax'] = [
            'event'           => 'change',
            'disable-refocus' => FALSE,
            'callback'        => 'CBRich',
          ];

#id of the boolean field
$form['field_sede']['widget']['value']['#attributes'] = ['id' => ['vis-sede']];

callback code

Pages

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