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
1answer
28 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
20 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
25 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
17 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
54 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
25 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
171 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
21 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
16 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
40 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, ...
-1
votes
0answers
19 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
45 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
47 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
44 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
59 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
24 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
62 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
28 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
26 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 "...
-1
votes
0answers
30 views

Converting an entity with existing contents to revisionable throws exception

I'm trying to convert a core entity (menu_link_content) to revisionable with existing data. I'm trying to figure out how to accomplish this. I saw this go to guide here - https://www.drupal.org/docs/...
2
votes
1answer
20 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
29 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
25 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 ...
0
votes
1answer
34 views

Image upload: Failed to open output stream

I created a media entity browser and for the image upload widget i choose the DropzoneJS.The widget settings are in the image bellow, pretty standard. And regardless of image type (png, jpg, jpeg) ...
0
votes
0answers
28 views

Use of node vs custom eck entity bundle

Is there a difference in weight (performance wise) in using custom eck entity bundles or nodes? So if I need to store data bundles with the following values(fields): Entity Reference to other node ...
0
votes
0answers
30 views

entity_reference change handler setting default

I'm a beginner in Drupal.I create a entity and add field like this: $fields['test'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('test')) ->setSetting('target_type', '...
1
vote
0answers
58 views

Entity Form: Override Submit Handler with Custom One

I'm loading a field collection item form inside of a formatter. Below is the function loading the form, which works. However I do not want to call the normal field collection submitForm handler, I ...
0
votes
0answers
49 views

How to create a Blob field type?

Is there a way or is it possible to add a Blob field type in Drupal 8? And save the files on the database? I know that there is a module Blob but it's for a Drupal 7.
2
votes
1answer
140 views

list of supported value in entity baseFieldDefinitions setDisplayOptions type(field widget)

I'm new in Drupal, I create my first entity and use baseFieldDefinitions to set fields and in fields I use setDisplayOptions to set form like this: $fields['piece'] = BaseFieldDefinition::create('...
-2
votes
1answer
55 views

Get the thumbnail of the uploaded video programmatically

I have a content type include a file field for uploading videos, what I want to do is to get the thumbnail of the uploaded video automatically from my custom module.
0
votes
0answers
14 views

Migrating file entities

We are working on migrating a number of our sites from D7 to D8. The current issue we are stuck on is that our file entities are not migrating. My understanding is that this is caused by D8 not ...
1
vote
1answer
33 views

How to add warning message before module is uninstalled

The module in question has a content entity, entity1, that has another content entity, entity2, that depends on entity1. I would like to add a warning before uninstall of the module if there are ...
0
votes
0answers
99 views

Uncaught PHP Exception “The module dbug does not exist”

I get the following error, which refers to refers line 522 of core/lib/Drupal/Core/Extension/ExtensionList.php. Uncaught PHP Exception Drupal\Core\Extension\Exception\UnknownExtensionException: ...
1
vote
0answers
17 views

Combining entity forms on one page breaks file upload

In Drupal 8 I have combined a number of custom entity forms on one page using this example. Everything works perfectly except for file uploads which do not load. In the console it returns : XHR ...
0
votes
2answers
81 views

How to show entityQuery results as block

I use entityQuery to retrieve nodes related to actual content. Now I don't know how to add them to template and show them in my theme. In Drupal 7 I used Bean module to create blocks as entities. The ...
1
vote
1answer
142 views

Limit amount of adding a certain Paragraph per Content type

I use Drupal 8 Paragraphs module. I created a Content type Landingpage. I create some Paragraph types like Hero Image, Intro text etc. In the Content type Landingpage I created a Paragraph Entity ...
0
votes
0answers
20 views

Is there a way of deleting a file field without deleting the related file entities?

I'm working on a site that started uploading files via specific Fields appearing in Content Types, but has since moved to uploading them via admin/content/file/add for consistency. I'd like to delete ...
0
votes
1answer
56 views

How to programmatically update a paragraph field

Trying to get certain paragraph field of certain node updated with new value with the following code: function my_module_node_update($node) { if ($node->nid == '111') { foreach ($node->...
0
votes
1answer
35 views

Can't import configs on server due to some entities

So when i try to manually import configs (/admin/config/development/configuration) i get these messages: Entities exist of type Media and Media type Image. These entities need to be deleted before ...
0
votes
1answer
23 views

How to add a percent field in content type

Simple question. When creating a content type field, we have a float, decimal and integer number type, but how can we create a field with percentage type value, basically a range of 1-100%.
0
votes
3answers
41 views

Modify a custom block field value with hook_form_alter and validate

I'm trying to modify a custom block form with hook_form_alter .In its validate function I have a case where one of the field value needs to be unset. For modifying its value I tried with $form_state-...
0
votes
0answers
17 views

Use multivalue field collection on a webform

I want to build a field collection and give the opportunity to the user to add more than one field collection. The field collection is named Office and it contains the fields Desk, Chairs and ...
0
votes
2answers
29 views

Available node language only English

I have a custom content type with "Set custom language as default for new content" and "Require language". Custom default language is Current language. Entity translation is defined with "Current ...
0
votes
0answers
164 views

Listing the users and roles in a content type

I am using Drupal 8 and I have a restricted content type with only specific roles with read/edit access. I need to be able to list all the users of these roles in a checkbox list when you edit the ...
0
votes
0answers
57 views

Contextual filter in media browser view not accessible on autocomplete filter ajax call

I'm having a view which filters Media type and has contextual filter of Entity browser context. This view also has an exposed filter of text box field with autocomplete enabled which filters by media ...
0
votes
1answer
59 views

How to replace allowed_values for a select field by external definition?

I created a custom content entity, called member, with some fields of which one, called status, is a list appearing in form as a select: $fields['status'] = BaseFieldDefinition::create('...
0
votes
0answers
10 views

Field collection of field collection fields feed import

I have content type : product In this content type have one field collection "preparation section". With in this field collection I have another field collection "preparation steps". I am updating ...
0
votes
1answer
37 views

Update image tags using entity metadata wrapper

I'm trying to bulk update image tags using entity_metadata_wrapper. I'm unable to see the image field when I use $emw->getPropertyInfo(). The bundle is called hub_page. The code I'm using is: $...