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

[Templates] : The 'Template' dropdown in Page Properties is not displaying the expected Custom Template value #29034

Closed
jcastro-dotcms opened this issue Jun 27, 2024 · 8 comments · Fixed by #29669 or #29695

Comments

@jcastro-dotcms
Copy link
Contributor

Parent Issue

No response

Problem Statement

The Template dropdown in the Page Properties modal is NOT displaying the correct value when a custom Template is generated. When you update the page's layout, it displays System Template (System Host) instead.

If you check the contentlet table in the database, in the contentlet_as_json column, the Template data points to a custom Template. This means there might be a problem at UI level. This will confuse users as they will think their HTML Page is using the System Template, which is not correct.

Steps to Reproduce

  1. Create a test HTML Page using the Default Template.
  2. Add a test Rich Text to the page.
  3. Click the LAYOUT button and add a new row above or below the existing one. Click the CONTENT button.
  4. Finally, click the PROPERTIES button, You'll see that the value of the Template dropdown is System Template (System Host)

Acceptance Criteria

The Template dropdown must indicate that the current Template is actually a Custom Template, just like it used to.

dotCMS Version

Latest master.

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

This issue might be related to:

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@jdotcms
Copy link
Contributor

jdotcms commented Jun 27, 2024

I will take a look

@jdotcms jdotcms self-assigned this Jun 27, 2024
@jdotcms jdotcms moved this from Next 1-3 Sprints to In Progress in dotCMS - Product Planning Jun 27, 2024
@jdotcms jdotcms moved this from In Progress to Next 1-3 Sprints in dotCMS - Product Planning Jun 27, 2024
@nollymar nollymar moved this from Next 1-3 Sprints to In Progress in dotCMS - Product Planning Aug 14, 2024
@nollymar
Copy link
Contributor

nollymar commented Aug 19, 2024

This issue is happening after the changes applied on this PR.

I could identified that the /api/v1/templates endpoint is called multiple times and the last call removes the Custom Page Layout from the dropdown list. After removing these lines , the issue gets fixed. However, when you select the File Template Advanced example, the dropdown breaks again.

Other findings:

  • the api/v1/templates/64269d16-2710-4919-88ec-3b09c89ea004/working is called twice
  • the /api/v1/templates/image fails when no image is found. In my opinion, we shouldn't log that exception because the template image is optional
  • Code duplication

I suggest to clean up the logic in the complete custom field to avoid unnecessary calls that might be affecting the field's behavior.

@rjvelazco rjvelazco assigned rjvelazco and unassigned zJaaal Aug 20, 2024
@rjvelazco rjvelazco linked a pull request Aug 20, 2024 that will close this issue
@rjvelazco rjvelazco moved this from In Progress to In Review in dotCMS - Product Planning Aug 20, 2024
github-merge-queue bot pushed a commit that referenced this issue Aug 21, 2024
### Proposed Changes
* fix(template): Page content is deleted after changing page properties
  - #29569
* fix(template): Page content is deleted when changing language
  - #29572
* fix(template): Keep custom template after update
  - #29034

## Videos

### Page content is deleted after changing page properties


https://github.com/user-attachments/assets/b1348572-89b9-404d-9df3-7cae19bd688a

### Page content is deleted when changing language


https://github.com/user-attachments/assets/4f3079da-77bf-4616-a031-7a3802c40d39

### Keep custom template after update


https://github.com/user-attachments/assets/23217700-1800-4ed7-ad7e-9ccc75fafac3
@github-project-automation github-project-automation bot moved this from In Review to Internal QA in dotCMS - Product Planning Aug 21, 2024
@rjvelazco rjvelazco reopened this Aug 21, 2024
@rjvelazco rjvelazco changed the title UVE[Templates] : The 'Template' dropdown in Page Properties is not displaying the expected Custom Template value [Templates] : The 'Template' dropdown in Page Properties is not displaying the expected Custom Template value Aug 21, 2024
@rjvelazco rjvelazco moved this from In Progress to In Review in dotCMS - Product Planning Aug 21, 2024
@rjvelazco rjvelazco linked a pull request Aug 21, 2024 that will close this issue
1 task
@rjvelazco
Copy link
Contributor

rjvelazco commented Aug 21, 2024

We are going to address this issue for the UVE here but for the old Edit Page is going to be in a separate ticket #29697, @nollymar

@github-project-automation github-project-automation bot moved this from In Review to Internal QA in dotCMS - Product Planning Aug 23, 2024
@rjvelazco rjvelazco removed their assignment Aug 23, 2024
@rjvelazco rjvelazco reopened this Aug 23, 2024
@github-project-automation github-project-automation bot moved this from Internal QA to Current Sprint Backlog in dotCMS - Product Planning Aug 23, 2024
@nollymar nollymar moved this from Current Sprint Backlog to Internal QA in dotCMS - Product Planning Aug 23, 2024
@zJaaal zJaaal self-assigned this Aug 26, 2024
@zJaaal
Copy link
Contributor

zJaaal commented Aug 26, 2024

IQA Passed

Now the Template field is populating correctly

Docker Image: [dotcms/dotcms:trunk_36f72e4]

Screenshot

Screen.Recording.2024-08-26.at.1.mp4

@zJaaal zJaaal removed their assignment Aug 26, 2024
@zJaaal zJaaal closed this as completed Aug 26, 2024
@zJaaal zJaaal moved this from Internal QA to QA - Backlog in dotCMS - Product Planning Aug 26, 2024
@bryanboza
Copy link
Member

We lost the notification when you apply some change here:

Screen.Recording.2024-08-26.at.2.29.38.PM.mov

@bryanboza bryanboza added Needs Work Release : 24.08.27 Custom templates and loggin fixes labels Aug 26, 2024
@bryanboza bryanboza moved this from QA - Backlog to QA - Rejected in dotCMS - Product Planning Aug 26, 2024
@rjvelazco
Copy link
Contributor

rjvelazco commented Aug 27, 2024

@bryanboza I updated the QA server with the latest trunk image dotcms/dotcms:trunk_2f3045b [dotcms/dotcms Tags] and I'm not able to reproduce the issue in any supported Browser. I used the System Template, Default Template, and a Custom Page Template to test the issue. Let me know the image, starter, and the template you used

I noticed you are testing in the old page editor in your local environment and in the UVE editor on the QA server.

If this is not happening in the QA: Server/UVE we should not add the Needs Work label

Videos

Default Template

iqa-29034-templates-the-template-dropdown-in-page-properties-is-not-displaying-the-expected-custom-template-value.mov

System Template

iqa-29034-templates-the-template-dropdown-in-page-properties-is-not-displaying-the-expected-custom-template-value-system-template.mov

@rjvelazco rjvelazco moved this from QA - Rejected to QA - Backlog in dotCMS - Product Planning Aug 27, 2024
@bryanboza
Copy link
Member

ok, this is something related to the new edit mode, tested in the last trunk with the new edit mode and this is working as expected.

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