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
25 views

Set taxonomy field on node creation

I have a node type 'blog_entry' that uses a taxonomy reference (tags). The tags are created if they don't already exist, i.e. the reference field uses the option 'Create referenced entities if they ...
0
votes
0answers
14 views

When I try to load an media entity with $mid and entityTypeManager->getStorage get nothing

I'm trying to generate a field formatter, and I get this error: Error: Call to a member function getStorage() on null en Drupal\svg_url\Plugin\Field\FieldFormatter\Url4SvgFieldFormatter->...
0
votes
0answers
12 views

Getting multiple inputs with custom field

I created field for timeline and I selected unlimited for " Allowed number of values " and I "placed" this field to my custom type, After saving content I`m getting multiple instances of this field ...
1
vote
0answers
24 views

Custom compound field with 2 entity_reference fields

I'm trying to create a custom compound field in D8 that, among others, includes an entity_reference to a node and an entity_reference to a taxonomy term. I did follow the answer from this question. ...
0
votes
1answer
35 views

Custom Content Entity Bundles - How to override class methods?

I created a Custom content entity type and one bundle of this entity type. The Custom content Entity is presented as PHP-Class. The entity bundle is defined in a configuration file. I created the ...
0
votes
2answers
53 views

Can I add and edit a custom entity from the same URL?

I am creating a custom entity called user_profile. Each logged in user will have a user profile. I want to be able to add and edit the user_profile entity from the same URL. The example module ...
0
votes
1answer
18 views

Entity Validator failing Integer for not being integer

I have a custom entity with an integer field with the following baseFieldDefinition: $fields['permission_level'] = BaseFieldDefinition::create('integer') ->setLabel(t("Permission Level")) ...
0
votes
1answer
16 views

How to copy/clone menu of a node when clone with Entity Clone module?

When cloning a node using Entity Clone module, the menu link are not copied. As menu link item is created and managed on the node form level, there is no reference of the menu link item in the node ...
0
votes
0answers
36 views

Get a parent Paragraph's field values from hook_preprocess_field_collection_item()?

I'm trying to update the value of a field within a Field Collection item using hook_preprocess_field_collection_item(&$variables) but the value I need to reference is in a parent Paragraph Entity. ...
-1
votes
0answers
19 views

I want to be a Chinese poetry class web site, but I don't know what can realize, please help me! [closed]

There are two main requirements: 1.Click the first option, according to Chinese pinyin of each text 2.Click on the second option, the meaning of each sentence My idea is that (1) each text quotes a ...
0
votes
0answers
15 views

How do I retrieve the individual elements that make up an entity?

I have some entities (called media_item) that each consist of a collection of images (small, medium, large). I would like to pro grammatically select the large image path from one of these entities ...
0
votes
0answers
37 views

Type-specific fields for different categories of content type

I have a contract content type on my Drupal 8 site, and I would like to use the same content type for multiple different types of contracts. 95% of the fields are common for all types (contact ...
0
votes
0answers
10 views

D8 Equivalent To D6 Node Referrer - Obtaining List Of Referencing Entities On An Entity

I am refactoring a D6 site into D8. Two of the entities (content types) I have are Event and Document. There is a 1:n relationship between Event and Documents. I added 'For Event' field on Document ...
0
votes
1answer
33 views

Adding Field To Bundle-less Entity On Installation Not Working

I have several fields that I'd like to attach to a custom entity upon installation. I am trying to follow the suggestions here to attach fields to my custom entity (which, by the way, has no bundles). ...
-2
votes
0answers
37 views

How to get entity field value for computed field?

How to get entity field value for computed field? I have field "field_ingredients", it has values "allergents", "cancergens" etc. $value =$entity->field_ingredients->value; $display_output = $...
0
votes
1answer
18 views

Programmatically create new Schedule Updates Entity Reference on Node

I’m attempting to populate an entity referenced field created by the Scheduled Updates module within a content type, Event. Within Event I have two Scheduled Updates fields to check and uncheck the ...
0
votes
1answer
24 views

Display text in an empty field group tab using custom code

I have created a field group with an empty tab. I would like to use custom code in a module to display something in this empty tab - it will just be a render array. Can someone show me how this can ...
2
votes
2answers
87 views

Loading taxonomy terms in a tree in Drupal 8

I have multiple level of vocabulary, I want to display all level in the hierarchy same as taxonomy display. My taxonomy is like. All Drinks Alcohol Drinks Beer Vodka ...
0
votes
0answers
6 views

Change order and values in List (Text) field, even if there already data in database

I have a List (Text) field with list values: 0|ValueA 1|ValueB 2|ValueC 3|ValueD 3|ValueE In Field settings tab you see: There is data for this field in the database. The field settings can no ...
0
votes
0answers
24 views

How do I select which node fields to display while typing in an entity reference field?

I created an entity reference field to select News items to display on a page. News is a content type. How do I display not only a title, but other stylized fields of a node as I type in the entity ...
5
votes
1answer
57 views

How to save custom label as parameter for a custom entity_reference field widget?

I am creating a custom field widget for an entity_reference field. This has a custom select field and an Ajax Submit button. Once the user selects an option (entity) from the select_field and submits ...
0
votes
1answer
31 views

How to find a field name/column name of a field in database where I have only the label of that field?

I am working on an integration part with drupal framework. Here it's hard to find the table names of the field which is present in the view as I know only the field label name. Is there any way to ...
-1
votes
3answers
50 views

How do I programmatically create a webform from a newly created node?

This is the code I am using. function walk_handler_entity_presave(EntityInterface $entity) { if (method_exists($entity, 'getType') && $entity->getType() === 'walk') { $elements = []; ...
2
votes
2answers
214 views

Where is the node created timestamp stored in the database?

I need to create an SQL query that finds all nodes of a certain type created X days ago, so I can get their IDs. Due to the massive number of nodes in the database, I would prefer to use a direct SQL ...
1
vote
1answer
53 views

Entity reference view depending on other field [closed]

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
47 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' => '...
0
votes
0answers
41 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
28 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
23 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
43 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
40 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
67 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,...
0
votes
0answers
82 views

How do I migrate a CCK node reference from drupal 6 to entity reference drupal 8?

I try to migrate cck field node reference drupal 6 to drupal 8 reference field?. After migrate I don't see cck field_node in drupal 8. field_node: - plugin: iterator source: field_node process: ...
0
votes
0answers
53 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
126 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
17 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
13 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
29 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
23 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
93 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
99 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
20 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 ...