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

Bug: Getting pages with ".aspx" in file name fails #974

Closed
1 task done
heinrich-ulbricht opened this issue Sep 26, 2022 · 2 comments
Closed
1 task done

Bug: Getting pages with ".aspx" in file name fails #974

heinrich-ulbricht opened this issue Sep 26, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@heinrich-ulbricht
Copy link

Category

  • Bug

Describe the bug

Assume a page with the following file name: Test-NewForm.aspx---Some-information.aspx

This page cannot be retrieved properly. I encountered this when trying to provision such a page which threw at a strange location.

The root cause lies here:

if (pageName.EndsWith(".aspx"))
{
pageName = pageName.Replace(".aspx", "");
}

This code removes every occurrence of ".aspx" in the file name while it should only remove the last ".aspx".

So the current behavior is:

  • "Test-NewForm.aspx---Some-information.aspx" changes to "Test-NewForm---Some-information"

While it should be:

  • "Test-NewForm.aspx---Some-information.aspx" changes to "Test-NewForm.aspx---Some-information"

Steps to reproduce

  • create a page with the file name "Test-NewForm.aspx---Some-information.aspx"
  • try a Web.GetPagesAsync("Test-NewForm.aspx---Some-information.aspx")

It fails to get the page, although it is there.

Expected behavior

It should detect pages with ".aspx" as part of the file name.

Environment details (development & target environment)

CURRENT :)

@jansenbe jansenbe self-assigned this Sep 26, 2022
@jansenbe jansenbe added the bug Something isn't working label Sep 26, 2022
@jansenbe
Copy link
Contributor

Thanks for reporting this one @heinrich-ulbricht , clearly a bug. I'll work on a fix.

@jansenbe
Copy link
Contributor

@heinrich-ulbricht : fixed, use the next nightly of PnP Core and PnP Framework to test.

heinrich-ulbricht added a commit to WikiTransformationProject/pnpcore that referenced this issue Sep 26, 2022
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

No branches or pull requests

2 participants