sulu / SuluArticleBundle

Bundle for managing localized content-rich entities like blog-posts in the Sulu content management system
MIT License
57 stars 77 forks source link

Being on a page as a connected sulu user, with smart content content type rendered, makes elasticsearch throwing an error #614

Open tommysonsylverstone opened 2 years ago

tommysonsylverstone commented 2 years ago
Q A
Bug? yes
New Feature? no
SuluArticleBundle Version ^2.3
Sulu Version 2.4.3 (and 2.4.2 too)

Actual Behavior

How does Sulu behave at the moment? When connected as a Sulu User (via sulu's basic login system or Sulu Community Bundle login), being on a page that is rendering a smart content or any other articles rendering content type makes symfony throw an error that is related to elasticsearch.

Expected Behavior

What is the behavior you expect? Rendered articles/articles previews don't produce an error when connected as a Sulu User.

Steps to Reproduce

Here is the repository with all steps to reproduce the problem

Other things

EDIT August 4 2022

Elasticsearch queries in both cases:

Not connected (2 queries) ``` { "query": { "bool": { "must_not": [ { "term": { "uuid": "9d548a2b-54f0-42b7-b741-ea48c674add9" } } ], "must": [ { "term": { "locale": "fr" } }, { "match_all": {} }, { "bool": { "should": [ { "term": { "main_webspace": "pqna" } }, { "term": { "additional_webspaces": "pqna" } } ] } } ] } }, "from": 0, "size": 100 } ``` ``` { "query": { "bool": { "must_not": [ { "term": { "uuid": "9d548a2b-54f0-42b7-b741-ea48c674add9" } } ], "must": [ { "term": { "locale": "fr" } }, { "bool": { "should": [ { "term": { "structure_type": "pqna" } }, { "term": { "structure_type": "actualites" } } ] } }, { "match_all": {} }, { "bool": { "should": [ { "term": { "main_webspace": "pqna" } }, { "term": { "additional_webspaces": "pqna" } } ] } } ] } }, "sort": [ { "published": { "order": "asc" } } ], "from": 0, "size": 3 } ```
Connected (1 query only) ``` { "query": { "bool": { "must_not": [ { "term": { "uuid": "9d548a2b-54f0-42b7-b741-ea48c674add9" } } ], "must": [ { "term": { "locale": "fr" } }, { "bool": { "should": [ { "term": { "type": { "value": "guide_methodologique", "type": null } } }, { "term": { "type": { "value": "actualites", "type": null } } }, { "term": { "type": { "value": "dispositifs_financiers", "type": null } } }, { "term": { "type": { "value": "demarches_inspirantes", "type": null } } }, { "term": { "type": { "value": "kits_fondamentaux", "type": null } } }, { "term": { "type": { "value": "boite_a_outil_thematique", "type": null } } }, { "term": { "type": { "value": "decryptage", "type": null } } }, { "term": { "type": { "value": "default", "type": null } } } ] } }, { "match_all": {} }, { "bool": { "should": [ { "term": { "main_webspace": "pqna" } }, { "term": { "additional_webspaces": "pqna" } } ] } } ] } }, "from": 0, "size": 100 } ```

The roles returned in my case are:

"ROLE_USER"
"ROLE_SULU_PQNAUSER"
"ROLE_SULU_USER"

The roles returned via the dump() twig function is PqnaUser which is on the Website system. (PqnaUser is the name of the user role I registered when doing the php bin/console sulu:community:init command line.)

The table se_roles is as follows: se_roles

And here's my webspace.xml

webspace.xml ``` pqn-a.fr pqna Website pqna pqna Main Navigation Navigation principale pqn-a.fr pqna {host}/{localization} {host}/{localization} {host}/{localization} {host}/{localization} {host}/{localization} {host}/{localization} {host}/{localization} {host}/{localization} ```