Compatibility with PHP 5.4
This commit is contained in:
parent
43345195e4
commit
2c186c8bd5
2 changed files with 4 additions and 2 deletions
|
@ -1294,7 +1294,8 @@ function content_field_edit_form_validate($form, &$form_state) {
|
||||||
elseif (!empty($form_values['default_value_widget'])) {
|
elseif (!empty($form_values['default_value_widget'])) {
|
||||||
// Fields that handle their own multiple values may use an expected
|
// Fields that handle their own multiple values may use an expected
|
||||||
// value as the top-level key, so just pop off the top element.
|
// value as the top-level key, so just pop off the top element.
|
||||||
$key = array_shift(array_keys($form_values['default_value_widget']));
|
$keys = array_keys($form_values['default_value_widget']);
|
||||||
|
$key = array_shift($keys);
|
||||||
$default_value = $form_values['default_value_widget'][$key];
|
$default_value = $form_values['default_value_widget'][$key];
|
||||||
$is_code = FALSE;
|
$is_code = FALSE;
|
||||||
form_set_value(array('#parents' => array('default_value_php')), '', $form_state);
|
form_set_value(array('#parents' => array('default_value_php')), '', $form_state);
|
||||||
|
|
|
@ -546,7 +546,8 @@ function content_field_instance_delete($field_name, $type_name, $rebuild = TRUE)
|
||||||
include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc');
|
include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc');
|
||||||
|
|
||||||
// Get the previous field value.
|
// Get the previous field value.
|
||||||
$field = array_pop(content_field_instance_read(array('field_name' => $field_name, 'type_name' => $type_name)));
|
$fields = content_field_instance_read(array('field_name' => $field_name, 'type_name' => $type_name));
|
||||||
|
$field = array_pop($fields);
|
||||||
|
|
||||||
// Invoke hook_content_fieldapi().
|
// Invoke hook_content_fieldapi().
|
||||||
module_invoke_all('content_fieldapi', 'delete instance', $field);
|
module_invoke_all('content_fieldapi', 'delete instance', $field);
|
||||||
|
|
Reference in a new issue