Skip to content

Commit

Permalink
fix(shs-5808): change how webform configuration list is obtained
Browse files Browse the repository at this point in the history
  • Loading branch information
cienvaras committed Dec 6, 2024
1 parent 9bc58a2 commit cb83b2f
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* su_humsci_profile.install
*/

use Drupal\Core\Database\Database;
use Drupal\Core\DrupalKernel;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
Expand Down Expand Up @@ -1093,15 +1092,12 @@ function su_humsci_profile_update_9716() {
}

// Remove webform existing config - needs to be done before uninstall.
$query = \Drupal::database()
->select('config', 'c')
->fields('c', ['name'])
->condition('name', '%' . Database::getConnection()->escapeLike('webform') . '%', 'LIKE')
->execute();
$config_names = $query->fetchCol();

$config_factory = \Drupal::configFactory();

$config_names = array_filter($config_factory->listAll(), function ($item) {
return str_contains($item, 'webform');
});

foreach ($config_names as $config) {
$config_factory->getEditable($config)->delete();
$message = t('Deleted @config', [
Expand Down

0 comments on commit cb83b2f

Please sign in to comment.