Problem/Motivation

Feeds has added a method called cleanUp() to the FetcherResultInterface. we need to implement this method in QueryFetcherResult.php

Original support request:
This might be a noob question. When I create a feed type using the LDAP Query fetcher and select my query. None of the LDAP attributes are listed as a source when I'm trying to map to my node fields. Only Feed entity items appear in the source list eg. Feed: Authored by

I added a feed type.
Fetcher: LDAP Query Fetcher.
Parser LDAP Entry
Processor: Node
Content Type: (Custom Content type with fields)

When I test the LDAP query from /admin/config/people/ldap/query/my_ad_sync/test I can see results and attribute columns. I'm unsure how to get them to appear in the feed type mappings.

Any pointers would be appreciated.

Issue fork feeds_ldap-3380381

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

neubreed created an issue. See original summary.

neubreed’s picture

In addition to the above, I set up and import feed. When I run that I get this error: "The feed became locked before the import could begin." There's nothing in the logs with a better explanation and I have all logging / debugging turned on where I could find the option to.

dylan donkersgoed’s picture

This might be a noob question. When I create a feed type using the LDAP Query fetcher and select my query. None of the LDAP attributes are listed as a source when I'm trying to map to my node fields. Only Feed entity items appear in the source list eg. Feed: Authored by

The fetcher doesn't automatically discover LDAP attributes, you need to manually enter the LDAP attribute name. In the same dropdown with "Feed: Authored by" there should be an option for a custom source. I don't recall off the top of my head exactly what it's called but I believe it's separated from the others toward the bottom of the dropdown.

As for why your feed is locking up it's hard to say without more details. I might be able to take a look if you can attach some configuration (the LDAP server, query, and feeds configuration or just an entire test database) that replicates the issue. You can use a public test LDAP server like the one from https://www.forumsys.com/2022/05/10/online-ldap-test-server/.

neubreed’s picture

Thanks Dylan.

I appreciate you getting back to me so quickly.

By custom source do you mean New Blank source...? See the below pic of available options when selecting a source

https://i.imgur.com/PI2XcMJ.png

I've tried adding blank sources with matching attribute names (lowercase) But the feed returns the same error "The feed became locked before the import could begin." No entries in watchdog. Ultimate Cron has no errors etc

The query is working when I test it via /admin/config/people/ldap/query/my_ad_sync/test

The query settings

https://i.imgur.com/AaD7Bco.png

Server settings (? replaces sensitive info):

uuid: ??
langcode: en
status: true
dependencies: {  }
id: ad_profile_sync
label: 'Ad profiles sync'
type: default
address: ?.?.?.?
port: ???
timeout: 30
encryption: ssl
weight: null
bind_method: service_account
binddn: 'CN=???,OU=Service Accounts,OU=Tier2,OU=Admin,DC=??,DC=????'
bindpw: '*******'
based:
  - 'DC=??,DC=??'
user_attr: mail
account_name_attr: ''
mail_attr: ''
mail_template: mail
picture_attr: ''
unique_persistent_attr: cn
unique_persistent_attr_binary: false
user_dn_expression: 'dc=??,dc=????'
testing_drupal_username: srv_gce_ad_drupal_p
testing_drupal_user_dn: 'CN=??????,OU=Service Accounts,OU=Tier2,OU=Admin,DC=??,DC=??'
grp_unused: false
grp_object_cat: ''
grp_nested: false
grp_user_memb_attr_exists: false
grp_user_memb_attr: ''
grp_memb_attr: ''
grp_memb_attr_match_user_attr: ''
grp_derive_from_dn: true
grp_derive_from_dn_attr: dc
grp_test_grp_dn: ''
grp_test_grp_dn_writeable: ''
neubreed’s picture

Hi Dylan Okay .. I finally discovered a PHP error that could possibly (most likely) be stopping the import:

PHP Fatal error:  Class Drupal\feeds_ldap\Feeds\Result\QueryFetcherResult contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\feeds\Result\FetcherResultInterface::cleanUp) in /home/my-sharing/public_html/web/modules/contrib/feeds_ldap/src/Feeds/Result/QueryFetcherResult.php on line 10

I'm using PHP 8.1

fox_01’s picture

Got the same error as described in #5

a_mitch’s picture

Title: Mapping LDAP attributes to fields » Implement cleanUp() method from FetcherResultInterface
Category: Support request » Bug report
Issue summary: View changes
Status: Active » Reviewed & tested by the community
bwoods’s picture

I can confirm that this patch works. I believe it should be added to the next release.

a_mitch’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.