Révision bad4e148
Ajouté par Assos Assos il y a environ 3 ans
drupal7/sites/all/modules/link/link.migrate.inc | ||
---|---|---|
102 | 102 |
} |
103 | 103 |
|
104 | 104 |
$language = $this->getFieldLanguage($entity, $field_info, $arguments); |
105 |
$values = array_filter($values); |
|
105 |
|
|
106 |
// URLs are numeric array elements, keyed by delta. As those elements don't |
|
107 |
// exist for empty URLs they are allowed and it's up to the developer what |
|
108 |
// data to migrate, add elements for those URLs up to the maximum delta |
|
109 |
// found. |
|
110 |
// |
|
111 |
// First of all, determine the maximum delta from non-empty URLs. |
|
112 |
$max_delta = max(array_merge(array(0), array_keys($values))); |
|
113 |
|
|
114 |
// Next, determine the max delta from arguments. |
|
115 |
foreach ($arguments as $key => $value) { |
|
116 |
if (is_array($value)) { |
|
117 |
$max_delta = max($max_delta, max(array_keys($value))); |
|
118 |
} |
|
119 |
} |
|
120 |
|
|
121 |
// Finally, add missing elements for empty URLs. |
|
122 |
for ($delta = 0; $delta <= $max_delta; $delta++) { |
|
123 |
if (!isset($values[$delta])) { |
|
124 |
$values[$delta] = ''; |
|
125 |
} |
|
126 |
} |
|
106 | 127 |
|
107 | 128 |
foreach ($values as $delta => $value) { |
108 | 129 |
$item = array(); |
Formats disponibles : Unified diff
Weekly update of contrib modules