Commit 8252de08 authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3276117 by RenatoG: Create a hook update to set the new setting weight...

Issue #3276117 by RenatoG: Create a hook update to set the new setting weight for sites that were using before
parent d3f0f7a6
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -412,3 +412,25 @@ function block_class_update_20015() {
  $config->save();

}

/**
 * Set the default value for weight items.
 */
function block_class_update_20016() {

  // Get the config object.
  $config = \Drupal::configFactory()->getEditable('block_class.settings');

  // Set the default value for weight on attributes.
  $config->set('weight_attributes', '');

  // Set the default value for weight on items.
  $config->set('weight_class', '');

  // Set the default value for weight on ID.
  $config->set('weight_id', '');

  // Save.
  $config->save();

}
+4 −1
Original line number Diff line number Diff line
@@ -11,3 +11,6 @@ qty_classes_per_block: 10
maxlength_attributes: FALSE
maxlength_block_class_field: 255
maxlength_id: 255
weight_attributes: ''
weight_class: ''
weight_id: ''
 No newline at end of file