activating migration transient
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2024-12-11 10:00:48 +01:00
parent b58b1536cd
commit 027301a4f5

View File

@ -3,7 +3,7 @@
function unique_migration_persons()
{
$transient = 'f71r4_my_onetime_check_metiers_45';
$transient = 'f71r4_my_onetime_check_metiers_4577777';
if (!get_transient($transient)) {
set_transient($transient, 'locked', 600);
@ -12,7 +12,7 @@ function unique_migration_persons()
populate_personns();
}
}
// add_action('init', 'unique_migration_persons');
add_action('init', 'unique_migration_persons');
function build_ids_from_csv($csv_file)
{
@ -52,10 +52,10 @@ function clean_persons()
$persons = get_field('company_members', $postId);
if (!$persons) continue;
if ($postId === '119' || $postId === 8203) {
$field_key = 'field_670d268f2b324';
update_field($field_key, [], $postId);
}
// if ($postId === '119' || $postId === 8203) {
// }
}
}
@ -100,7 +100,7 @@ function populate_personns()
$row = array_combine($headers, $data);
if ($row['company_id (NEW)'] === '119') {
// if ($row['company_id (NEW)'] === '119') {
$post_fr_ID = $row['company_id (NEW)'] ?? null;
if (!$post_fr_ID) continue;
@ -140,7 +140,7 @@ function populate_personns()
// Fermer le fichier CSV
fclose($handle);
}
// }
}