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
0answers
22 views

Entity is not displayed on the front page [on hold]

I updated the core and all the modules. I have a feature that doesn't work, and I don't know if it is related to the updates. I can add a view inside an article. On the front page, I see the ...
0
votes
0answers
29 views

Node edit not getting published, user fields change & comments not getting saved [on hold]

This is on Drupal &, PHP 7.1, mysql Ver 14.14 Distrib 5.7.27; The problem: When I edit any existing content, and click save, the 'Published' status of the content gets converted to 'Unpublished' ...
1
vote
1answer
40 views

Entity reference view depending on other field [on hold]

I have a custom content type that contains an entity reference field (field_referencefield) and one more field as select box (field_triggerfield). The values of field_referencefield should depend on ...
1
vote
1answer
46 views

Custom Entity is only showing via admin theme

I implemented a custom content entity with Drupal console. By default the routing is done in JobListingEntityHtmlRouteProvider.php file. I am getting a standard path such as /admin/structure/...
0
votes
0answers
17 views

Reference custom entity

I'am on Drupal7 and wanto to reference this custom entity function myentity_entity_info() { $info['myentity_basic'] = array( 'label' => t('Ind (myentity)'), 'controller class' => '...
-1
votes
0answers
11 views

Select and embed a webform submission inside a node

I would like to be able to embed specific webform submissions into a node. We have a webform that collects student job openings from each office at our college. I would like to be able to add those ...
0
votes
0answers
36 views

Custom entity query access handler

I'm trying to create a custom query access handler for one of our custom entities, and I must be missing something or have the wrong concept of how this is all supposed to work. Currently I have this ...
0
votes
0answers
24 views

Querying entities taking an insane amount of time

Is the entity system in D7 not very well optimized? I am trying to iterate through 1500 entities using EntityFieldQuery(), and I had to extend my execution time to 300 seconds in order for the ...
0
votes
0answers
15 views

Getting “EntityMetadataWrapperException: Unknown data property” error when I delete a users custom field

I have added extra fields to the user object. One of the fields I have added was a Skype text field to hold the user's Skype contact information. The field had a machine name: ...
1
vote
1answer
40 views

What is error: “Base table or view not found: 1146”

Base table or view not found: 1146 Table '(database).(entity)__(field_name)' doesn't exist I have problems running my site since i deleted field (field_name) from entity (entity), to be clear entity ...
0
votes
0answers
18 views

How to choose content field shown in View using URL parameter?

I have contentType Screenshot which has 6 Image fields shot1..6. Then I have a view screenshots_1 which shows shot1 in a grid. I need to have 6 paths, e.g. /screenshot_1..6 each pointing to same view ...
0
votes
2answers
38 views

How to reuse existing images in field type “Image”

I have custom ContentType with one field of type Image. Currently, when I edit a node I can only upload new images from local to server. I want to have the option to select images already existing on ...
0
votes
2answers
60 views

How to check if a referenced entity is being used in other places?

I have a paragraph component that has a single field (reference) that calls on other paragraph components. I'd like to remove one of the paragraph reference field options so that users do not ...
0
votes
1answer
46 views

Building a non-config, programmatically-created, semi-dynamic, semi-manual menu

We have a custom entity called "Topic". With this entity, users can build topics and reference other content to "belong" to the topic. We also have a requirement where, whenever a user creates a topic,...
-2
votes
0answers
52 views

How do I migrate a CCK node reference?

I try to migrate cck field node reference drupal 6 to drupal 8. After migrate I don't see cck field_node in drupal 8. Here my node config cck node field_node: - plugin: iterator source: ...
0
votes
0answers
33 views

How to add custom header and footer to Webform Entity Print PDF

I have a Drupal 8 site and installed the Entity Print module, as well as Webform entity print. I want to print a Webform submission in a PDF but i cannot seem to understand how to create custom header ...
3
votes
1answer
123 views

Difference between $bundle and bundle()

Background information: I'm trying to manipulate the available options of a list type text field, depending on the host bundle: function wtbase_options_list_alter(array &$options, array $context) ...
0
votes
1answer
16 views

Create a view to list all contents that uses media through any entity reference field

I know it is possible to create view to list all content that is using media through a particular entity reference field. Is it possible to create a view to to list all content that is using media ...
0
votes
1answer
15 views

Entity without translation

I want to make entity in Drupal 8 called cash that store only numeric value (integer or float). I think, that entity not need translation. Is it possible for us to create custom entity without ...
0
votes
0answers
13 views

Items removed from Node Reference field are still displaying on the node

This problem only very recently cropped up; I've never encountered it before. I have a content type (Resource) that contains a Node Reference field (pointing to Organization nodes) that allows ...
0
votes
0answers
21 views

Revisions Tab is not visible

I updated Drupal to 8.6.16 version and after that Revisions Tab is disappeared. Actually, all revisions are saved fine and I can see them because I have access to the page "xxx/revisions", but I don't ...
1
vote
0answers
14 views

How to mark related entities as dirty in search api module when edited?

I am using Drupal 7 with the search api. I understand that one of the 'common pitfalls' of the search api is 'Changes in related entities don't lead to re-indexing'. I am bringing in a field called '...
0
votes
0answers
12 views

Entity Translate won't show translations on template overrides

I have set up entity translate and it lets me add the translations so they are stored in the DB. But when I click on the translated page, all I see is the orginal language which is English. So I these ...
0
votes
1answer
28 views

Entity Validation API: Retrieve parent field entity while validating

I'm using the Drupal 8 Entity Validation API. I've implemented my Constraint and ConstraintValidator classes and added them as a constraint against the relevant entity field. If I understand the ...
0
votes
1answer
22 views

Default all entities to English

At some point we will be enabling translations on all entities in Drupal 8. However, we are not ready yet so in the meantime we would like to set all of the entities (content types, taxonomy terms, ...
0
votes
1answer
56 views

Custom remote video thumbnail

I'm using the media entity from Drupal core together with the media library, to handle media on my site. I have Remote Video and Image with crop media types. I'm using the crop and image_widget_crop ...
2
votes
1answer
87 views

How to add a theme preprocess function for published state?

I want to create a body class for the published state of a node. I found some suggestions below for Drupal 7, but this code is not working for my Drupal 8 theme. Add class based on published state ...
0
votes
1answer
22 views

Referencing “type” in nodes returned by loadMultiple();

I know there are easier ways to sort nodes by type, using views, or using: $query->loadByProperties(['type' => 'my_content_type']); ... but what I really want to do is return ALL nodes and ...
0
votes
1answer
19 views

How can I filter which entities are available in the admin form for an Entity Reference Field? [duplicate]

I've got a Field which is called "Primary Article" which is an Entity Reference Field. I've configured this field setting the "Reference Type" to be "article", so that only articles show up in the ...
2
votes
1answer
44 views

How can I get the parent node of a referenced node?

I have a node called project which contains field building as a referenced item, I used the the hook on building node insert and, having this building id I need to get project id which this building ...
0
votes
1answer
11 views

Entity wrapper save using db_transaction()?

I am using a db_transaction() for some data updates. I am using some EntityMetadataWrappers, modify some data, then save. The thing is, the wrapper ->save() function doesn't have a parameter for $...
0
votes
0answers
20 views

Update Entity Reference View based on form field selection

I have a Content Type called Licence which has two fields, field_product and field_billing_cycle. Both are Entity Reference fields, using the select Widget. The product content type has a multi value ...
0
votes
1answer
26 views

Entity reference and associated data

Assuming I have two distinct entities A and B, with B having an Entity Reference field to A, how can I associate other data (=other fields) with the Entity Reference? For example, assume that A is "...
0
votes
3answers
36 views

How can I tell if a config entity hasn’t been saved yet? [closed]

How can I tell if a config entity hasn’t been saved yet?
0
votes
0answers
55 views

How do I generate a custom content entity bundle?

I created a custom content entity with Drupal console version 1.9.2. Everything is working fine. To use all the configuration and settings of my custom entity type in different bundles, I want ...
0
votes
0answers
19 views

Serialization of dependencies

I'm using Drupal 8.6 and I'm doing the serialization of a node. This node has related fields, which I also would like to serialize. In my case I have an article which has a photo gallery which has ...
0
votes
0answers
27 views

How to register a custom function for labelCallbacks for an existing entity?

I learned that in EntityBase the label method gets called to determine the label for an entity, for instance when it is rendered via the entity reference module as label. Now, for specific node types ...
0
votes
1answer
24 views

How to show a field value instead of the node title for nodes displayed through an entity reference field?

Edit: I think I found the place, just not the method yet. If correct, I will close this question. Sorry. I have no clue which hook or direction to look into. I would like to have a label or title ...
0
votes
0answers
25 views

how to submit multiple value in custom entity in drupal 8?

If I submit single value from dropdown of custom entity field then it will save in data in db. below is the code, working fine. $fields['participants'] = BaseFieldDefinition::create('entity_reference'...
0
votes
0answers
13 views

Cant get Quick Edit Link to display on Published Content

I am having a problem with the Quick edit link displaying on published content? Is this working as designed or am I missing something. The quick Edit link appears on all of the unpublished content. ...
1
vote
0answers
84 views

Change field type for custom entity (from integer to decimal) with existing data

Yes I have seen previous answers about that, but I'm looking for an new answer : That does not use SQL request That does not use deprecated function like db_change_field() maybe that uses the new ...
1
vote
0answers
14 views

Can't add sub tab local tasks to admin/content/my_entity

I have a custom content entity list which has its own tab into admin/content/my_entity. The content of this tab is generated by using EntityListBuilder class. Actually, I created it with the drupal ...
1
vote
2answers
61 views

Default value for datetime field definition in content entity?

I have the following datetime field definition for my content entity: $fields['start_date'] = BaseFieldDefinition::create('datetime') ->setLabel(t('Start date')) ->setDescription(t('Start ...
0
votes
1answer
20 views

How can I make entityQuery('commerce_order') return completed orders?

Under Drupal Commerce 8.x-2.13 I find that the query Drupal::entityQuery('commerce_order') with no conditions attached returns ONLY incomplete orders (when called in the context of an API endpoint)...
0
votes
1answer
29 views

Restrict access to ECK full page, but allow embedded

Following the Lullabot article on how to embed anything in a wysiwyg with Entity Embed and friends we're using this to embed a custom entity type created with ECK (Entity Construction Kit). The ...
0
votes
1answer
37 views

How do we set required for new & optional for existing fields - when adding basic field to content type?

How do we set required for new & optional for existing fields - when adding basic field to content type? When using Drupal 8 following this how to article shows the steps to take to add a basic ...
1
vote
1answer
37 views

EntityQuery, query by referenced entity value,

I am getting an empty array when I query by the value of a referenced field. I have the following: $result = \Drupal::entityQuery('node') ->condition('type', 'custom') ->condition('status'...
4
votes
1answer
56 views

How do I add a view mode to a simple custom entity?

I have created a super-simple drupal 8 custom entity. We now need a custom view mode for this entity. What do I need to add to my definition to make my entity appear as an option on the 'Add View ...
0
votes
0answers
13 views

How to select specific entities from a view made as an REST export

I have made a REST export from a view, which is fine when I set it up to SHOW "FIELDS", which I select and define myself. My issue is if I set it up to show: "ENTITY", then I get a HUGE result set ...
-1
votes
1answer
59 views

How to add multiple values to file/image fields while creating node programmatically?

I have multiple images coming dynamically in array. But while adding those images to node only last file get attached in field and other images only saved in file directory. I have tried everything ...