lingotek.post_update.php in Lingotek Translation 8
Same filename and directory in other branches
- 8.2 lingotek.post_update.php
- 4.0.x lingotek.post_update.php
- 3.0.x lingotek.post_update.php
- 3.1.x lingotek.post_update.php
- 3.2.x lingotek.post_update.php
- 3.3.x lingotek.post_update.php
- 3.4.x lingotek.post_update.php
- 3.5.x lingotek.post_update.php
- 3.6.x lingotek.post_update.php
- 3.7.x lingotek.post_update.php
- 3.8.x lingotek.post_update.php
File
lingotek.post_update.phpView source
<?php
use Drupal\lingotek\Entity\LingotekConfigMetadata;
/**
* @addtogroup updates-8.x-1.10
* @{
*/
/**
* Fix lingotek metadata entities with dependencies on config entities which
* names were wrongly calculated.
*/
function lingotek_post_update_lingotek_metadata_dependencies() {
$metadatas = LingotekConfigMetadata::loadMultiple();
array_walk($metadatas, function (LingotekConfigMetadata $metadata) {
$old_dependencies = $metadata
->getDependencies();
$new_dependencies = $metadata
->calculateDependencies()
->getDependencies();
if ($old_dependencies !== $new_dependencies) {
$metadata
->save();
}
});
}
Functions
Name | Description |
---|---|
lingotek_post_update_lingotek_metadata_dependencies | Fix lingotek metadata entities with dependencies on config entities which names were wrongly calculated. |