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

UVE: Editor doesn't support chained Vanity URLs that are redirects #29165

Closed
zJaaal opened this issue Jul 8, 2024 · 9 comments · Fixed by #29514 or #29725
Closed

UVE: Editor doesn't support chained Vanity URLs that are redirects #29165

zJaaal opened this issue Jul 8, 2024 · 9 comments · Fixed by #29514 or #29725

Comments

@zJaaal
Copy link
Contributor

zJaaal commented Jul 8, 2024

Parent Issue

TBD

Problem Statement

If we create a Vanity URL that is a redirect (Permanent or Temporary) that points to another Vanity URL (Permanent or Temporary) it will never get to the final page inside of the UVE.

Steps to Reproduce

All vanity URLs should be permanent or temporary redirects.

Screen.Recording.2024-07-08.at.7.32.02.PM.mov

Acceptance Criteria

We should be able to handle N redirects using the Vanity URL since is a possible behavior.

dotCMS Version

trunk-latest

Proposed Objective

Technical User Experience

Proposed Priority

Priority 2 - Important

Assumptions & Initiation Needs

  • You understand how the UVE fetch the data for the Editor
  • You understand how Vanity URL works and it's behavior inside the UVE

Quality Assurance Notes & Workarounds

No workarounds at the moment.

@zJaaal
Copy link
Contributor Author

zJaaal commented Aug 8, 2024

We have to test this again, could possibly be fixed in this card #28947

@valentinogiardino
Copy link
Contributor

Passed Internal QA

  • Tested on docker image: [dotcms/dotcms:trunk_2e54089]

Video

iqa-redirect-vanity-urls.mov

@bryanboza
Copy link
Member

This is working now, however I'm getting a NPE in the log every time that I call the chain of vanities, https://gist.github.com/bryanboza/7d7729859e44f2e745fe39f225ff4a6d

We need to tale look of this error and make sure will not affect any other feature when I'm navigating into the final page.

@valentinogiardino
Copy link
Contributor

This is working now, however I'm getting a NPE in the log every time that I call the chain of vanities, https://gist.github.com/bryanboza/7d7729859e44f2e745fe39f225ff4a6d

We need to tale look of this error and make sure will not affect any other feature when I'm navigating into the final page.

The exception is not related to UVE or vanity URLs. The NPE was reproducible with the 20240807 starter, which lacks vanity URLs pointing to the pages where the exception occurs. Specifically, the problem arises in the ShortyServlet when it tries to retrieve the inodePath of an image. It fails because some images in the starter have a null liveInode, while the method assumes the presence of a live version, leading to the failure.

Steps to Reproduce the current NPE

  1. Start a new dotCMS instance using the 20240807 starter.
  2. Open an incognito tab.
  3. Navigate to / or /index.
  4. Inspect the dotCMS logs to observe the null pointer exception.

@nollymar
Copy link
Contributor

As the exception is related to data, we are catching the NPE and throwing and logging a dotCMS checked exception

github-merge-queue bot pushed a commit that referenced this issue Aug 24, 2024
…29725)

### Proposed Changes
* Ensure that the `Contentlet` retrieved from `contentletApi` is not
null before attempting to access its properties. This change aims to
prevent potential `NullPointerException`

#### Additional Info
This PR fixes #29165 QA report. The exception is not related to UVE or
vanity URLs. The issue was reproducible with the `20240807` starter,
which lacks vanity URLs pointing to the pages where the exception
occurs. Specifically, the problem arises in the `ShortyServlet` when it
tries to retrieve the `inodePath` of an image. It fails because some
images in the starter have a `null` `liveInode`, while the method
assumes the presence of a live version, leading to the failure.

#### Steps to Reproduce the current NPE

1. Start a new dotCMS instance using the `20240807` starter.
2. Open an incognito tab.
3. Navigate to `/` or `/index`.
4. Inspect the dotCMS logs to observe the null pointer exception.

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
<img width="720" alt="image"
src="https://github.com/user-attachments/assets/b69ebc97-50b7-4fb3-954b-274db2f93ce8">|<img
width="785" alt="image"
src="https://github.com/user-attachments/assets/0ec6c758-1f9d-46ae-82b0-8e254d63c34f">
@valentinogiardino valentinogiardino removed their assignment Aug 24, 2024
@nollymar nollymar reopened this Aug 25, 2024
@rjvelazco rjvelazco self-assigned this Aug 26, 2024
@rjvelazco
Copy link
Contributor

Passed Internal QA

  • Tested on docker image: [dotcms/dotcms:trunk_3ecd733]
  • Local server

Video

iqa-29165-uve-editor-doesnt-support-chained-vanity-urls-that-are-redirects-1.mov

@rjvelazco rjvelazco removed their assignment Aug 26, 2024
@bryanboza bryanboza added Release : 24.09.21 UVE // Java21 and removed Release : 24.08.27 Custom templates and loggin fixes labels Aug 27, 2024
@bryanboza
Copy link
Member

We need to take look the following case here:

@nollymar
Copy link
Contributor

@bryanboza please share more details to reproduce this error. Are you using full starter data? what page are you using? did you create a new one?

@bryanboza
Copy link
Member

Sorry guys, it seems the error is related to the page I selected for the example, so it's not associated with the vanity chain. We can pass on this one for now, and I'll create a new card for it since it's out of the scope of this card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment