Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Products/categories or any other page with "pg" or "page" on the URL will request cms/page API #1387

Closed
franciscombrito opened this issue Mar 15, 2023 · 2 comments · Fixed by #1409
Assignees
Labels
bug Something isn't working
Milestone

Comments

@franciscombrito
Copy link

franciscombrito commented Mar 15, 2023

Actual Behavior

Products/categories or any other page with "pg" or "page" on the URL will request cms/page API

Expected Behavior

Having page/pg in the URL shouldn't trigger the CMS page api

Steps to Reproduce the Bug

Steps to reproduce the behavior:

  1. Go to any product page
  2. Add pg in the URL
  3. On the network tab you will see an error page - the errors shows that the API used is cms/page instead of products

Environment Details

  • Project Code Version : PWA 3.1 but also tested on the current release

Cause:
// matcher to check if a given url is a content page route
const contentRouteFormat = /^/(?!page/.$)(.-)?pg(.*)$/; (github formating is modifiying the original regex)

AB#84574

@franciscombrito franciscombrito added the bug Something isn't working label Mar 15, 2023
@shauke
Copy link
Collaborator

shauke commented Mar 16, 2023

@franciscombrito Can you please be more specific where exactly in an example URL page or pg strings are a problem for you?
There are definitely places where they cause problems, but in most places it works fine. E.g.

https://intershoppwa.azurewebsites.net/page-computers/pgtablets/pagemicrosoftpage/pagemicrosoft-surface-pro-set-burgundypg-prd201807198-ctgComputers.897.897_Microsoft

@shauke shauke added this to the 4.0 milestone Mar 31, 2023
shauke added a commit that referenced this issue Apr 3, 2023
* reordered check for routing matches to first check product routes then category routes and at the end content page routes (to be less eager to assume it is a content page)
* replace all occurences of object markers (pg, prd, ctg) in slug data instead of only the first (to prevent unintended object markers with multiple occurences)
* updated project configuration to consistently use the Angular 15 standard configuration of `ES2022` that includes `replaceAll`
- `replaceAll('pg', 'Pg')` could be replaced by `replace(/pg/g, 'Pg')`
shauke added a commit that referenced this issue Apr 4, 2023
* reordered check for routing matches to first check product routes then category routes and at the end content page routes (to be less eager to assume it is a content page)
* replace all occurences of object markers (pg, prd, ctg) in slug data instead of only the first (to prevent unintended object markers with multiple occurences)
* updated ts configuration to use the Angular 15 standard configuration of `ES2022` for `lib` that includes `replaceAll`
- `replaceAll('pg', 'Pg')` could be replaced by `replace(/pg/g, 'Pg')`
@shauke shauke linked a pull request Apr 4, 2023 that will close this issue
shauke added a commit that referenced this issue Apr 4, 2023
* reordered check for routing matches to first check product routes then category routes and at the end content page routes (to be less eager to assume it is a content page)
* replace all occurences of object markers (pg, prd, ctg) in slug data instead of only the first (to prevent unintended object markers with multiple occurences)
* updated ts configuration to use the Angular 15 standard configuration of `ES2022` for `lib` that includes `replaceAll`
- `replaceAll('pg', 'Pg')` could be replaced by `replace(/pg/g, 'Pg')`
shauke added a commit that referenced this issue Apr 4, 2023
* reordered check for routing matches to first check product routes then category routes and at the end content page routes (to be less eager to assume it is a content page)
* replace all occurences of object markers (pg, prd, ctg) in slug data instead of only the first (to prevent unintended object markers with multiple occurences)
* updated ts configuration to use the Angular 15 standard configuration of `ES2022` for `lib` that includes `replaceAll`
- `replaceAll('pg', 'Pg')` could be replaced by `replace(/pg/g, 'Pg')`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants