Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [entities]

Nodes, comments, taxonomy terms, and users, using the terminology used since Drupal 7, are generally called "entities."

0
votes
0answers
22 views

View/display mode for entities [on hold]

Drupal 8 Core Media, Paragraphs and Display Suite. Create a media type with different view modes. Media is available in my Paragraphs and on the node level. With Display Suite View Mode I have access ...
0
votes
0answers
11 views

Adding menu of entity referenced links on a content-type page

I have this problem: I created content type named "DramaVoice" and "dramavoice" role. An user with this role can edit his own Dramavoice page, adding some demos and articles. I used entity reference ...
0
votes
2answers
79 views
+100

Adding field collections programmatically

I'm trying to add a field collection to my user account on an event, and it seems to be being created properly, the fields are updated as expected and it parents it to the user account, however, even ...
0
votes
0answers
33 views

Grandchild Pathauto from Nodes

I have a node that has a parent_field (entity reference) that if left empty, that node is a parent. If parent_field has data (ie the nodes parent node name) then I can easily add pathauto in there ...
0
votes
0answers
13 views

Is it possible to delete or disable a set of entities via Migration plugin

Currently I have migrated a few taxonomy vocabulary entities whose source type is URL. These are migrated based on a flag. The flag value can change from time to time. The possible values are new/add/...
-1
votes
0answers
20 views

Many-to-one relationship [closed]

I am using the JSON Api to get content for my decoupled web app. I have content-types Pages and Sections. 'Section' content-type has Entity reference field to a 'Page'. So that is a one-to-many ...
1
vote
0answers
22 views

entityQuery where a translation with a different value returns incorrect nodes

The title seems a bit odd, I know, but I couldn't find any issues similar to this and that's the best I could come up with. We are running into an odd instance of entityQuery returning nodes that ...
0
votes
0answers
28 views

How to access the properties in a config entity when loaded by entityTypeManager

Drupal 8 with custom config entity. I have a custom config entity that has various custom properties such as 'product_id'. I am loading the populated config entity like this: $config = $this->...
0
votes
1answer
14 views

File widget custom upload location

I am working on a custom module (based on Model project) with a file field attached to my custom entities, now I would like to save files in certain directories according to entity id eg: public://...
0
votes
1answer
16 views

define a template file for a field item in my modules

I wish to register a template file for use with a filed item, but I can't wrap my head around it. here is what I am trying to achieve. In my field widget Formatter public function viewElements(...
0
votes
1answer
14 views

Rule to create an identical entity to the node created then delete node

I have a content type called "article" and an entity type called "article 2", they both have identical fields. When I create an article node and save it I want a rule to fire that then basically ...
0
votes
1answer
13 views

Finding entity/webform fields in the database

A bunch of user accounts were deleted and recreated with new UIDs, and so any webform submissions or entities that have fields pointing to the old UID are now broken/wrong. I already updated some UID ...
1
vote
1answer
30 views

Set entity reference revision field value?

How do I set entity reference revision value for a field? I have two fields, field_test_entity_reference and field_test_entity_revision. field_test_entity_reference is of field type entity reference ...
0
votes
0answers
12 views

Entity reference Autocomplete widget performance issue on add/remove

I have created content type and using entity reference module.I am facing very slow performance on entity reference Autocomplete widget while add more or remove option in admin side. Its taking time ...
0
votes
1answer
17 views

Display entity as options_select multi-select

Below is my code for the view. I have tried multiple = true, multiple_values=true, multiple = multiple. None have worked. ->setDisplayOptions('form', [ 'type' => 'options_select', '...
0
votes
0answers
20 views

Implementing entity query to find/increment field values

Similar to this question but for Drupal 8, I have a custom node type with field_product_category and field_project_number. I want to increment project number based on a count of nodes with a specific ...
1
vote
2answers
42 views

Entity reference multi-select

I'm trying to make an entity reference field a multi-select options select but I can't seem to find out how to make that happen. Any help is appreciated. Below is the code I'm using. $fields['...
0
votes
0answers
14 views

How to load output an existing Commerce Line Item Type field in a custom form?

I need to output an existing Commerce Line Item Type field in a custom form and I can do this with a field from a standard Node but can't get it to work with Commerce Line Item types. The code ...
-2
votes
1answer
21 views

add an id to an element that doesn't have

So, I want to create an onclick event with javascript for each option of a "select form" when clicked, but since drupal doesn't use HTML I can't modify it manually and put an id to each. This is the ...
0
votes
0answers
13 views

How to use custom template in EntityListBuilder render method?

this is my render method from EntityListBuilder public function render() { $build['table'] = [ '#type' => 'table', '#header' => $this->buildHeader(), '#title' => $...
0
votes
1answer
21 views

Entityreference multiple choice

I have an entityreference field on users and I can't find a way to select more than one value. I want to make like a multiple select, but with the entityreference. I use the EntityReference module, ...
0
votes
0answers
28 views

how to add constrain to form view in BaseFieldDefinition

I have this field: $fields['type_id'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Type of Item')) ->setSetting('target_type', 'type_entity') ->...
0
votes
1answer
21 views

Custom Entity: define a view in entity reference field

I defined a custom entity and for a entity reference field I want to set the view reference widget and a view/ display to be used instead of an autocomplete. I tried many different settings - nothing ...
0
votes
1answer
12 views

How to get field value after getting a node?

I have a content type which contains school information. School name and school id are two fields in the content type. I have the school ID and I am able to retrieve the node. How do I get the school ...
0
votes
1answer
38 views

Why is my update query OK for the database but the page shows the wrong value?

I have 2 custom content entities created with Drupal Console (drupal generate:entity:content): 'person' and 'member'. They are linked (1 member <-> n persons) by a field named 'member_id' in '...
0
votes
0answers
40 views

Cannot db_select join extra taxonomy term

I have 4 taxonomy term fields with a total of 400 terms, and I have to query the input field from node/add reference field against the database. $query = db_select('entityform','e') ->fields('e'...
1
vote
1answer
27 views

Does the summary area support input filters?

I have noticed that text filters placed in the summary area don't seem to work, that the raw text appears in the summary info when posted in Twitter, Facebook and the like. Is that some inherent ...
1
vote
1answer
22 views

Use image field in an entity query condition

How to use image field in a condition of an entity query? To get X nodes which have no image as value of field_image I've tried this: $nids = \Drupal::entityQuery('node') ->condition('type','X') -...
0
votes
1answer
19 views

Add a view with a contextual filter not on a node/taxonomy page

Druapl 7 - I have a taxonomy vocabulary called ‘Destinations’ and an entity created called “accommodation”. The accommodation entity contains names of individual accommodations, to simplify, let’s use ...
0
votes
1answer
25 views

Conditional clauses with Entity field Query

I have a syntax issue on using conditional clauses with EFQ, but the documentation on drupal.org is a bit unclear for me. I have google the whole Internet for this with no results at all. My hook ...
0
votes
0answers
45 views

Always load additional data from referenced (child) entity

I created some custom entity types, let's call them "parent_entity_type" and "historic_data_entity_type". The parent entity type is referencing to historic_data_entity_type indicating which data is ...
0
votes
1answer
24 views

Update the author_uid for an entity registration

I'm looking to update the author_uid for an Entity Registration in Drupal 7 programatically. I want to replace all anonymous users with the UID of 0 with another UID lets say 2 upon saving the ...
0
votes
0answers
9 views

Entity Registration: Notify users from waiting list that they are now enrolled.

I have a rule to email the user when they are on the waiting list. If there is a cancellation the next on the waiting list is registered. Now I want to notify the user that has been moved from the ...
0
votes
1answer
19 views

Load the value of an entity field type in another form

I have created a custom field and I wish to load the value dynamically in another form in relation to the specific node entity the value belongs to. I understand that to get the value I have to use/...
0
votes
1answer
24 views

Render page with theme wrapper from custom controller?

I've created a page layout using panels in the Drupal admin UI (page_machine_id). I'm trying to load that page into a custom controller like so and render one of the variants (Drupal 8): public ...
0
votes
0answers
13 views

Using Inline Entity Form with Form API [duplicate]

I'm working on a Drupal 7 project. I have created a custom module with 2 custom entities (profile hasMany users). The db tables are created through the Schema API. I have created a form using the ...
1
vote
1answer
16 views

Show content that is tagged to both current node and translation source

I'm using Drupal 7, i18n, Views3, translated_entityreference, and Entity Translation. http://lingtransoft.info/apps/paratext I have a content type: Training Resource, and each Training Resource is ...
0
votes
1answer
40 views

Link field title from entity/route

I have a Drupal link field configured to allow both internal and external links and have the title field enabled, but optional. I want users to be able to reference internal entities without having ...
0
votes
1answer
23 views

entity_load not fetching the updated column

I've a custom entity {my_table} and added a new field in schema file as follows /** * Add {new_column} field to {my_table} table. */ function MY_MODULE_update_7100() { $table = 'my_table'; $...
0
votes
1answer
12 views

Add property to ProductVariationType via hook_entity_type_build()

Hy guys, I'm trying to implement a simple stock management in my e-commerce. The ProductVariation will have a stock_quantity field used to track product availability. I would like that ...
3
votes
1answer
139 views

Per Bundle Storage for Drupal 8?

In Drupal 7 there was the start of Per-Bundle Storage (PBS) to try to store field data in a single database table if that made sense and was possible given the nature of the field. The PBS for Drupal ...
0
votes
0answers
20 views

Entity Form Builder bypasses Access Handler on submit?

I have a ECK Entity, it is allowed to be edited only by admins. Under a custom route /test I load the form with \Drupal::service('entity.form_builder')->getForm($entity, 'default'); Now as an ...
0
votes
0answers
14 views

EntityFieldQuery for checking if field exist Drupal 7 [duplicate]

I'm using field collection attached to a user. I need to check if the field collection is empty: $id = 9473; // sample user ID $query = new EntityFieldQuery(); $query->entityCondition('entity_type'...
0
votes
1answer
35 views

how to use “views field view” for entity reference - Not taxonomy

I've got a view of "webinars," that contains an entity reference "speakers" that can have multiple entries. I can't get those entity references and their own fields into the listings for each webinar, ...
0
votes
0answers
15 views

Rules condition to filter on Entityform Type

I have 3 similar Entityform Types that I've created. I need to create a Reaction Rule that only operates on submissions of one particular Entityform Type. I thought "Entity is of bundle" or "Entity ...
0
votes
1answer
42 views

disabled=“disabled” on a checkbox entity field

I can't seem to figure out how to make checkbox field on my entity display as disabled in the admin form area. Looked in Drupal 8s "documentation" but couldn't seem to find anything on it. I tried ...
0
votes
0answers
18 views

Entity Reference - Inline entity form, increase of title maxlength

I have installed the Title length module to extend the title of all nodes, but another issue appeared when I try to add an entity reference of a document type to my advanced page, the title is limited ...
0
votes
0answers
28 views

How to handle Custom Validation in inline entity Form?

I'm using Drupal8's inline entity form and is having issue with writing custom validation. I found few links and wasn't helpful at all. Does anyone know how to handle this?
3
votes
1answer
40 views

How can I set up a “many to many” relation with an entity

How do I set up n:m database relation in a custom Drupal 8 module? I want to create task entities that may be related to different users (a task may have multiple related users and a user may have ...
0
votes
1answer
38 views

Render entity fields retrieved by EntityQuery

I'm building a table with TableSort retrieved by EntityQuery like explained in this post. The result fields vary a lot and I have a hard time to figure out how to render the results of the different ...