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

Bulk edit a user reference field inside a view

I've created a view and enabled bulk edit operations. The field I am interested in changing is of type User Reference. When I attempt to bulk edit the fields, everything works as I'd expect. However, ...
0
votes
1answer
42 views

How to use views filter on an entity property

I used hook_entity_property_info_alter to add two properties to an existing entity [crm_core_contact]. I find that I can see these two new properties in the "Fields" section of views, and that my ...
0
votes
1answer
15 views

Display node with mixed languages

My nodes, with entity translation enabled, need to be able to handle a node where the content of the node is displayed differently regarding the labels and menus. Let's say I am on a french page, ...
6
votes
2answers
133 views

Why do so few code examples use the ::load($id) method for loading entities?

Over at How to get term name from a tid? the accepted answer for "how do I get the name for a Term" is this: use Drupal\taxonomy\Entity\Term; ... $term = Term::load($tid); ... That's really nice, ...
0
votes
0answers
10 views

Entityform Revisions create a new revision by default?

I just installed the Entityform Revisions module for Drupal 7. All it does is provide revisions for entityform submissions. Works as described. However, unlike the setup for a content type, there ...
1
vote
1answer
36 views

For external data, should I create custom table or new entity type?

I have a database that exists outside of Drupal. I wish to show the summarized data from that database on Drupal. At a high level, you can see the structure of the data below. | Seller's ID | ...
0
votes
1answer
22 views

Get list of nodes by field-collection value

I am having field_feature as a collection of fields (field-collection) in a content type called 'watches'. Those fields are, field_water_resistance -> water_resistance(Term Reference) field_gender ...
1
vote
1answer
23 views

Get all nodes where date field matches month and year

I have a content type with a date field (myFieldDate) whose values are timestamps. (I'm collecting only day, month, and year.) I have a custom form where I have a select list to select month and year....
0
votes
0answers
15 views

How are new view modes numbered when adding to bundle-less, custom entity

I have created a bundle-less entity type and added two new view modes. I plan to programmatically use them to populate a radio button using this logic (How can I get a list of all available entity ...
0
votes
1answer
21 views

Create entity view block

I have 2 content types: schools and courses. On the schools content type, I created a field called 'Courses At This School' which is an entity reference field to the courses content type. So, I edit ...
0
votes
1answer
23 views

Update user profile picture using entity_metadata_wrapper

I am trying to update the user profile picture using entity_metadata_wrapper. But I am getting "Unknown data property picture." error. When I check the user property info, I cant see the ...
0
votes
1answer
34 views

Update entity properties fetched with entityTypeManager()->getStorage

I am loading all entity types I need to update like below $current_fruit = \Drupal::entityTypeManager()->getStorage('fruit')->loadByProperties(['status' => '1']); Then I update them in a ...
0
votes
0answers
22 views

Two way referencing content type with entity reference fields - show all references on node edit form

I am creating a website that has a content type called “School” which will hold names and details of schools. I also have a entity type called “courses”, which holds the names of courses that the ...
0
votes
1answer
31 views

How to display current pages the media entity is referenced during deletion?

We are using Media Entity module that provides a Document media bundle. On our Article content type, we have created an Entity Reference field to Media that is set to Document media bundle. When you ...
2
votes
2answers
33 views

How to not have “-None-” as default in the entity reference display widget

I spend hours to figure this out but no result. I want to auto-populate a field using entity references and views. A field has a user entity reference Using filters, I made a view narrowing down ...
0
votes
0answers
16 views

Trying to access and print a value from an entity reference field on a custom block [duplicate]

I have a custom block with an entity referenced field that I have added and I'm trying to fetch the value from the referenced node. I have tried different syntax in trying to access and print the ...
0
votes
0answers
25 views

Edit entity in body field pop-up box

What I am trying to do is have an entity embed button in a body field that lets you create, edit, and embed an entity from the click of a button, in a body field. I have the creation and embedding ...
0
votes
1answer
46 views

Unable to perform update when adding new menu field

I'm attempting to add a custom image field to my menu from a custom module like so function my_module_entity_base_field_info(EntityTypeInterface $entity_type) { $fields = array(); if ($...
0
votes
1answer
21 views

How to create a node with mulitple field-collection items?

I've a content type having filed collection item (3 fields of 5 sets). Created a custom module form, when user submits that form, it should create a node with all 5 set field collection items. So far ...
2
votes
1answer
135 views

What is the difference between getValue() and referencedEntities() to fetch paragraphs?

What is the difference between using getValue() and referencedEntities() in order to get the paragraph on a node? See example below. Both examples are used in a node template such as node--page--full....
1
vote
1answer
35 views

How to add constrain validation on entity_create

So in my BaseFieldDefinition I have this below $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Name')) ->setDescription(t('The name of the Crypto entity.')) ->...
2
votes
2answers
152 views

Finding the host node of a paragraph

I'm trying to find all the absolute URLs in a site (in wysiwyg content, url fields, config) to convert them into relative URLs later via manual administration. All the URLs in question are within the ...
0
votes
1answer
46 views

Plugin Derivatives For Queue and Migration Plugins

I've created a custom Content Entity and a custom Content Entity Type, basically I'm mirroring the Node module but the purpose of this is to have external data to be synced with this setup(not using ...
0
votes
1answer
111 views

Custom node migration for multi-value imagefield

I'm working on a custom migration module to "link" images to the imagefield. It's work well for an unique value image field like this: field_illus_vdl: - plugin: d6_field_file source: ...
3
votes
1answer
41 views

Only render translated nodes, prevent rendering of base language node

Having an entity reference, Drupal 8 automatically renders the base language of a referenced entity if it isn't translated yet. Is there a way to globally prevent that? So if there is ContentType1 ...
0
votes
2answers
114 views

Error during entup when removing a field added in entity_base_field_info

I am removing a field that was added using hook_base_field_info: /** * Implements hook_entity_base_field_info(). */ function MYMODULE_entity_base_field_info(EntityTypeInterface $entity_type) { $...
0
votes
0answers
53 views

I'm getting an error TypeError: DateTime::__construct() expects parameter 1 to be string when trying to format the date.I

Using entity reference I'm trying to fetch the field_date of each node and print it to twig. function _preprocess_newsdesk_node($entity, &$variables) { $entityStorage = \Drupal::service('...
1
vote
1answer
22 views

Where does the value of entity come from in a field of a content type?

Where does the value of entity come from in a field of a content type? I am trying to understand how the property (if it is a property) entity is related to the field. This question is more ...
1
vote
1answer
38 views

Where to find all possible keys for BaseFieldDefinition -> setSettings()

I am a noob to Drupal. I am trying to create a module and am currently in the process of creating a content entity and defining its base fields. Can anyone tell me where I can find a list of possible ...
0
votes
0answers
43 views

Link reference to taxonomy term to a node

I have this content type Project that can have one or more references to a taxonomy term District. For each of these terms they reference another content type just once, District Page. Project -(...
0
votes
0answers
32 views

Inline Entity Form not saved on node/add

I have a cck called "Biological Collection" that has a fieldset of Inline Entity Fields(Blood, saliva, etc..) all referencing to the same cck "Collection Fieldset". (please see screenshot1) While ...
1
vote
1answer
128 views

How can I change a field cardinality?

I have two content types: Person and Office with existing content. The Person content type has an entity reference field to Office nodes, which only allows a single reference. I need to change this to ...
0
votes
0answers
61 views

How to upload profile picture directly from user-view

How can I allow users to update their profile-picture directly from the user view, without navigating specially to the edit-account page? Each user on site has a gallery of uploaded pictures. A ...
0
votes
1answer
48 views

How to hide child field collection using jquery

I have 3 field collection 1st is parent in that having other 2 is child field collections. parent FC: Student Info child FC 1: English Info child FC 1: Maths Info Set field setting "unlimited" to ...
0
votes
0answers
16 views

Entityqueryfield pagination url pattern

I have a entityfieldquery which I am using to load multiple nodes with the default pager. The problem I have is that the pagination url pattern is not very user friendly e.g. http://localhost/efqpage?...
0
votes
0answers
25 views

Don't save Inline Entity Form when all fields in the ief form is left empty

How do I not save the InlineEntityForm(ief) in a node form, if all the fields in the ief form are left empty? None of the fields in ief are mandatory, ief is always open (ief - single value). The ...
-1
votes
3answers
70 views

How to get the length of a field collection array

I'm using Drupal 7 and want to get the length of the field collection array. How can I get it? Can someone provide the code snippet for that? This is the code that prints the table. <!DOCTYPE ...
1
vote
1answer
36 views

Use an Address Field with 3 lines for the street

I'm working on an Entity where I created a field containing Address informations (like country, city and street). The default Address Type in Drupal 8 supports only 2 lines for the street information....
0
votes
1answer
209 views

Create new child field collection programmatically

I have 2 field collections (Parent and child) Parent Field collection: Test Student Info machine name: field_test_student_info Child Field collection: Marks machine name: field_marks In parent field ...
0
votes
0answers
56 views

Paragraph fields are not properly mapping into the custom block using migration plus yaml

I have created the paragraphs using migration plus module and it is working fine. To map the above created paragraphs to my custom block, I wrote the below YML file. Other block fields are mapping ...
0
votes
1answer
71 views

Add new field collection item in existing Field collection

I have 1 field collection Field collection: CKT Info child2 machine name: field_ckt_info_child2 In that have 2 fields: Field1: English CKT child2 machine name: field_eng Field2: Maths CKT ...
1
vote
1answer
82 views

How do I unlock a field?

In Drupal 7 it is possible to use: $field_name = 'field_name'; $field = field_read_field($field_name); $field['locked'] = 0; // 0: unlock; 1: lock. field_update_field($field); How to do this in ...
0
votes
0answers
25 views

Remove a specific field

In my backend, I have an error "node.field_descriptif need to uninstall", but I don't have this field anymore, but it is in the database. How can I do that? EDIT : I tried drush entup This is ...
-1
votes
1answer
21 views

Custom post type form field to reference other content type field values

I have two custom content types. Comic books borrowed, as an application form to borrow comics Available comic books and their respective available issues My goal is to have the website editors ...
0
votes
1answer
40 views

how to get values from two content types using one entity reference

I'm using Drupal 7 and have 3 content types - Product Purchase Sales In sales content type, I'm using entity reference I want to fetch and display "product name" from Product content type and "...
0
votes
1answer
31 views

Custom entity form submit handler not being invoked

I'm trying to attach a submit handler to an entity form (language_delete_form) provided by the ConfigurableLanguage config entity. On the form alter function for that form, the top-level submit ...
0
votes
0answers
33 views

Computed Field on Custom Entity

I want to make a computed field to be pointed by 'label' key on my custom entity. * entity_keys = { * "id" = "id", * "label" = "codigo", * "uuid" = "uuid", * "uid" = "user_id", ...
0
votes
0answers
12 views

Problem trying to disabling field translation

I hope somebody already met the same problem and will be able to guide me. So here is my problem: I have a site with multiple content types. Some of these CT are using node translation, whereas other ...
1
vote
0answers
82 views

How can I drag and drop sort nodes and output result as JSON?

I have tried the DraggableViews module, but it creates a new table in the database that is not related with the entity fields of my entity and I'm using AngularJS as front-end with JSON API calls, so ...
-1
votes
1answer
47 views

Custom Jquery for Entity reference form

How do I add Custom Jquery On-click event on a checkbox which is inside an Entity reference form? In the below screenshot, "Study" is the Parent node. "Demographics", "Biological collections", etc. ...