Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
220
Merge Requests
220
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
6a686533
Commit
6a686533
authored
Jul 11, 2009
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#516124
by yched: Clean up some Field API TODOs and remove unused APIs.
parent
f6ccf978
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
34 deletions
+3
-34
modules/field/field.api.php
modules/field/field.api.php
+1
-5
modules/field/field.attach.inc
modules/field/field.attach.inc
+0
-10
modules/field/field.crud.inc
modules/field/field.crud.inc
+1
-4
modules/field/field.default.inc
modules/field/field.default.inc
+0
-6
modules/field/field.form.inc
modules/field/field.form.inc
+0
-2
modules/field/field.module
modules/field/field.module
+1
-7
No files found.
modules/field/field.api.php
View file @
6a686533
...
...
@@ -368,9 +368,6 @@ function hook_field_validate($obj_type, $object, $field, $instance, $items, &$er
/**
* Define custom presave behavior for this module's field types.
*
* TODO: The behavior of this hook is going to change (see
* field_attach_presave()).
*
* @param $obj_type
* The type of $object.
* @param $object
...
...
@@ -507,8 +504,7 @@ function hook_field_prepare_translation($obj_type, $object, $field, $instance, $
* Field API will call this function as many times as needed.
*
* @param $form
* The entire form array, $form['#node'] holds node information.
* TODO: Not #node any more.
* The entire form array.
* @param $form_state
* The form_state, $form_state['values'][$field['field_name']]
* holds the field's form values.
...
...
modules/field/field.attach.inc
View file @
6a686533
...
...
@@ -6,12 +6,6 @@
* Field attach API, allowing objects (nodes, users, ...) to be 'fieldable'.
*/
// TODO D7 : consistency - do field_attach_functions return a value or alter in place ?
// TODO D7 : consistency - some of these functions process individual fields
// and others process the combined value of all fields.
// Should all iteration through available fields be done here instead of in Field?
/**
* Exception thrown by field_attach_validate() on field validation errors.
*/
...
...
@@ -364,7 +358,6 @@ function _field_invoke_multiple_default($op, $obj_type, $objects, &$a = NULL, &$
* field_attach_view().
*/
function
field_attach_form
(
$obj_type
,
$object
,
&
$form
,
&
$form_state
)
{
// TODO : something's not right here : do we alter the form or return a value ?
$form
+=
(
array
)
_field_invoke_default
(
'form'
,
$obj_type
,
$object
,
$form
,
$form_state
);
// Let other modules make changes to the form.
...
...
@@ -512,7 +505,6 @@ function field_attach_load_revision($obj_type, $objects) {
*/
function
field_attach_validate
(
$obj_type
,
$object
)
{
$errors
=
array
();
_field_invoke_default
(
'validate'
,
$obj_type
,
$object
,
$errors
);
_field_invoke
(
'validate'
,
$obj_type
,
$object
,
$errors
);
// Let other modules validate the object.
...
...
@@ -611,8 +603,6 @@ function field_attach_submit($obj_type, $object, $form, &$form_state) {
* The object with fields to process.
*/
function
field_attach_presave
(
$obj_type
,
$object
)
{
// TODO : to my knowledge, no field module has any use for 'presave' on D6.
// should we keep this ?
_field_invoke
(
'presave'
,
$obj_type
,
$object
);
// Let other modules act on presaving the object.
...
...
modules/field/field.crud.inc
View file @
6a686533
...
...
@@ -102,9 +102,6 @@
* to other fields when used with this bundle. The weight affects
* ordering in both forms (see field_attach_form()) and rendered output
* (see field_attach_view()).
* TODO - this should probably become a context setting so that
* the weight can be different in the form and in various other
* contexts.
* - required (integer)
* TRUE if a value for this field is required when used with this
* bundle, FALSE otherwise. Currently, required-ness is only enforced
...
...
@@ -276,7 +273,7 @@ function field_create_field($field) {
// Invoke external hooks after the cache is cleared for API consistency.
module_invoke_all
(
'field_create_field'
,
$field
);
return
$field
;
}
...
...
modules/field/field.default.inc
View file @
6a686533
...
...
@@ -21,15 +21,9 @@ function field_default_extract_form_values($obj_type, $object, $field, $instance
}
}
function
field_default_validate
(
$obj_type
,
$object
,
$field
,
$instance
,
$items
)
{
// TODO: here we could validate that required fields are filled in (for programmatic save)
}
function
field_default_submit
(
$obj_type
,
$object
,
$field
,
$instance
,
&
$items
,
$form
,
&
$form_state
)
{
$field_name
=
$field
[
'field_name'
];
// TODO: should me move what's below to __extract_form_values ?
// Reorder items to account for drag-n-drop reordering.
if
(
field_behaviors_widget
(
'multiple values'
,
$instance
)
==
FIELD_BEHAVIOR_DEFAULT
)
{
$items
=
_field_sort_items
(
$field
,
$items
);
...
...
modules/field/field.form.inc
View file @
6a686533
...
...
@@ -6,8 +6,6 @@
* Field forms management.
*/
// TODO : merge with field.default.inc ?
/**
* Create a separate form element for each field.
*/
...
...
modules/field/field.module
View file @
6a686533
...
...
@@ -323,18 +323,12 @@ function _field_sort_items_value_helper($a, $b) {
/**
* Registry of available build modes.
* TODO : move into hook_fieldable_info() ?
*/
function
field_build_modes
(
$obj_type
)
{
static
$info
;
if
(
!
isset
(
$info
[
$obj_type
]))
{
// module_invoke_all messes numeric keys.
// TODO : revisit when we move away from numeric build modes.
$info
[
$obj_type
]
=
array
();
foreach
(
module_implements
(
'field_build_modes'
)
as
$module
)
{
$info
[
$obj_type
]
+=
module_invoke
(
$module
,
'field_build_modes'
,
$obj_type
);
}
$info
[
$obj_type
]
=
module_invoke_all
(
'field_build_modes'
,
$obj_type
);
}
return
$info
[
$obj_type
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment