Skip to content

Commit 0975b38

Browse files
committed
refactor: update import path and correct parameter names in image processing
1 parent fef2acb commit 0975b38

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

backend/onyx/connectors/drupal_wiki/connector.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from onyx.connectors.models import ImageSection
3737
from onyx.connectors.models import SlimDocument
3838
from onyx.connectors.models import TextSection
39-
from onyx.db.engine import get_session_with_current_tenant
39+
from onyx.db.engine.sql_engine import get_session_with_current_tenant
4040
from onyx.file_processing.extract_file_text import extract_file_text
4141
from onyx.file_processing.image_utils import store_image_and_create_section
4242
from onyx.indexing.indexing_heartbeat import IndexingHeartbeatInterface
@@ -358,10 +358,11 @@ def _process_image_attachment(
358358
section, file_name = store_image_and_create_section(
359359
db_session=db_session,
360360
image_data=raw_bytes,
361-
file_name=str(attachment["id"]),
361+
file_id=str(attachment["id"]), # correct param to identify image
362362
display_name=attachment.get(
363363
"name", attachment.get("fileName", "Unknown")
364364
),
365+
link=None, # no direct link for stored images
365366
media_type=media_type,
366367
file_origin=FileOrigin.CONNECTOR,
367368
)
@@ -606,7 +607,7 @@ def _process_page(self, page: DrupalWikiPage) -> Document | ConnectorFailure:
606607
elif result.get("file_name") and self.allow_images:
607608
# Image attachment - create ImageSection only if allow_images is True
608609
image_section = ImageSection(
609-
image_file_name=result["file_name"], link=page_url
610+
image_file_id=result["file_name"], link=page_url
610611
)
611612
sections.append(image_section)
612613
logger.info(

web/public/DrupalWiki.png

475 KB
Loading

0 commit comments

Comments
 (0)