Tagged Questions

"Entities" is the term that in Drupal 7 is used for nodes, comments, taxonomy terms, and users. Third-party modules can then define new entity types.

learn more… | top users | synonyms (1)

0
votes
1answer
27 views

Basic “empty” entity type?

Is there a module that provides an empty entity, to which I can add my own fields. I guess it would include just an Entity-ID as a primary field, and work with other entity modules. For me, nodes ...
0
votes
2answers
28 views

D8: Best practice: Linking content types

I would appreciate suggestion for this common scenario in Drupal 8, which may be different to how I do it in Drupal 6. I don't want to do any programming. I have two content types: (1) Articles ...
1
vote
1answer
10 views

How to attach a database of data to a content / entity type

I have an sqlite database representing a collection of Foo which is immutable. I would like to be able to take this collection of Foo in the GUI of Drupal, and append a few fields onto each Foo ...
0
votes
0answers
10 views

How do enable panelizer support for a custom entity?

I've programmatically created an entity. I'd like to panelize it. What plugins do I need to write to accomplish this? Thanks!
1
vote
0answers
31 views

How to use CiviCRM Entity for searches with Facet API

I am trying to create a faceted search on CiviCRM contacts. I have created an index using the Search API module and the Facet API module, but currently the CiviCRM contacts can only be indexed on ...
0
votes
2answers
14 views

Safe change of field type from text to email or link

I have some field types that are in text and have data and I need them to be a link or email type (ie. email module.) I realize there are several approaches: change in D7 database. Use the migration ...
0
votes
1answer
36 views

Using entity form display modes

I have created a custom form display mode my_mode for nodes and wish to display node form using this mode instead of default one at a custom page. How can I do it? ...
0
votes
1answer
29 views

How do I Pass a Nid to a webform and create a token for a different field on that node?

Use Case: I have a content type called "Team" which contains an email address. I have a view that creates a link to create a webform to contact the Team member and prepopulate the email address in a ...
1
vote
1answer
32 views

Custom PHP vs Drupal Workflow for a Web Application not Websites

This question can be too ambiguous but i think many new drupal users face this difficulty like me. There are many blogs which says that Drupal is a CMF and we can use it for making Web Application ...
0
votes
0answers
6 views

Views: filter by entity property value against current timestamp

I have created custom entity type with module eck. I have created integer property (not field) of this entity which I use as timestamp. But now, I don't know how to use this timestamp in views. I ...
0
votes
1answer
35 views

How to let user create entity objects

I am in learning phase of Drupal and ofcourse the Entity API. I have created new entity named Projects. Goal is to make a project management system for software services providers. I am actually ...
1
vote
3answers
26 views

How do I create a content type that has another content type embedded inside of it?

I'm building a content type for a journal-type product. In each journal there are a number journal articles that vary from journal to journal, which have their own unique fields (like author, date, ...
0
votes
1answer
18 views

Define form for field_attach_form

I have an custome made entity function sbsl_order_entity_info() { $entitys = array(); $entitys['sbsl_delivery_information'] = array( 'label' => t('Delivery information'), ...
0
votes
1answer
17 views

How to validate deletion of custom entity?

I'm making decently complex system, where many entities are referencing each other, and I don't want to allow any broken references. That is why I would like to implement validation at entity ...
0
votes
0answers
12 views

commerce multi stock locaton data storage

Im working on a new module that will store stock levels in multiple inventory locations. What is the "best" way to store the data? Im slow to just attach and array of key/values to the product object ...
0
votes
0answers
85 views

PHP Fatal error: Call to undefined function entity_crud_get_info() in #########\docroot\sites … in xxx/modules/entity/entity.rules.inc on line 96

I am getting the above error whenever I install the module. The above errors keep occuring on every page. How can I debug it or solve it? I am clueless and working for a solution Any pointers would ...
4
votes
1answer
28 views

Why does node_add_body_field() lock down 'body' field instances to the 'node' entity type?

For a current project our taxonomy terms need a text field with a summary; naturally as there's already a body field available on nodes, I thought I'd just use that. Confusingly, 'body' doesn't ...
0
votes
1answer
12 views

How to add an image property to an entity?

I have a requirement to add a unique icon to each bundle of an entity. My entity code is very similar to the model module. I have 2 entities, one for holding the actual entity instances, another for ...
0
votes
2answers
31 views

Display a product with two columns

I want a two-column page layout to display my products which I create with 'drupal commerce'. The layout is basically the picture and similar articles on the left. Description on the right. Now, I ...
0
votes
1answer
24 views

Create entities when user account created

I am looking for a hook to fire off an Entity creation method (for an unrelated item that pertains to the user) when a user registers for the site. I'm divided between ...
0
votes
1answer
14 views

Entity reference, save only value

I am looking for the best approach to do the following: I have a content type Product and a content type Invoice, where i can reference products. I would like to be able to save the referenced ...
1
vote
0answers
28 views

how does entity_load and entity_save work with mongodb

Apologies if the question sounds too ambiguous, I am trying to migrate my nodes to MongoDB with the contributed MongoDB package's MongoDB Migrate module and am having trouble in migrating my node type ...
1
vote
1answer
16 views

Calling hook_entity_view from a theme

Is there any way to call hook_entity_view() from a theme? I tried adding the implementation to the template.php file, but the function is not called. I know I can do it via custom module, but as ...
0
votes
1answer
20 views

entity reference with multiple values?

I've added a new field to a content type, using the Entity Reference module. The new field is to allow entry of up to 4 related articles (curated content - chosen by the admin) per article. I've set ...
1
vote
2answers
23 views

Accessing Drupal 6 data using Drupal 7 entities

I have a project where we have a legacy system built in Drupal 6 that has been heavily customized, with much of the data stored in custom tables. We are currently planning a D6 to D7 upgrade, but we ...
1
vote
0answers
12 views

How to print the number of nodes of a certain type referencing to content

Using Drupal 7 and the latest Views and Entity Reference modules. I have 3 content types: - Destination - Museum - Restaurant Museum and Restaurant both reference Destination via field_destination ...
0
votes
1answer
27 views

How do I get a freshly updated value (i.e. not the cached value) using entity_metadata_wrapper?

In my code I am inserting a new value into the database directly using db_insert (i.e. inserting an entirely new row). The type of field, however, already exists in Drupal which is called ...
0
votes
0answers
20 views

EntityQuery: multiple fieldConditon with OR operator [duplicate]

It seems kinda trivial but I can find out an example on the Internet to do that kind of query: $entityQuery = new EntityFieldQuery(); $query = $entityQuery->entityCondition('entity_type', 'node'); ...
1
vote
1answer
24 views

How do I update an entity?

I have defined my own entity: 'game'; created some 'games' with entity_create; and loaded one of these 'games' into a form for editing. Now, I want to update the entity with my submit handler. Here is ...
1
vote
0answers
17 views

Adjust Entity Reference “Number of values” Based on Role

There are two roles, standard and premium. I would like the standard role to be able to select up to 10 users via the entity reference field. I would like the premium role to be able to select an ...
0
votes
2answers
46 views

Drupal 7 custom submit handler not getting triggered

I am having a problem connecting a custom submit handler to a form. I am trying to switch off redirecting after the save of an eck entity on edit form. But i am not getting that far as my submit ...
0
votes
0answers
18 views

Entityform multi check boxes only first selection comes in email

I am using the Entityforms Module for forms. I have a simple form with textfields and a checkbox multi-select field. When you check more then one checkbox, only the first one comes through the email. ...
0
votes
1answer
11 views

Taxonomy not working with the ECK module

I have created a image gallery using the ECK module and for some reason the taxonomy is not working. These are the step I follow to created the image gallery. Created a Entity called Media ...
0
votes
0answers
28 views

Drupal 7 views rendered entity + search

I created a simple custom entity with Entity Api. It has a simple db table with records, and I did an index with Search API from this. My goal is to create a view with "Search API multi-index ...
0
votes
0answers
28 views

How to use entity as form(to input data) created by ECK(Entity construction kit) module

I have created 2 entities through ECK module. and I want that entity use on my user profile(on Panel). then it is possible to call or put that entity on any form, any content type.
0
votes
1answer
88 views

Drupal 7, Entity Reference user autocomplete field

I have a custom content type that has a users: entity reference autocomplete field. For some reason the list gets populated as [realname] ([name]). In other words the realname and username tokens are ...
0
votes
1answer
49 views

multiple entity type in entity field query

how to add mutilple entity_type and bundles in EntityFieldQuery? $query->entityCondition('entity_type', 'profile2') ->entityCondition('bundle', 'user_profile'); Is there any way to do ...
0
votes
1answer
34 views

Is it possible to disable a node module?

Is it possible to disable a node module in Drupal 7? As I understand through interface it is not possible. Why node module is so important? What if I'm going to use only custom entities?
0
votes
1answer
22 views

Display blocked users to anonymous

How can I display blocked users in a template file? I have an Entity Reference field that I'd like to use to show anonymous users any blocked or active users added to the Entity Reference field. Is ...
0
votes
1answer
61 views

Drupal entity from different database

I have an existing database (which is not under my control) that i want to use as base database for my entity. However I'm stuck at getting the data from the database. There already exists a question ...
1
vote
1answer
111 views

Performance: Efficient use of EntityFieldQuery (with node_load OR node_load_multiple) to update thousands of nodes with/without conditions

I have script that queries a system called Symplectic for publications of over 30 users (each authored over 300 publications). Most of the publications are authored jointly by more than one user. I ...
0
votes
0answers
27 views

hook_node_presave() fired twice when adding new node

I've just noticed that hook_node_presave($node) is fired twice when adding new node. Once it's called from node_form_submit handler and the second time from entity_save. Turns out $node->nid is ...
0
votes
0answers
30 views

Returning a variable from a rules action

I am trying to create a variation on Fetch Entity, and I'm having trouble returning an entity. I'm just grabbing the data using db_query, and trying to return an array of nodes that are loaded, but ...
2
votes
1answer
23 views

3-rd decimal digit has disappeared in the output

I created a field, attached it to the entity: coefficient_to_second_side. Type in the database is decimal(10,3). Then I added a value: 1.001. When I select this field manually from the database, the ...
0
votes
2answers
26 views

Create referenced node on the fly in Drupal 7?

I have a node called "house" which references another node called "room". When I create a house, i.e. go to node/add/house, there will be a block where I can choose all the rooms I've created. What I ...
0
votes
2answers
35 views

How to remove entity type from drush?

How do I remove an entity type via drush? List of entity types I can get via: drush eval 'print_r(array_keys(entity_get_info()));' Array ( [0] => node [1] => taxonomy_term [2] ...
0
votes
1answer
32 views

How to list all available entity types?

How to list all available entity types in Drupal using drush? Related: get ALL node types
0
votes
1answer
29 views

Entity Form to insert data into Custom Entities

I am finally getting to Entity Construction Kit. I have built out my entity with fields, I have also set up a feed to import data into the entity. However, I also need to build a form that will push ...
0
votes
1answer
16 views

How to display a view of products that are selectable

I am working on a site that will capture site details by the sales reps. They will also use the site to order products for the customer and at the same time enter the installation criteria of the ...
1
vote
1answer
24 views

Is it a good idea to mix node api and entity api?

I have a custom module that depends on several contrib modules. One of the contrib modules has a new version out and has switched to using entities. The code in the custom module is using node api ...