-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix pager HTML validation error: remove invalid <a> when disabled #18404
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
base: main
Are you sure you want to change the base?
Fix pager HTML validation error: remove invalid <a> when disabled #18404
Conversation
|
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. |
|
@dotnet-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't add many whitespaces next time
src/OrchardCore.Modules/OrchardCore.Navigation/PagerShapesTableProvider.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Navigation/PagerShapesTableProvider.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Navigation/PagerShapesTableProvider.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Navigation/PagerShapesTableProvider.cs
Show resolved
Hide resolved
…eProvider.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
…eProvider.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
…eProvider.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
…eProvider.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
|
Applied your suggestion, thanks @hishamco |
| } | ||
| else | ||
| { | ||
| shape.Attributes.Remove("href"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed?
|
I removed |
|
Hi @hishamco, just wanted to follow up on your last comment. Since the tag is no longer rendered for disabled items, I removed the shape.Attributes.Remove("href") call as it’s not needed anymore. Could you please confirm if this resolves your concern? |
|
Could you please take a GIF screenshot to see what it looks like now |
src/OrchardCore.Modules/OrchardCore.Navigation/PagerShapesTableProvider.cs
Outdated
Show resolved
Hide resolved
|
@Piedone, do you have anything to add here, or shall we merge |
|
I didn't check the code (on mobile) but from the above comments the results look good. |
|
@wAsnk, do you want to check this PR? |
|
Nothing else from my side, up to Hisham. |
Looks good to me. |
|
@hishamco can't this be merged? |
|
Hi @hishamco, It’s been a while since the last update, and I noticed the PR has already passed all checks and received approvals. Could you please let me know if there’s any reason it hasn’t been merged yet? I’ve been waiting for some feedback or final confirmation, and it’s a bit discouraging not to hear back after addressing all comments and providing the requested changes. I’d really appreciate an update on this. Thanks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the entire <a> tag also removes its inner content, including text and icons, because the associated value is no longer rendered. This can unintentionally break existing themes and layouts.
For example, in the admin interface, the pager changes from:

To preserve the structure and visual integrity, only the rel attribute should be removed not the entire anchor tag.


When rendering the Pager shape, the “Previous” link is shown as disabled on the first page.
However, it was still outputting an element with a
relattribute but nohref, which causes an HTML validation error.Example before fix:
This PR updates the ActionLink shape to remove the entirely when disabled, while keeping the
<li class="disabled">placeholder for consistent layout.Example after fix:
Fixes #17907