Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
field system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Oct 2009 at 07:11 UTC
Updated:
29 Jul 2014 at 18:30 UTC
Code seen in Drupal's core (text.module):
/**
* Implement hook_field_info().
*/
function text_field_info() {
return array(
'text' => array(
'label' => t('Text'),
'description' => t('This field stores varchar text in the database.'),
'settings' => array('max_length' => 255),
'instance_settings' => array('text_processing' => 0),
.
.
.
/**
* Implement hook_field_widget_info().
*/
function text_field_widget_info() {
return array(
'text_textfield' => array(
'label' => t('Text field'),
'field types' => array('text'),
'settings' => array('size' => 60),
.
.
.
Why is 'field types' with space but 'instance_settings' with underscore?
Comments
Comment #1
aspilicious commentedAnyone?
Comment #2
sunMost of array keys in Drupal core use spaces, not underscores. But with most, I merely mean hook_menu() and other things. Form API comes with its own nightmare of inconsistent key names.
Would be lovely to fix that. But not sure whether it'll be accepted.
Comment #3
aspilicious commentedAPI change? In that case we have to push this to D8...
Comment #4
mr.baileysUnfortunate, but too late in the game to change this so bumping to D8.
Comment #5
pillarsdotnet commentedRe-titling.
Comment #6
tim.plunkettsub
Comment #7
traviscarden commentedComment #8
swentel commentedD8 has settled doing everything with underscores, so this is fine already.