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

Value in my custom base field added to user entity isn't saved

I've created a new custom basefield for user entity type like this: function hd_is_integration_entity_base_field_info_alter(&$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type) { if ($...
0
votes
1answer
11 views

Entity reference additional field

In D7 I have two new node type defined e.g. branch and leaf. The branch is a collection of leaves that I'm referring to using the entity_reference module. In the picture below the leaves are the nodes ...
0
votes
2answers
33 views

Module getting “$entity” argument error with hook_entity_presave()

I am trying to create a module in Drupal 8 (8.9.11) and this module uses the function hook_entity_presave in order to update a node / entity programmatically. I've tried the answers from ...
0
votes
0answers
32 views

Fields in a custom entity created by UI aren't recognized by a view [closed]

I have a custom entity (Document), fieldable and with support for views. /** * Defines the document entity. * * @ingroup mymodule * * @ContentEntityType( * id = "document", * ...
-2
votes
1answer
56 views

Text Formatted field not getting html tags in re-edit

I am using Drupal Field to store HTML-Markup and fetch with twig template. All works fine. But, the formatted-field does not pull the full html when re-edit is to be done. The formatted-field is set ...
0
votes
0answers
22 views

How to migrate content (fields and paragraphs) into another content type?

My problem is following: Initial situation At my Drupal 8 site I have a node content type (let's calling it node content type A). node content type A has normal (core) fields included and also holds a ...
0
votes
1answer
24 views

VBO hook_entity_update

I would like to perform the following mass action via VBO: send a mail to author of a node. This mail is configured and sent in a hook_entity_update function. The beginning of the function is the ...
0
votes
0answers
25 views

How can I delete a field translation in node?

I am using a complicated melange of paragraphs with asymmetric translation, and in a few my nodes there is a stubborn translation that somehow is stuck. Its a node that used to be translated, but then ...
0
votes
1answer
56 views

How to automatically add http prefix to links in a form?

I am trying to come up with a solution to fix the D8 Link module to allow URLs like example.com (the most common use case, imho). I was thinking it would be simple enough to modify the submit value ...
2
votes
1answer
25 views

Custom migrate source plugin, extends FieldableEntity class, has migrate status of [error] No migrations found. Why?

I'm writing a migrate source plugin for migrating D7 entityform (entityform module) submissions. If anyone has done this or knows an existing plugin, please let me know. I am trying to extend the ...
0
votes
0answers
18 views

Move entity properties into existing tabs like Node?

When creating a custom content entity, how can I get the properties to automatically arrange themselves on the form like adding/editing a node does out of the box? I'd like the experience to be ...
-1
votes
1answer
12 views

Creating a Select List + Textfield

I'm trying to create a supplies field made up of a select list (or entity reference) and a number field. Users should be able to create several of these. For example, the link field has a URL and ...
0
votes
0answers
5 views

Limited editing of just the order of entity reference field

I would like to give some users the opportunity to edit the ORDER of a field of entity references holding multiple references-- but not the references themselves. One option would be to post process ...
0
votes
0answers
24 views

How to display scheduler module fields?

I'm trying to display values of the scheduler module fields publish_on and unpublish_on. Does anybody know where to find them? I cannot find them in /admin/structure/types/manage/article/fields. I was ...
0
votes
1answer
17 views

Increase maximum amount of characters for entity reference field (tag style)

I have a Drupal 9 installation running Commerce 2. My products use a taxonomy entity reference field (tag style). There's one products category, where I need to have more references in the tag input ...
0
votes
0answers
24 views

How to connect different node bundles in one page

I am building a web site about football teams in Drupal 8 and I have the following content types Team, Player, Manager, Game etc. I would like to connect nodes from Player, Manager content types in ...
0
votes
0answers
11 views

Custom entity field UI “EntityDisplay entities can only handle fieldable entity types.”

I've created custom entity using drupal console and added my required properties using base field definitions. Everything was working well in that I could add and view the entities until I changed a ...
1
vote
1answer
23 views

Entityqueue - Get field values from the queue

First off, i'm very new to Drupal. Kindly help me and forgive if im being a noob. Im using the module - Entityqueue https://www.drupal.org/project/entityqueue Im created a view block for a entity ...
1
vote
1answer
30 views

How to display a node edit form in custom URL

I have a node created (using Default content) as part of the site install and it is available to edit at node/[nid]/edit. However, this node holds some of the site-specific content (for example, ...
0
votes
0answers
36 views

Get original entity in a constraint

Is it possible to get the original entity in a constraint? Use case: create a constraint on which item can be deleted in a multi value field
0
votes
0answers
20 views

Combine two Media fields in Product types and Product variation types

i'm drupal beginner, i install drupal 8 commerce 2, i create a media field in Product types and create another media field Product variation types also. when i create new product, i want to give user ...
1
vote
1answer
33 views

Is there a hook that could manipulate the list of field items before the field is built?

I am currently porting a custom field module from Drupal 7 to 8. The field (Topic Access) has 3 select fields, typically about 10 to 20 items per field, and uses a custom widget. When the form is ...
0
votes
1answer
41 views

How to get fields definitions of a vocabulary [duplicate]

I needed the field list related a vocabulary item.I was able to list the fields related to a content type by using like this: \Drupal::entityManager()->getFieldDefinitions('node', 'article'); But ...
0
votes
1answer
20 views

Disable Inline Form Errors

I'm encountering the bug described at "Login form error message is redundant and does not make sense". In short, if a user enters invalid credentials once, an inline error message appears on ...
1
vote
1answer
67 views

Use entity reference to target revisions of an an entity

I'm building a custom entity document which supports revisions. Revisions are seen as versions of the document (v1.1, v1.2, ...), the title field is revisionable as well. Then there is a custom entity ...
0
votes
0answers
13 views

Can't generate stack trace for EntityMetadataWrapperException, even with Devel and ddebug_backtrace()

I have the following error on a product display page on Drupal 7 : EntityMetadataWrapperException : Unknown data property field_attribute_name. dans EntityStructureWrapper->getPropertyInfo() (ligne ...
0
votes
1answer
18 views

Field weight in display mode is not respected on custom entity

I have a custom entity type with a set of base fields and I can create/view/update/delete entities. However When I create & enabled a custom view mode to the entity type and set to display subset ...
1
vote
1answer
40 views

Media library widget: Table instead of grid?

Background I have a multiple-value entity reference field with target type = media. It is used for "document" media, so mostly pdf files. I am using the "Media library" widget ...
1
vote
0answers
20 views

“Display” checkbox to show/hide media reference field items?

Background In Drupal 7, a file field does have a "Display" checkbox per field item, to show / hide the respective file. In a Drupal 8 migration project, we are migrating such fields as ...
0
votes
1answer
15 views

Token does not return full dynamic path to Media Image URL

I'm having trouble configuring Metatag for Open Graph and Twitter Card images. I'm using Drupal 8.9 core Media Image reference field as the source. [node:field_hero_image] (Entity reference field) ...
0
votes
1answer
55 views

Entity revision metadata key missing after upgrading

After upgrading a site to Drupal 9, I started seeing the following error when visiting the site: Drupal\Core\Entity\Exception\UnsupportedEntityTypeDefinitionException: The entity type banner does ...
0
votes
1answer
27 views

Circular dependency on base fields' module

I have 3 custom modules that provide custom entities with all fields defined as base fields. Contact module - provides a contact entity(it could be one of the type: a person or email or phone etc) ...
-1
votes
2answers
43 views

Updating user leads to sql integrity issue

Please help me find what I am doing wrong to update a user field. I am trying to update all existing users in my Drupal 8 instance. I could do the same thing easily in D7, but can't get it working ...
0
votes
0answers
40 views

EntityReferenceItem could not be converted to string

I created an API Rest, to export all users from my site (Around 28000). it was working well until the last week, the process ends in user #1056. foreach ($nids_r as $nid) { $entity = ...
0
votes
1answer
39 views

How do I validate an entity before programmatically saving it?

I have various functions/methods that programmatically create entities (nodes). I just noticed that invalid data has been getting stored in the db though these functions (invalid in that it doesn't ...
0
votes
2answers
94 views

Converting a Views SQL query with INNER JOIN to an EntityQuery

I'm trying to create a custom JSON:API resource that returns the entities that have been flagged by a user. (The Flag module does not offer a way to get this out of the box.) I used Views to build a ...
0
votes
0answers
57 views

Custom entities

I am a Drupal 7 avid user and I am just getting into Drupal 8 development for work. The project we are currently working on involves creating about 3 different custom entities (not nodes, users, etc). ...
1
vote
1answer
20 views

Adding the category for a custom entity reference field add other fields to the same category

I have a custom entity reference field working well, but once I added the category to it the other entity reference fields appeared in the same category. Here is my code: /** * Plugin implementation ...
1
vote
0answers
38 views

Field type where big data is not loaded into memory if not needed

Background Normally when an entity is loaded in D7, the 'field_attach_load' step will load all the data from fields into the entity object. The field_sql_storage_field_storage_load() loads the data ...
0
votes
2answers
27 views

Hide comment box from node for Anonymous users

I am trying to hide the comment box for anonymous users. Anonymous users should only be able to view the comments. How can I hide the comment form?
0
votes
1answer
27 views

How can I limit an entity reference selection to a specific field value on the reference

I have a content type Research which has a an entity reference type of People. The problem is that I don't want to show ALL people but only people which have a certain value under their field named ...
0
votes
1answer
21 views

How can I have a new dropdown for each entity reference added?

I have a content type with an entity reference to another content type that has over a hundred items. I want to use a dropdown menu to select the entity, since the user won't always know the titles of ...
0
votes
1answer
29 views

How to put view results in an entity reference field?

So the scenario is like this: I have to create a "node" which has an entity reference field which can hold multiple values. I am looking for a way to be able to select view results to be ...
0
votes
0answers
44 views

Placing a block on an entity

I am aiming to place a block on an entity. It seems like this should be simple as entity integration in D8 is well-developed and (in parts) user-friendly. I can get the view block working fine and can ...
0
votes
1answer
18 views

Unprocessable Entity: The following relationship fields were provided as attributes

I'm trying to set the value of a taxonomy term entity reference field with a POST operation in JSON:API. const data = { data: { type: 'node--page', attributes: { field_text: { ...
0
votes
0answers
10 views

How do I set a grouped exposed filter of boolean fields in a view?

I have a view with fields used as filters and exposed to user in a dropdown. They are "grouped" in the filter section. These fields are boolean. I can't get them to work together. It's ...
0
votes
1answer
28 views

Correct way to get field definitions for entity types

I'm still pretty new to D8 so I'm getting to grips with the new way it deals with fields and the OOP way of doing it etc. I've got a hook in my module which I'm trying to add a submit handler to ...
1
vote
1answer
49 views

add Bundle field to a custom entity

I am trying to add a new bundle field into my custom entity, I added the following code into the MyCustomEntity.php file, I uninstalled my module, so, I installed it again, the field is showing up on ...
0
votes
0answers
124 views

Is there a way to apply cached access results to listings?

Code that is put in either hook_entity_access or an access handler has no effect on listings such as views field displays and search. I am not sure if this is by design or due to an error from my side,...
0
votes
1answer
19 views

How to modify the subfields of a custom field in hook presave

I have a custom field in a custom module that consists of 4 varchar type values. Each of these subfields are called 'prefix', 'suffix', 'body' and 'header'. In the hook presave, I want to modify only ...

1
2 3 4 5
172