All Questions
45 questions
0
votes
1
answer
106
views
Autocomplete field where title is replaced with NID
I'm using Drupal 7 and I have made autocomplete function to be called on a field.
File my_module.module:
<?php
function my_module_menu() {
$items = array();
$items['/...
0
votes
0
answers
105
views
How to create a 'new entity' form as block in or under an entity (using Eck entities)
There is this module 'Form block' that creates blocks of node add/edit forms.
However, that module is not compatible with ECK entities (or custom entities in general)
What would be a good approach to ...
1
vote
0
answers
383
views
Custom submit for Inline Entity forms
I have a CCK called "Study" that has 2 inline entity referenced fields (Info, Log).
I want to create a node and set that node/entity to the 2nd entity ref field(Log); only when a checkbox option in ...
0
votes
1
answer
278
views
Drupal 7 prepopulate form values for embedded field collection
I need to prepopulate my embedded field collection values in a specific form.
Here is what I've got so far:
<?php
// Hook form alter
function mp3_template_form_alter(&$form, &$form_state, $...
1
vote
0
answers
12
views
Inline entity extra details
I'm using the Inline Entity Form which is showing me too little information to know which entities are attached to a node. Below is a screenshot:
How can I add other details to this form i:e the ...
1
vote
1
answer
473
views
How to specify entity reference fields when programmatically submitting to user_register_form
You'd think this would be easy. I'm calling drupal_form_submit('user_register_form', $form_state)
to automatically register users after they have completed filling out a Webform.
But I have some ...
4
votes
2
answers
679
views
Not able to assign value to hidden form field using form_alter hook
I have a form in which field my_consultant_id is "Hidden integer" type field and having widget type as "Hidden field".
I am assigning the value to this field by using hook_form_alter
function ...
1
vote
1
answer
431
views
Improve extremely slow 'drupal_process_form' [closed]
I am having problem investigating why our profile edit page is damn slow.
Call Stack
# Time Memory Function Location
1 0.0003 276344 {main}( ) ...\index.php:0
2 1.6889 39666816 ...
1
vote
1
answer
191
views
Monitoring field changes in custom content type
I have custom content type with "price" field.
I would like to log the information about when the price has been changed (by administrator). All I need is date and old/new value of that field (for ...
1
vote
1
answer
101
views
Save certain registration fields elsewhere in database
This is for Drupal 7. I am trying to write my first real custom module but I'm running into some difficulty and I'm just not sure how to look for my answers.
I've created a new entity for my module (...
0
votes
0
answers
265
views
Validation of required entity reference field (putting in text that doesn't match anything passes validation)
Note: I have some more work to do to work out what the actual cause of this issue is. I can't expect anyone to help me debug it until I've done that, but I don't have time to look into it further ...
0
votes
1
answer
158
views
Setting a default checkbox value in FAPI
Trying to set a default value on an entity reference field.
$unitid = node_load($unit);
$form['field_choose_a_service']['und']['#default_value'] = $unitid;
Warning: Illegal offset type in ...
0
votes
2
answers
503
views
Call to undefined function entity_create()
i try to include a node creation form by a field attach form. So i try to load the entity of a custom content type created by the back-office with is called 'friterie'. But when i call the ...
1
vote
2
answers
962
views
how to import from csv file to EntityForm
I have two drupal sites with exactly same entity forms, I would like to import entityform submissions from site A to entityform submissions site B.
I had a look into feed modules which works very ...
3
votes
3
answers
541
views
Can I add a field collection to a block?
I have made a field collection, exported as a Feature and now I'd like to add it to a block. Does anyone have any suggestions? I have added fields to blocks through the form API, but that doesn't ...
0
votes
2
answers
1k
views
How to get $form_id based on $form_state for custom form rule?
I'm building custom form rule which is having $form_state as rule input parameter, however I would like to use drupal_form_submit() which requires $form_id.
Is it possible to fetch/compute ...
7
votes
2
answers
4k
views
How to implement a multi step approval with webforms/entityforms based on form components?
Is it possible to invoke multi-step submission workflow using either Webform or Entityform? Here is the scenario of workflows:
An employee submits the form
Superviser gets notification,...
1
vote
0
answers
474
views
Inline Entity Form - IEF - Hook Form Alter - Ordering
I've got a module that I'm developing (I'm admittedly new to module development) - where I'm appending a date to the IEF fields displayed. It looks like this so far.
function ...
1
vote
1
answer
324
views
create contact form block with prepopulated entity references and send email to content author
I am trying to create 3 forms, 2 of them should be made into blocks to show on specific content types. One for anon users and another for logged in users. The other is just a site wide contact form ...
0
votes
1
answer
882
views
Using ajax in my entityform
I have a content type called Area and another content type called apartment that has a reference to area.
I have an Investment form (using entityform module) in which users select which area; after ...
0
votes
1
answer
1k
views
Checking for an empty entity reference field in hook_node_validate
In checking whether a form field contains an entry, it has been typical to do something like:
if (sizeof($form_state['values']['my_field'][LANGUAGE_NONE]) > 0)
because an empty field would still ...
0
votes
1
answer
190
views
How to remove delete link from admin manage fields ui
I have created a new entity type and progamatically added the fields it requires. My issues is that on the Manage Fields UI (the same interfaced used for managing fields for basic pages/articles), in ...
1
vote
1
answer
1k
views
How do I pull a field value from a form field in to my inline entity form?
I'm trying to do something which I would think is fairly simple, but I'm just stumped right now, hoping somebody can help.
I have an entity called 'page', and in that entity I have inline entities ...
0
votes
1
answer
156
views
How to update the page breadcrumb when using theme page
I have an entity form(theme page to display it) .
I have used hook_node_view() to handle breadcrumbs for nodes.
But I don't find any place to handle this $breadcrumb when I have a form and a theme ...
0
votes
2
answers
736
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 ...
2
votes
3
answers
897
views
Disable ordering in entity reference (user)
I have an entity reference of widget type = autocomplete. It's a collection of users where you can add multiple users.
Now I would like to disable the ordering of the users. So you can't order the ...
0
votes
1
answer
179
views
How can I pass page variable to a form builder function in a custom module?
I have an entity page where the entity has an email field. On that page, there is a form built in a custom module. What I'd like to to is that on form submit, the module sends an email to the address ...
1
vote
1
answer
442
views
Is there a 'text or user reference' module?
Currently, I'm planning on using a text field for full names (added fields field_profile_full_name and field_profile_partner) on user entities, so that one user can link to another. However, I might ...
1
vote
1
answer
554
views
Form is not rebuilding on "Add another item" in unlimited value entity reference field
In a content type I have a field of type 'entity reference', 'auto complete' widget with unlimited values.
The whole idea was to give user an option to add referenced node items but only once, Hence ...
0
votes
3
answers
2k
views
Can I use the prepopulate module on an entityreference field in an entityform?
It may be wishful dreaming, but it would be sweet if I could pull this off. I've been banging my head against it for a while now.
Has anyone done this before?
1
vote
2
answers
1k
views
entityform submit handler with preview
I have a simple Entity Form and have added a custom submit handler:
$form['actions']['submit']['#submit'] = array('custom_submit','entityform_edit_form_submit');
That works very well. The problem is ...
3
votes
1
answer
2k
views
How to programatically submit an entityform?
My use case:
Anonymous user submits information via an entityform.
The form data ($_POST) is cached and a modal dialog box displays with a login form.
The user authenticates, and the cached form data ...
0
votes
1
answer
246
views
Using integer with multiple values in Form API
I have an integer field on a node which can take two values. The nodes are created by the users by submitting a form. I can't work out how to do this for a multiple field text value.
How do I set-up ...
3
votes
2
answers
3k
views
Implementing custom entity forms
In Making use of the admin UI, Step 3 - Implement the entity adding/editing form, it says that you need to implement "a" form with the ENTITY_TYPE_form() signature for add/edit/clone operations...
...
6
votes
6
answers
2k
views
Is there an equivalent of view modes for form editing?
I have a content type with a lot of fields. End users need to create content of this type, so I want to provide them with a simplified form so that they can create a content item and edit it without ...
3
votes
1
answer
2k
views
Tokens not working in entity form
I put together a simple entity form and am trying to enter a few default token values for fields on the form.
But when I choose something like [site:current-user:mail] from the list of available ...
1
vote
1
answer
2k
views
Have conditional fields in entityform
So it's my first time using entityform module which is awesome to create an order form.
Within my form, I have an "Entity Reference" field which prepoppulating as checkboxes from my "Node: Products". ...
1
vote
1
answer
130
views
determine value differences between form submissions
I have an entity form that user can submit multiple times. What i would like to do is during validation get current values in the database and compare with the once that user just entered. I'm using
...
0
votes
1
answer
2k
views
programmatically add an existing entity reference autocomplete field in custom form
I need to create a custom form and add an entity reference field to it. The field uses autocomplete with a view for entity selection. The field already exists on a node but i also need it in a custom ...
0
votes
1
answer
348
views
show/hide field based on user's attribute
how do I show/hide field of the form based on currently logged in user's field?
my users' profiles have start_date_field.
my form has 5 questions:
day_1_activity -> drop down
day_2_activity ->...
0
votes
1
answer
103
views
Drupal 7: how to build a form system
I want to build something like:
We have 2 type of users: staff and student.
Student logins into a drupal site, then a collection of forms presented to the student
Form type 1: Student selects a form ...
0
votes
2
answers
489
views
Reference dialog hyperlink configuration
Can anyone please direct me on how to configure References Dialog so that instead of just returning the titles of my node as plain text, they are returned as hyperlinks?
0
votes
1
answer
356
views
Processing forms together for a tree of related entities
I have EntityA which has one or more EntityB's which have one or more EntityC's. EntityB references values of EntityA and EntityC references values of EntityB. My current plan is to have an id field ...
1
vote
2
answers
431
views
Mandatory field (A or B) in a content type
I have a content type (external_document) that has an entity relation to an "event" and an entity relation to a "project."
I would like to be able to have some validation rule saying: All the ...
0
votes
1
answer
58
views
What's the best way to add an entity (of a specific type) selector to a form?
I can achieve what I want by using the EntityFieldQuery and transforming it to be the right format for a radio options array.
Is there a better way?