Questions tagged [entities]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
24 views

Digit 2 Appended to Field Name on Column in Entity Field Query

I have an Entity Field Query that has fieldCondition for field_email ->fieldCondition('field_email', 'value', $email , '='); I have verified that this is the name of the field and I have other ...
1
vote
1answer
40 views

Viewing an image file breaks if view mode has responsive image style

I have an image file that I am viewing programmatically. When I set the image format to "responsive image" in file display settings, it breaks with an error Error: Call to a member function ...
2
votes
3answers
843 views

how to get all the fields that have been modified on entity save (form submit)?

I am trying to figure out an efficient way to get the fields names/values that have been updated. It's kind of similar to what the diff module does to calculate changed on a node but not as detailed. ...
0
votes
0answers
32 views

How to delete file entries on click of Remove button in file upload?

The orphaned entries of a file which is associated to the node should be removed when a file which is attached to a node is removed from it. Like associated entries from file_managed table. How to ...
0
votes
1answer
208 views

Views contextually filtered by terms in paragraphs

TL;DR, Below are the structure of content types, paragraph types and taxonomy in my site. Taxonomy vocabulary - Category Terms - Sports, Politics, Business Paragraph type - Multi Article Fields - ...
1
vote
2answers
58 views

How to know “keys” for Entity::create()

The document says Entity::create() takes "$values (optional) An array of values to set, keyed by property name" as an arguement. I also found snippets like $term = Term::create([ 'name' =&...
0
votes
1answer
68 views

Hook to trigger when a field collection item is being deleted

I have create a module and I am using the following hook implementation. The code works on success, but how do I prevent or stop further processing when I get failed as status? ...
0
votes
0answers
15 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
3answers
367 views

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
79 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
16 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
vote
0answers
102 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
1answer
86 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
22 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
28 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
40 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
497 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
25 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
163 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', '...
1
vote
2answers
441 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['...
-2
votes
1answer
26 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 ...
-1
votes
1answer
25 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
2answers
224 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
33 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
54 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 '...
1
vote
1answer
43 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
89 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
39 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
40 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
56 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
38 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
1answer
25 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
35 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 ...
1
vote
1answer
63 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
484 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
43 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
81 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 ...
4
votes
1answer
552 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
1answer
74 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
1answer
207 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
1answer
485 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
361 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 ...
1
vote
1answer
433 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 ...
1
vote
1answer
28 views

Didn't we used to be able to type “entity:node/####” in a typeahead field?

When using any Drupal 8 link field to dynamically link to a node, I start typing the title and the typeahead function starts providing options to chose from. These are Drupal field types such as Link ...
0
votes
1answer
647 views

EntityQuery on nodes related by ERR and paragraphs

I have content type Publication which relates to content type Project using paragraphs: Publication [field_mention] -> Mention (paragraphs) [field_project] -> Project Now I want to show all ...
0
votes
1answer
107 views

Custom entity translation interface

I created a new custom entity using drupal console, I enabled translation and all looks ok in code. The problem is that I don't know how to translate an entity from the admin interface, I don't see ...
0
votes
1answer
115 views

Entity Reference - User reference field Hide “Restricted access” label instead of showing useless choices

i have an entity reference (7.x-1.5) select-list within a checkout pane which is being used to allow the user to attach a child to a product during a checkout process. The user can add multiple "...
2
votes
1answer
35 views

How to write hook_field_placeholder_info() for the link module?

The contributed project Field placeholder lets one use HTML5 placeholder attribute. The project page says: By default, this module integrates text, number and mail modules, but any other widget ...
1
vote
1answer
42 views

How to link to Entityform submissions page?

I am using an Entityform in a block to enable site users to submit enquiries to owners of holiday cottages. I need to be able to allow owners to view those enquiries. Each holiday cottage has its own ...
1
vote
0answers
46 views

How to assign permissions for a newly created bundle programmatically?

I am making a CRM management application based on Drupal. It will be used by a number of different organisations so I want it to be configurable. I have made a custom entity type called Person, along ...