
| Current Path : /var/www/html/c12park/web/modules/contrib/webform/modules/webform_node/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/c12park/web/modules/contrib/webform/modules/webform_node/webform_node.install |
<?php
/**
* @file
* Install, update and uninstall functions for the webform node module.
*/
/**
* Implements hook_requirements().
*/
function webform_node_requirements($phase) {
$requirements = [];
// Throw error if Webform (webform) content type is already exists which will
// happen during a D7 to D8 content migration.
// @see https://www.drupal.org/node/2856599
if ($phase === 'install') {
$manager = \Drupal::entityTypeManager();
if ($manager->hasDefinition('node_type') && ($node_type = $manager->getStorage('node_type')->load('webform'))) {
$requirements['webform_node'] = [
'title' => t('Webform Node'),
'value' => t('%title content type already exists', ['%title' => $node_type->label()]),
'description' => t('%title content type already exists, please delete the %title content type before installing the Webform node module.', ['%title' => $node_type->label()]),
'severity' => REQUIREMENT_ERROR,
];
}
}
return $requirements;
}