Skip to content

Update text extraction in DocumentSerializationHandler - #482

Open
dpfaffenbauer wants to merge 1 commit into
pimcore:2026.xfrom
dpfaffenbauer:patch-2
Open

Update text extraction in DocumentSerializationHandler#482
dpfaffenbauer wants to merge 1 commit into
pimcore:2026.xfrom
dpfaffenbauer:patch-2

Conversation

@dpfaffenbauer

@dpfaffenbauer dpfaffenbauer commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Refactor text extraction to use a dedicated method for better error handling.

Changes in this pull request

Resolves pimcore/platform-version#244

Additional info

Refactor text extraction to use a dedicated method for better error handling.
Copilot AI review requested due to automatic review settings July 23, 2026 12:53
@pimcore-deployments
pimcore-deployments marked this pull request as draft July 23, 2026 12:53
@sonarqubecloud

Copy link
Copy Markdown

@dpfaffenbauer
dpfaffenbauer marked this pull request as ready for review July 23, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors text extraction in DocumentSerializationHandler so that a failure during Document::getText() no longer aborts serialization/indexing of the whole document asset. The inline $asset->getText() call is replaced by a dedicated getAssetText() helper that catches errors, logs them, and returns null. This mirrors the existing getImageThumbnail() helper in the same class, making the two additional-system-field extractions behave consistently (best-effort with graceful degradation).

Changes:

  • Extract text retrieval into a private getAssetText(Document $document) method with try/catch and error logging.
  • Route DocumentSystemField::TEXT population through the new helper so extraction failures are logged instead of propagated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Generic Data Index] Bug in DocumentSerializationHandler with missing asset file

3 participants