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

How to check if field of type reference revisions is paragraph or others? [duplicate]

I am creating paragraph field programmatically dynamically from array. The logic for creating a paragraph field is different from others entity revisions. Is there a way we can identify if field of ...
0
votes
0answers
51 views

How to change from Token based file download to normal path file download

I am trying to attach the document(pdf) in CKEditor using "Add Media" option. The problem is that it is making the path to download the file like this "https://domain/file/fid/download?token=xxx" ...
1
vote
0answers
14 views

Rendered entity display mode has gone [duplicate]

I'm trying to create a paragraph with an entity reference field, that renderes a contact form. My problem is that I'm not able to choose the Rendered Entity display mode, for my field. As you can ...
0
votes
0answers
22 views

Howto check if a form contains custom type field in hook_webform_submission_form_alter?

How to check if my custom element is added to form in hook_webform_submission_form_alter. Below is the screenshot what i am getting in form array. Custom composite element can be nested under 3 or 4 ...
-1
votes
1answer
31 views

Field collection does not show on the page

I've installed filed collection on drupal 8 version. Now I'm trying to add field collection named "field_ingredients_second" to a content type. And then I've added fields to this newly created field ...
0
votes
0answers
8 views

Removing an item from a field collection when a new item is added; re-adding it when an item is removed

In Drupal 7, I have a field collection with a list of values. After adding another item, the previous item should not appear in the field collection. Similarly, after removing an item, the previous ...
0
votes
0answers
35 views

Interface Microsoft Access to Drupal database

I am wondering if anyone has ever succeeded in editing their Drupal database with Microsoft Access. I have already figured out how to use Oracle's Mysql ODBC connector to enable MS Access to see my ...
1
vote
0answers
46 views

Add custom fields to an existing entity

I would like to add extra fields to an existing entity WebformSubmission : Assigned to (entity reference to a user) Status ( taxonomy term reference) for these two fields I will need it to be ...
1
vote
0answers
19 views

How do I create field collection of/in another field collection programmatically?

How can I create field collection in another field collection using Drupal 7 Entity? The field structure is given below; Content type: Properties field_1 field_2 field_collection_1 (I can create ...
1
vote
0answers
45 views

Is there a way to set the cardinality of a field on a per bundle basis?

I'm creating a bunch of paragraph types with a node entity_reference field, in some cases, I want field_article allow 3 items, in some to allow 5 items and in some to be unlimited. I'd like to set ...
2
votes
1answer
43 views

How to load an entity definition?

I need to load an entity definition to add a constraint and test it, I found that this is possible with the following code: $manager = \Drupal::entityDefinitionUpdateManager(); $entity_definition = $...
0
votes
0answers
27 views

How to get all vocabularies in a taxonomy retrieved from a referenced field?

I have a taxonomy that I am getting in the page twig file after referencing a field from the node object. The twig file is a page for a content type, i.e. page--content-type.html.twig. So node....
0
votes
1answer
31 views

How to add dynamic field labels?

I have a "medical records" content type which has a "medical process" field embedded (type=paragraphs bundle, number of values unlimited). In the paragraph bundle its has visit time, diagnosis, ...
1
vote
1answer
126 views

How to know when a field is a paragraph

I'd like to know when a field from a node it's a paragraph, I only get the type, that it's entity_reference_revisions, I use this method to get the information: \Drupal\field\Entity\...
0
votes
1answer
529 views

How to group view by field and display row results below?

We have a content type Basic Page that is supposed to be grouped by a taxonomy term field Page Type that has the following values below in a view. How can we setup the view so that the view will ...
0
votes
1answer
149 views

Getting Node Field Values from Referenced Entity within a Paragraph

I'm trying to create a featured content paragraph type, however, I can't figure out how to grab anything from the referenced node that is in my entity reference. I don't see any twig documentation ...
0
votes
1answer
46 views

Can't add instance of custom field type to entity

I have a custom field type that I'm trying to add to a custom fieldable entity. The entity works fine and I've added other fields to it, my problem is when I go to add an instance of my field to the ...
6
votes
1answer
543 views

How to add taxonomy term reference field in a custom form

In the previous version of Drupal, it was possible to reference taxonomy tags in Drupal's forms using the following option: '#autocomplete_path' => 'taxonomy/autocomplete/'.$vid, However, in the ...
0
votes
0answers
65 views

Entity Reference Field when logged out

I have an Entity Reference Field attached to a Content Type. This field references Views, and has a field format of Entity ID When I am logged in, the field appears fine, however it does not appear ...
1
vote
0answers
117 views

How to create content of content type which is a reference to a paragraph?

I want to add a content to content type (ct1) which has only one field (f1) which is a reference to a paragraph (p1), said paragraph has 4 fields: 3 numeric fields (1, 2, 3) and entity reference (er1) ...
0
votes
1answer
235 views

How to save a checkbox config_object in the schema files?

We have a custom module with the following files. It is mainly used to store a list of content types that this configuration applies to. When saving the configuration, we get the following code. How ...
0
votes
1answer
49 views

How to add currency field?

With respect to the question, can anyone suggest a remedy for the same. How can I create a field for currency(with selecting currency and text field to enter the amount) considering the fact that ...
0
votes
1answer
47 views

Adding HTML class attributes to Entity Reference field links in View

I have a view ("Tasks") that pulls in Task nodes, complete with sorting and filtering. Each Task can have multiple nodes attached via the "Related Articles" field (field_related_articles). I am trying ...
0
votes
1answer
77 views

Custom form to modify only some fields of an EntityForm

I generated an Entity following this guide. Now I would like to create a custom form to modify only some fields inside a single entity. I was thinking to create an action inside the controller calling ...
2
votes
2answers
177 views

Display a Media Entity Image from other (referencing) node in a Twig template

Seems that all found in the Internet does not work for my case. :/ In general, I need to display an Image and a Project, referenced by the node that has a reference field to my node. I have: a node ...
0
votes
0answers
33 views

EFQ with huge data

I'm using EFQ to load nodes. However when the data is huge the page naturally breaks. Is there a way to lazy load the EFQ result or any idea how to optimize it? Noting that the client doesn't want ...
0
votes
1answer
36 views

Entityreference not saved correctly inside ContentEntityForm

I was having a weird bug with my views. Some entity-references from my main-entity didn't show up in my view. I investigated further with entityQuery and came across some weird action. I can get the ...
0
votes
1answer
22 views

Clone Commerce Product Option Sets

This issue hints it's possible to clone Option sets https://www.drupal.org/project/commerce_option/issues/1319618 To reproduce: On page admin/commerce/products/option-sets Click 'clone' on any ...
0
votes
0answers
56 views

How to fetch field revision history for each change, username, created and delta value?

I would like to fetch and display the revision history for each change for each field attached to an entity. I notice in each field revision table the username and created are not there. Only the ...
3
votes
1answer
319 views

When to create schema while working with config entity?

We have a custom form mymoduleForm.php that is used to perform some logic by calling mymodule_preprocess_node(). We were able to add addCacheableDependency() and now the mymodule_preprocess_node hook ...
0
votes
0answers
26 views

Is there any way to auto generate an entity reference (behind the scenes) using only the entity ID?

I'm looking for some help with my workflow on my Drupal 7 website... Currently: 2 user types ( user type 1: u1, user type 2: u2 ) u1 creates content u2 creates a product referencing u1's content u1 ...
0
votes
1answer
155 views

How to get all the field and value of node as an array? [closed]

I am trying to render all field and value of a node as an array dynamically. How can i achieve that?
0
votes
1answer
46 views

URL Pattern in node entity reference

I have a content type A, which contains an entity reference field. That field references a content type B. I have create automatic URL paths for both content types. When I create a new node of type A,...
0
votes
0answers
17 views

How do I create a custom field/module with both Image field and HTML field?

I want to create a custom field that allows a user to upload image along with some HTML code. In the image above, I want the 'Enter the blocks' area to be a CKeditor/HTML field. The issue I'm ...
0
votes
1answer
15 views

Field help text is printed as input field title, not in separate field

On Bootstrap theme add field Text, give it any Help text, save it and you get empty field, but if you hover on the field it shows the help text on mouse tooltip. But if you e.g. make list field (text)...
0
votes
3answers
22 views

How to add content inbetween node fields on node creation?

I have a node called survey. Inbetween fields I want arbitrary text. The text is not associated with a field. I tried adding a "group", but could not find a way to add html. Then I looked at adding ...
1
vote
1answer
386 views

How to clear cache for config entity after making changes?

We have a custom form mymoduleForm that has mymodule.settings which stores some values that we need to run some logic when calling mymodule_preprocess_node() hook. The form just has a text area where ...
0
votes
1answer
24 views

How to access the existing field value in a custom field?

I have a content type which shows video in iframe from youtube. There is a field which I can enter the youtube link and it will render the iframe using the link. I have created a custom field which ...
0
votes
1answer
177 views

How to get parent node values on inline entity form hook alter?

I am using inline entity forms to create a paragraph in a node form. When I add a node I want the title of the node form to be copied to the paragraph when I click on "Add paragraph". I use ...
0
votes
0answers
21 views

Permission for Add more/Delete button for entity reference field

In my Drupal 7 Project, I want to know how can I define permissions for Add more/delete buttons and submission form for specific rules? For example users with role A are not able to see add more/...
0
votes
0answers
10 views

Saving value from computed field without array for language and cardinality

Using a computed field, I grab the value of the commerce SKU field, alter it and want to safe it. I am using varchar and my computed PHP code looks like this: $entity_field[0]['value'] = str_replace('...
2
votes
1answer
434 views

Entity queue JSONAPI pagination & How to add JSON API in views?

I'm using below modules https://www.drupal.org/project/entityqueue & JSON API Through entity queue. I have added 5 Articles. Now I would like to apply pagination on that. We are accessing via ...
0
votes
1answer
61 views

Permission issues with Custom Content Entity exposed to REST API

I hope it's not a duplicate entry. I've recently created my Custom Content Entity within a Custom module and I'm currently having trouble with permissions. (Please see permissions below) The ...
-1
votes
1answer
70 views

How to assign programatically a field to a paragraph bundle

I'm developing a module to extend paragraphs module. The idea is that the users can assign a description field to paragraphs bundles. I have create a module, and also I have create the file field....
0
votes
0answers
11 views

Views Field Ovveride - Twig Conditional

I try to use a twig conditional to check the value of a field in the custom text box for that field when I use the views UI Here is my code: {% set checkTime = "10" %} {% set confirm = "10 exists in ...
3
votes
3answers
73 views

When to use a new field on the user account or a custom table and when use user.data service?

Is there any rule when to use a new field in the user account for storing information and when to use the user.data service? My initial approach was: When the information should be editable either by ...
0
votes
0answers
11 views

Combine two views result with entity reference

I have three content type: Chart of Accounts (node: Electricity, Accountant Payable etc.) Expense Payment When I create "expense content" I reference Chart of Account (node: Accountant Payable) by ...
0
votes
0answers
10 views

Add checkboxes to nodes rendered from an entity field query

I have a content type which shows a list of other nodes connected via an entity reference field. These nodes are loaded through an entity field query in a preprocess_node module, then displayed using ...
0
votes
0answers
14 views

Why does this entity form when saved create a new instance rather than save the present one

This may be a question which only the most familiar with the module EntityForm can help with. My situation is this. I have a content type called project and each node has an entity form attached to ...
0
votes
1answer
42 views

How to force the allowed number of values of a custom field to 1

I'm creating a custom field. How do I force the number of values to 1? All the answers I find are for Drupal 7.