Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-9511 Content liftup entities #828

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

declare(strict_types=1);

use Drupal\paragraphs\Entity\Paragraph;

/**
* Implements hook_install().
*/
Expand Down Expand Up @@ -86,6 +88,24 @@ function helfi_platform_config_base_update_9002() : void {
* UHF-9511 Uninstall content_liftup paragraph.
*/
function helfi_platform_config_base_update_9003() : void {

// Remove stale content liftup paragraph entities.
$paragraph_ids = \Drupal::entityQuery('paragraph')
->condition('type', 'content_liftup')
->accessCheck(FALSE)
->execute();

if (!empty($paragraph_ids)) {
// Load the paragraphs.
$paragraphs = Paragraph::loadMultiple($paragraph_ids);

// Delete the paragraphs.
foreach ($paragraphs as $paragraph) {
$paragraph->delete();
}
}

// Uninstall helfi_paragraphs_content_liftup module.
$module_installer = Drupal::service('module_installer');
$module_installer->uninstall(['helfi_paragraphs_content_liftup']);

Expand Down