GithubHelp home page GithubHelp logo

tommysonsylverstone / sulu-elasticsearch-user-bug Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 5.91 MB

Trying to reproduce the bug where a logged in sulu user can't see articles rendered by smart_content content type or alikes.

JavaScript 10.76% PHP 71.73% Twig 17.51%
bug elasticsearch sulu

sulu-elasticsearch-user-bug's Introduction

Steps

  1. Initialize new project composer composer create-project sulu/skeleton my-project -n
  2. Add translation bin/console sulu:admin:download-language
  3. Create database and initialize bin/adminconsole sulu:build dev
  4. Download the elasticsearch version that matches your installation's (7.17 in my case) composer require "elasticsearch/elasticsearch:7.17.*"
  5. Download the article bundle (latest) composer require sulu/article-bundle
  6. Download elasticsearch bundle composer require "handcraftedinthealps/elasticsearch-bundle:^5.2"
  7. (optionnal) Modify ELASTICSEARCH_INDEX value in your .env file
  8. Create elasticsearch indexes
php bin/console ongr:es:index:create
php bin/console ongr:es:index:create --manager=live
  1. Activate all your articles rights in your User settings Settings > User roles > your role
  2. Create a smart content in your homepage.xml
  3. Render your smart content in your homepage.html.twig
  4. Create a user role php bin/console sulu:security:role:create and assign it the website system
  5. Create a new user either in your admin or php bin/console sulu:security:role:create
  6. Uncomment the routes login and logout in your config/routes_website.yaml
  7. Uncomment your website firewall in your security.yaml
  8. Create your own login page https://github.com/sulu/sulu/blob/2.x/templates/static/login.html.twig
  9. Go to your /login page and connect as a user (that you created on point 13)

You should be redirected to the frontpage where the smart content is, and have the following error: {"error":{"root_cause":[{"type":"parsing_exception","reason":"[term] query does not support [type]","line":1,"col":183}],"type":"x_content_parse_exception","reason":"[1:183] [bool] failed to parse field [must]","caused_by":{"type":"x_content_parse_exception","reason":"[1:183] [bool] failed to parse field [should]","caused_by":{"type":"parsing_exception","reason":"[term] query does not support [type]","line":1,"col":183}}},"status":400}

The error appears if:

  • You try to use smart content with a user connected via Sulu Community Bundle
  • If you connect as a sulu User where a smart content is active

UPDATE 2 OF MAY 2023

The bug has been fixed as of suluArticleBundle:2.4.1 sulu/SuluArticleBundle#626

sulu-elasticsearch-user-bug's People

Contributors

tommysonsylverstone avatar

Watchers

 avatar

Forkers

miaklute974

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.