Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Circular SearchRanking associations make the Shopware 6.7.15 admin search run out of memory

Open Beginner friendly
#92 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
elasticsearch, php
Domain
backend, search

Research direction

The cycle comes from the ASSOCIATION_SEARCH_RANKING flags on blogAuthor and blogCategories in BlogEntryDefinition and on the inverse blogEntries associations in BlogAuthorDefinition and BlogCategoryDefinition. Start by finding those flags and removing SearchRanking from the two blogEntries associations as the issue suggests. Done means a DAL term search on werkl_blog_entry no longer recurses, and searching blog entries by author or category name still returns results.

Written by the indexing model from the issue text.

Description

Circular SearchRanking associations make the Shopware 6.7.15 admin search run out of memory

OpenBlogware version: 5.3.3 · Shopware version: 6.7.15.1

Description

The blog entity definitions flag associations that point back to each other with SearchRanking:

  • BlogEntryDefinition: blogAuthor and blogCategories (ASSOCIATION_SEARCH_RANKING)
  • BlogAuthorDefinition: blogEntries (ASSOCIATION_SEARCH_RANKING)
  • BlogCategoryDefinition: blogEntries (ASSOCIATION_SEARCH_RANKING)

Shopware's EntityScoreQueryBuilder follows SearchRanking associations recursively without a cycle guard, so a DAL term search on werkl_blog_entry, werkl_blog_author or werkl_blog_category recurses forever.

Since Shopware 6.7.15 the administration global search falls back to the DAL term search for entities without an admin Elasticsearch indexer (shopware/shopware#19399). With admin Elasticsearch enabled, typing in the global search now exhausts PHP memory (EntityScoreQueryBuilder.php line 58) as soon as the blog entities are part of the search preferences, which they are by default.

Steps to reproduce

  1. Shopware 6.7.15.1 with SHOPWARE_ADMIN_ES_ENABLED=1, OpenBlogware 5.3.3 installed.
  2. Type any term in the administration global search, or POST /api/_admin/es-search with {"term": "test", "entities": ["werkl_blog_entry"]}.

Suggested fix

Drop SearchRanking from the inverse blogEntries associations in BlogAuthorDefinition and BlogCategoryDefinition. Searching blog entries by author or category name still works through blogAuthor / blogCategories. The cycle is reported to Shopware core as well (shopware/shopware#21580).

Dominant language
PHP
Stars
43
Forks
21
Avg merge
12d 20h
Merged PRs (30d)
1

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Werkstattl/OpenBlogware

All issues in Werkstattl/OpenBlogware

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.