Posted by Fixdit on August 22, 2008 at 11:06pm
Jump to:
| Project: | Multireference CCK field |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | steve.m |
| Status: | needs review |
Issue Summary
I have a Multireference field that user's input available or pending 'tasks' into. Here is how my field should be set up:
Description part labelled 'Your tasks title'
Reference part labelled 'User assigned to task'
Additional description (selectlist) part labelled 'assigned, unassigned, completed'
Multireference would be great here, but if no data is inputted into the reference field then the pending task and select-list value disappear?! From the people who know the module, is there a suggested way I can alter the code in the meantime? Cheers!
| Attachment | Size |
|---|---|
| field_setup.png | 5.92 KB |
| no_reference_disappears.png | 5.7 KB |
Comments
#1
I'd have to look at the code again, but the point of the module is to store the references, so I think that no references = no field saved.
You could enter the text 'unassigned' if you want, and the field will be created with that text in the reference field instead of a reference.
#2
Where in the code do you suggest I insert the 'unassigned'. Would it be where the the default value should be inserted? The default value field doesn't appear to work so I will need to hard code it. The module is so perfect for my scenario, just need this unassigned value. Thanks.
#3
I meant just type "unassigned" in the field where the reference would go.
But if you want to do some programming, you could add a new condition right after this:
if ( !empty($data['r_text']) ) { // new input from text entry field$ref['id'] = 0;
$ref['text'] = $data['r_text'];
}
that goes something like:
if (empty($ref['text'])) {$ref['id'] = 0;
$ref['text'] = 'unassigned';
}
But it would be much better to make the inserted string configurable, and this behaviour an option. I'll write it in when I get a chance!
#4
OK, I added configurable support for empty references in the dev build. It only gets built nightly, so check it out sometime tomorrow.
#5
status change