Skip to content

Conversation

@Bosseyang
Copy link

@Bosseyang Bosseyang commented Dec 22, 2025

The added cancel button uses - href="javascript:history.back();" navigation back to the previous page.

This PR solves the issue #6666

The added cancel button uses - href="javascript:history.back();" navigation back to the previous page.
@github-actions
Copy link
Contributor

Thank you for submitting your first pull request, awesome! 🚀 If you haven't already, please take a moment to review our contribution guide. This guide provides helpful information to ensure your contribution aligns with our standards. A core team member will review your pull request.

If you like Orchard Core, please star our repo and join our community channels.

@Bosseyang
Copy link
Author

@Bosseyang please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

@dotnet-policy-service agree

Copy link
Member

@Piedone Piedone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! When addressing review feedback, please adhere to the following:

  • Please update your pull request according to feedback until it is approved by one of the core team members.
  • Apply suggested changes directly so the reviewer doesn't have to eyeball the changes. These resolve themselves after applying them, and that's fine.
  • Don't resolve other conversations so it's easier to track for the reviewer. Then, the reviewer will resolve them.
  • Feel free to mark conversations that you addressed to keep track of them with an emoji or otherwise, just don't resolve them.
  • Please keep conversations happening in line comments in those convos, otherwise, communication will be a mess. If you have trouble finding them, see this video.
  • When you're done addressing all feedback of a review, click "Re-request review" in the top-right corner for each reviewer, so they know that you're done.

}
@if (await AuthorizationService.AuthorizeAsync(User, CommonPermissions.ListContent, Model.Container))
{
<a class="btn btn-secondary" role="button" href="javascript:history.back();">@T["Cancel"]</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not really canceling anything (unlike under content item editors); Simply "Back"? Also, I'd rather put in on the left side of this section, since it's navigation, not an action (an actual cancel would be like that).

Copy link
Author

@Bosseyang Bosseyang Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! It is now changed in the latest commit: 9c0d5ce as per your suggestion.

}
@if (await AuthorizationService.AuthorizeAsync(User, CommonPermissions.ListContent, Model.Container))
{
<a class="btn btn-secondary" role="button" href="javascript:history.back();">@T["Cancel"]</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a returnUrl is set, that should be used instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we would have preferred to have used the built in returnUrl, but the problem is that in instances where we go two step further away from Content Items, it returns us and set us in an infinite loop due to how returnUrl works. For example:
Content Items -> Edit Blog (returnUrl = Content Items) -> Create Blog Post (returnUrl = Content Items + Edit Blog) -> Cancel goes back to Edit Blog (returnUrl = Content Items + Create Blog Post) -> Cancel goes back to Create Blog Post (returnUrl = Content Items + Edit Blog) ... and now we're stuck in a loop where clicking Cancel/back only adds then subtracts the returnUrl.

Hence we chose to solve it using: javascript.history.back

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then that's what needs to be fixed, because going back in history is not universally correct.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants