[MGNLREST-358] Rest personalisation not accepting query parameters Created: 11/Apr/22  Updated: 04/Jul/22

Status: Open
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: 2.2.11
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Epic Link: Headless p13n Backlog
Team: DeveloperX

 Description   

Steps to reproduce

  1. Install demo-rest-p13n module.
  2. Try querying by navigationTitle and p13n trait favourite-color:
    http://localhost:8080/magnoliaAuthor/.rest/delivery/pages/v1/?favorite-color=black&navigationTitle="Shoes"

Expected results

Page with navigationTitle "Shoes" and corresponding variation is returned

Actual results

No results are returned

Dev notes

Personalization works with requests like localhost:8080/./delivery/pages/v1/shoes?favorite-color=black because read nodes method is called. However when sending parameters with no path (localhost:8080/magnoliaAuthor/.rest/delivery/pages/v1/?favorite-color=black&navigationTitle="Shoes"), query nodes method is called and consequently, the personalization trait is used as if it was also a parameter creating a query as follows:

SELECT t.* FROM [nt:base] AS t WHERE t.[jcr:primaryType] = 'mgnl:page' AND t.[favorite-color] = 'black' AND t.navigationTitle = 'Shoes'

This obviously won't return any result.


Generated at Mon Feb 12 06:59:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.