Révision b8087750
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views_bulk_operations/actions/modify.action.inc | ||
---|---|---|
55 | 55 |
} |
56 | 56 |
} |
57 | 57 |
|
58 |
if (in_array($key, $context['append']['bundle_' . $bundle_name]) && !empty($entity->$key)) {
|
|
58 |
if (in_array($key, $context['append']['bundle_' . $bundle_name]) && !empty($entity->{$key})) {
|
|
59 | 59 |
$entity->{$key}[$language] = array_merge($entity->{$key}[$language], $pseudo_entity->{$key}[$language]); |
60 | 60 |
|
61 | 61 |
// Check if we breached cardinality, and notify the user. |
... | ... | |
96 | 96 |
|
97 | 97 |
if (!empty($context['selected']['properties'])) { |
98 | 98 |
foreach ($context['selected']['properties'] as $key) { |
99 |
if (!$wrapper->$key->access('update')) {
|
|
99 |
if (!$wrapper->{$key}->access('update')) {
|
|
100 | 100 |
// No access. |
101 | 101 |
continue; |
102 | 102 |
} |
103 | 103 |
|
104 | 104 |
if (in_array($key, $context['append']['properties'])) { |
105 |
$old_values = $wrapper->$key->value();
|
|
106 |
$wrapper->$key->set($context['properties'][$key]);
|
|
105 |
$old_values = $wrapper->{$key}->value();
|
|
106 |
$wrapper->{$key}->set($context['properties'][$key]);
|
|
107 | 107 |
$new_values = $wrapper->{$key}->value(); |
108 | 108 |
$all_values = array_merge($old_values, $new_values); |
109 |
$wrapper->$key->set($all_values);
|
|
109 |
$wrapper->{$key}->set($all_values);
|
|
110 | 110 |
} |
111 | 111 |
else { |
112 | 112 |
$value = $context['properties'][$key]; |
113 | 113 |
if (is_string($value)) { |
114 | 114 |
$value = token_replace($value, array($context['entity_type'] => $entity), array('sanitize' => FALSE)); |
115 | 115 |
} |
116 |
$wrapper->$key->set($value);
|
|
116 |
$wrapper->{$key}->set($value);
|
|
117 | 117 |
} |
118 | 118 |
} |
119 | 119 |
} |
... | ... | |
193 | 193 |
$form['properties'][$key]['#maxlength'] = 255; |
194 | 194 |
} |
195 | 195 |
|
196 |
if (!empty($property['options list'])) { |
|
196 |
if (!empty($property['options list']) && is_callable($property['options list'])) {
|
|
197 | 197 |
$form['properties'][$key]['#type'] = 'select'; |
198 |
$form['properties'][$key]['#options'] = $property['options list']($key, array());
|
|
198 |
$form['properties'][$key]['#options'] = call_user_func_array($property['options list'], array($key, array()));
|
|
199 | 199 |
|
200 | 200 |
if ($property['type'] == 'list') { |
201 | 201 |
$form['properties'][$key]['#type'] = 'checkboxes'; |
... | ... | |
405 | 405 |
$properties = _views_bulk_operations_modify_action_get_properties($form_state['entity_type']); |
406 | 406 |
foreach ($form_state['selected']['properties'] as $key) { |
407 | 407 |
$value = $form_state['values']['properties'][$key]; |
408 |
if (!$wrapper->$key->validate($value)) {
|
|
408 |
if (!$wrapper->{$key}->validate($value)) {
|
|
409 | 409 |
$label = $properties[$key]['label']; |
410 | 410 |
form_set_error('properties][' . $key, t('%label contains an invalid value.', array('%label' => $label))); |
411 | 411 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules