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

Remove form display of a BaseFieldDefinition

Hello everyone,

Few weeks ago, I created a BaseField during a hook_update, like this :

Database query MAX(id)

Thank you for reading this topic.

I'm trying to run a query using the database api:

https://www.drupal.org/docs/8/api/database-api/dynamic-queries/introduction-to-dynamic-queries

The query is:

$get_key = $this->connection->query("SELECT * FROM tablekeys WHERE id IN ( SELECT MAX(id) FROM tablekeys WHERE key = 'System' GROUP BY ip) ORDER BY id DESC");

The query returns my desired results.

Media upload, get node data of attached node

I have played around with some custom tokens, see code above. I want to document that for https://www.drupal.org/project/filefield_paths 

The problem i have is that i can not get any node data like $nid or the node object of the node the media file is beeing attached to.

It is a node with an entity reference(media) and i wanted to create a custom token using taxonmy terms of that node. But that is impossible if i can not get any node data to process.

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
 

Pages

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