Commit 057214cb authored by catch's avatar catch
Browse files

Issue #3272722 by Lendude: The deprecation message for...

Issue #3272722 by Lendude: The deprecation message for taxonomy_term_load_multiple_by_name() is incorrect, it should use taxonomy_term and not taxonomy_vocabulary
parent 9de5949b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ function taxonomy_vocabulary_get_names() {
 * @see https://www.drupal.org/node/3039041
 */
function taxonomy_term_load_multiple_by_name($name, $vocabulary = NULL) {
  @trigger_error('taxonomy_term_load_multiple_by_name() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal::entityTypeManager()->getStorage("taxonomy_vocabulary")->loadByProperties(["name" => $name, "vid" => $vid]) instead, to get a list of taxonomy term entities having the same name and keyed by their term ID. See https://www.drupal.org/node/3039041', E_USER_DEPRECATED);
  @trigger_error('taxonomy_term_load_multiple_by_name() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal::entityTypeManager()->getStorage("taxonomy_term")->loadByProperties(["name" => $name, "vid" => $vid]) instead, to get a list of taxonomy term entities having the same name and keyed by their term ID. See https://www.drupal.org/node/3039041', E_USER_DEPRECATED);
  $values = ['name' => trim($name)];
  if (isset($vocabulary)) {
    $values['vid'] = $vocabulary;
+1 −1
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@ public function testTermMultipleParentsInterface() {
  public function testTaxonomyGetTermByName() {
    $term = $this->createTerm($this->vocabulary);

    $this->expectDeprecation('taxonomy_term_load_multiple_by_name() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal::entityTypeManager()->getStorage("taxonomy_vocabulary")->loadByProperties(["name" => $name, "vid" => $vid]) instead, to get a list of taxonomy term entities having the same name and keyed by their term ID. See https://www.drupal.org/node/3039041');
    $this->expectDeprecation('taxonomy_term_load_multiple_by_name() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal::entityTypeManager()->getStorage("taxonomy_term")->loadByProperties(["name" => $name, "vid" => $vid]) instead, to get a list of taxonomy term entities having the same name and keyed by their term ID. See https://www.drupal.org/node/3039041');

    // Load the term with the exact name.
    $terms = taxonomy_term_load_multiple_by_name($term->getName());