Skip to content
This repository has been archived by the owner on Jun 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #41 from Pronovix/issue/8010
Browse files Browse the repository at this point in the history
-Fixed errors on tax. term. creation
  • Loading branch information
Rolligta authored Apr 24, 2020
2 parents 4ba549c + 11f7247 commit ab23752
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/modules/custom/genres_to_terms/genres_to_terms.module
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use Drupal\taxonomy\Entity\Term;
function genres_to_terms_entity_presave(EntityInterface $entity): void {
if ($entity instanceof NodeInterface && $entity->bundle() === 'product') {
$vid = 'genres';
$inputs = explode(PHP_EOL, trim($entity->get('field_genres')->value));
$inputs = preg_split('/\s+/', $entity->get('field_genres')->value, -1, PREG_SPLIT_NO_EMPTY);
$terms = Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties([
'vid' => $vid,
'name' => $inputs,
Expand Down

0 comments on commit ab23752

Please sign in to comment.