TypeError: explode(): Argument #2 ($string) must be of type string, array given in explode()

Created on 7 March 2023, almost 2 years ago
Updated 8 March 2023, almost 2 years ago

Problem/Motivation

When we pass multiple parameters in the set_attributes() function it gives us
TypeError: explode(): Argument #2 ($string) must be of type string, array given in explode() (line 215 of modules/contrib/ldap_search/src/Services/SearchResources.php).

Steps to reproduce

When we use

$service = \Drupal::service('ldap_search.search');

and pass multiple parameters such as

$service->set_attributes(["samaccountname","mail"]);

Error is coming because we are passing an array instead of a string. So we need check in that method.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇵🇰Pakistan riazsaid15 Office E-14, 4th Floor New spinzer IT Plaza next to Gul Haji Plaza, University Road, Peshawar

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇵🇰Pakistan riazsaid15 Office E-14, 4th Floor New spinzer IT Plaza next to Gul Haji Plaza, University Road, Peshawar

    Minor changes in the patch. If it receives a string or array it will work as expected

Production build 0.71.5 2024