Révision 5d940405
Ajouté par Assos Assos il y a environ 4 ans
drupal7/sites/all/modules/media/media.install | ||
---|---|---|
112 | 112 |
|
113 | 113 |
if ($phase == 'update') { |
114 | 114 |
$info = system_get_info('module', 'file_entity'); |
115 |
$file_entity_installed_date = $info['datestamp']; |
|
116 | 115 |
$file_entity_version = $info['version']; |
117 | 116 |
$file_entity_minimum_date = 1495439635; |
117 |
if (isset($info['datestamp'])) { |
|
118 |
$file_entity_installed_date = $info['datestamp']; |
|
119 |
} |
|
120 |
else { |
|
121 |
if (strpos($file_entity_version, '7.x-3') !== FALSE) { |
|
122 |
// Good version, any number that passes the condition is good. |
|
123 |
$file_entity_installed_date = $file_entity_minimum_date + 1; |
|
124 |
} |
|
125 |
else { |
|
126 |
// Check version 2 release and parse into a number. |
|
127 |
// No need to check version 1 as that's checked below. |
|
128 |
$version_number = str_replace('7.x-2.', '', $file_entity_version); |
|
129 |
if (is_numeric($version_number)) { |
|
130 |
// Plain number, so good version. |
|
131 |
$file_entity_installed_date = $file_entity_minimum_date + 1; |
|
132 |
} |
|
133 |
else { |
|
134 |
// Bad version or release (beta, alpha, unstable...). |
|
135 |
$file_entity_installed_date = $file_entity_minimum_date - 1; |
|
136 |
} |
|
137 |
} |
|
138 |
} |
|
139 |
|
|
118 | 140 |
// Time of 2017-05-22 07:53:55 is most recent commit in 7.x-2.0. |
119 | 141 |
if ($file_entity_installed_date < $file_entity_minimum_date) { |
120 | 142 |
$description = $t('Media 2.10 or newer requires <a href="@url">File entity 2.0 or newer (2.4 or higher recommended)</a>. Please download the correct version and make sure you have deleted the file_entity folder inside the media module directory.', array('@url' => 'http://drupal.org/project/file_entity')); |
... | ... | |
135 | 157 |
} |
136 | 158 |
} |
137 | 159 |
|
138 |
if (module_exists('entity_translation')) { |
|
139 |
if ($phase == 'update' || $phase == 'install' || $phase == 'runtime' ) { |
|
140 |
$entity_translation_info = system_get_info('module', 'entity_translation'); |
|
141 |
$et_installed_version = $entity_translation_info['version']; |
|
142 |
$et_installed_datestamp = $entity_translation_info['datestamp']; |
|
143 |
$march3rd_entity_translation_timestamp = 1488530885; |
|
144 |
if (!isset($entity_translation_info['version']) || !isset($entity_translation_info['datestamp'])) { |
|
145 |
$et_installed_datestamp = 1488530884; |
|
146 |
} |
|
147 |
|
|
148 |
if ($et_installed_datestamp < $march3rd_entity_translation_timestamp) { |
|
149 |
$description = $t('Your entity_translation installation version: %version is too old. media requires entity_translation at least beta6 from march 3 2017 or newer. Your choice is to either upgrade entity_translation or to disable it.', array('%version' => $et_installed_version)); |
|
150 |
$requirements['entity_translation']['description'] = $description; |
|
151 |
$requirements['entity_translation']['severity'] = REQUIREMENT_ERROR; |
|
152 |
$requirements['entity_translation']['value'] = $et_installed_version; |
|
153 |
$requirements['entity_translation']['title'] = $t('Entity translation (when installed) with Media'); |
|
154 |
drupal_set_message($description, 'error', TRUE); |
|
155 |
} |
|
156 |
} |
|
157 |
} |
|
158 | 160 |
return $requirements; |
159 | 161 |
} |
160 | 162 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules