Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#92 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
elasticsearch, php
領域
backend, search

調査の方向性

循環は、BlogEntryDefinition の blogAuthor と blogCategories にある ASSOCIATION_SEARCH_RANKING フラグと、BlogAuthorDefinition および BlogCategoryDefinition の逆方向の blogEntries 関連から生じています。まずこれらのフラグを見つけ、Issue の提案どおり 2 つの blogEntries 関連から SearchRanking を削除してください。werkl_blog_entry に対する DAL の用語検索が再帰しなくなり、著者名またはカテゴリ名でブログエントリを検索しても結果が返ることを確認すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
PHP
スター
43
フォーク
21
平均マージ
12日 20時間
マージ済み PR(30日)
1

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Werkstattl/OpenBlogware のほかの issue

Werkstattl/OpenBlogware の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。