updated custom modules codes for d9

This commit is contained in:
2024-09-16 21:48:07 +02:00
parent b357237047
commit cbac2d9946
38 changed files with 375 additions and 158 deletions
@@ -350,7 +350,7 @@ class EdlpSearchController extends ControllerBase {
// entries
$this->entry_names = [];
if (!empty($this->entries)){
$terms = entity_load_multiple('taxonomy_term', $this->entries);
$terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadMultiple($this->entries);
$entries_condition_group = $query->createConditionGroup();
foreach ($terms as $tid => $term) {
$entries_condition_group->addCondition('field_entrees', (int)$tid, "=");
@@ -84,10 +84,11 @@ class EdlpSearchForm extends FormBase {
private function getEntries(){
$query = \Drupal::entityQuery('taxonomy_term')
->accessCheck(TRUE)
->condition('vid', 'entrees');
$tids = $query->execute();
$terms = entity_load_multiple('taxonomy_term', $tids);
$terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadMultiple($tids);
// dsm($terms);
foreach ($terms as $term) {
// dpm($term->toArray());
@@ -122,7 +123,7 @@ class EdlpSearchForm extends FormBase {
public function submitForm(array &$form, FormStateInterface $form_state) {
// Display result.
foreach ($form_state->getValues() as $key => $value) {
drupal_set_message($key . ': ' . $value);
\Drupal::messenger()->addMessage($key . ': ' . $value);
}
}