Ne poslje emaila za strojni prevod
parent
aca2cd8d54
commit
6cb7199d22
|
@ -104,6 +104,11 @@ function _yufu_admin_get_node_transition(NodeInterface $node) {
|
||||||
$original = $node->original ?? NULL;
|
$original = $node->original ?? NULL;
|
||||||
$moderation_state = $node->moderation_state->value;
|
$moderation_state = $node->moderation_state->value;
|
||||||
$previous_state = $original?->moderation_state->value ?? NULL;
|
$previous_state = $original?->moderation_state->value ?? NULL;
|
||||||
|
|
||||||
|
if ($node->field_strojni_prevod->value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($moderation_state == 'draft' && in_array($previous_state, ['published', NULL])) {
|
if ($moderation_state == 'draft' && in_array($previous_state, ['published', NULL])) {
|
||||||
return 'concept_drafted';
|
return 'concept_drafted';
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,9 +95,8 @@ function uskladi_prevode(EntityInterface $entity) {
|
||||||
$entityRepository = \Drupal::service('entity.repository');
|
$entityRepository = \Drupal::service('entity.repository');
|
||||||
foreach($ostaliJeziki as $jezik) {
|
foreach($ostaliJeziki as $jezik) {
|
||||||
$prevod = $entityRepository->getTranslationFromContext($entity, $jezik);
|
$prevod = $entityRepository->getTranslationFromContext($entity, $jezik);
|
||||||
$strojniPrevodField = $prevod->field_strojni_prevod->first();
|
$strojniPrevod = $prevod->field_strojni_prevod->value;
|
||||||
$strojniPrevod = $strojniPrevodField->value;
|
if ($strojniPrevod) {
|
||||||
if ($strojniPrevod != '0') {
|
|
||||||
prevedi_koncept($entity, $prevod);
|
prevedi_koncept($entity, $prevod);
|
||||||
$prevod->save();
|
$prevod->save();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue