Skip to content
Snippets Groups Projects
Commit deeebd53 authored by Aaron Zinck's avatar Aaron Zinck Committed by Miro Dietiker
Browse files

Issue #3041868 by scott_euser, alesr, azinck, blueblot, priyanka1989, corE,...

Issue #3041868 by scott_euser, alesr, azinck, blueblot, priyanka1989, corE, websiteworkspace, alberto56, jasonlttl, JimCraner, bkosborne, David Radcliffe, cedrichillion, fonant, ronan.orb, ccshannon, tomsaw, alasserr, hunterbuchanan, Jon Pollard, bander2, ahebrank, jurgenhaas: Update function 8018 caught in endless loop
parent 36e7cbc7
No related branches found
Tags 1.0.0-rc1
No related merge requests found
......@@ -316,18 +316,28 @@ function paragraphs_update_8018(&$sandbox) {
'binary' => FALSE,
'not null' => FALSE,
];
$database->schema()
->addField('paragraphs_item_revision_field_data', $field_name, $column_schema);
// Create fields if they don't already exist.
if (!$database->schema()->fieldExists('paragraphs_item_revision_field_data', $field_name)) {
$database->schema()
->addField('paragraphs_item_revision_field_data', $field_name, $column_schema);
}
}
// Get all paragraphs to update.
$paragraphs = \Drupal::entityQuery('paragraph')
->count()
->execute();
$paragraphs = \Drupal::database()->select('paragraphs_item_field_data', 'p')
->countQuery()
->execute()
->fetchField(0);
$sandbox['total'] = $paragraphs;
$sandbox['current'] = 0;
}
// Do not continue if no paragraphs are found.
if (empty($sandbox['total'])) {
$sandbox['#finished'] = 1;
return t('No Paragraphs to be processed.');
}
$paragraphs_per_batch = 50;
$query = $database->select('paragraphs_item_field_data', 'p');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment