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 report: The 'spo listitem batch set' command breaks on XML forbidden character, like & #6430

Open
martinlingstuyl opened this issue Oct 15, 2024 · 5 comments
Assignees
Labels
bug hacktoberfest Issue perfect for hacktoberfest work in progress

Comments

@martinlingstuyl
Copy link
Contributor

martinlingstuyl commented Oct 15, 2024

Priority

(Medium) I'm annoyed but I'll live

Description

When using m365 spo listitem batch set, the command can break if the CSV contains column values with an XML forbidden character, like &.

The command throws an error saying:
Error: An error occurred while parsing EntityName. Line 1, position 6515. - null

That is because we build a XML string for the CSOM call. We should probably replace the ampersands with &, and there are probably more characters to be escaped...

Steps to reproduce

Run the command with the following CSV

"ID","Title"
"1","Some update & fixes"

Expected results

It should update the list item without issues.

Actual results

It throws the error

Error: An error occurred while parsing EntityName. Line 1, position <number>. - null

Diagnostics

No response

CLI for Microsoft 365 version

10

nodejs version

20

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

No response

Implementation

We need to escape all XML forbidden characters:

"   &quot;
'   &apos;
<   &lt;
>   &gt;
&   &amp;
@milanholemans
Copy link
Contributor

Let's make sure we escape all special characters indeed.

@martinlingstuyl
Copy link
Contributor Author

I've added it to the last section

@Saurabh7019
Copy link
Contributor

Can I work on this?

@martinlingstuyl
Copy link
Contributor Author

You most certainly can!

@martinlingstuyl
Copy link
Contributor Author

If you're fast, it can count towards hacktoberfest 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug hacktoberfest Issue perfect for hacktoberfest work in progress
Projects
None yet
Development

No branches or pull requests

3 participants