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

Fixed error message in Script window #7935

Merged

Conversation

lilyclements
Copy link
Contributor

@lilyclements lilyclements commented Oct 26, 2022

Fixes #7931

If I tried to paste an image (e.g. jpeg) into the script window, it would try to bring up the error message that this cannot be performed.
However, instead of bringing up the error message, it would crash.
This fixes that bug

@africanmathsinitiative/developers this is ready to review

@lloyddewit
Copy link
Contributor

@rdstern Please can you test? thanks

instat/ucrScript.vb Outdated Show resolved Hide resolved
@lloyddewit
Copy link
Contributor

@lilyclements Thank you for finding this bug.
I was able to recreate the error and your fix is correct. I took the liberty of changing it to be more consistent with the rest of the code. I don't think we need @rdstern 's test for this, so I'll go ahead and merge. I hope that's OK.

@lloyddewit lloyddewit changed the title Fixing error message in script window Fixed error message in Script window Oct 26, 2022
@lloyddewit lloyddewit added the bug label Oct 26, 2022
@lloyddewit lloyddewit merged commit a393f8d into IDEMSInternational:master Oct 26, 2022
@Patowhiz
Copy link
Contributor

@lloyddewit how were you able to recreate the error?
It's interesting because the script window is designed to disable pasting if clipboard content is not text.

@lloyddewit
Copy link
Contributor

@lloyddewit how were you able to recreate the error? It's interesting because the script window is designed to disable pasting if clipboard content is not text.

I tested by:

  • I opened the script window, typed in some text, then cut/pasted it back again. This worked as expected.
  • I made a screen shot (<windows key><shift>S) and pasted this into the script window. Before @lilyclements 's change, this raised an exception. The exception was raised because line 383 attempted to pass a string to an integer parameter.
  • After @lilyclements 's fix, it displayed a warning message box (the correct and expected behaviour)

@Patowhiz
Copy link
Contributor

@lloyddewit agreed that Message box should have been fixed either way.
Did you reproduce this in windows 11? My windows 10 behaves differently. The message box never pops up.

@lloyddewit
Copy link
Contributor

Interesting that you (and probably others) experience different behaviour. I have 64-bit Windows 10.

Edition	Windows 10 Home
Version	21H2
Installed on	‎01/‎10/‎2020
OS build	19044.2130
Serial number	PF11RZGQ
Experience	Windows Feature Experience Pack 120.2212.4180.0

@Patowhiz
Copy link
Contributor

Patowhiz commented Oct 27, 2022

@lloyddewit many thanks for your responses.

Maybe it's the windows version difference.
Below is the windows version I tried to test this on. Still 64 bit.

Edition	Windows 10 Pro
Version	21H1
Installed on	‎07/‎12/‎2019
OS build	19043.1889
Experience	Windows Feature Experience Pack 120.2212.4180.0

Will test on my windows 11 machine and check on its behavior.

The reason as to why these minor development stage details are important is because in production environment, they are at times the cause of bigger issues. During trainings we have encountered same windows machines behaving oddly different and at times we have to request users share 1 machine. @rdstern can testify how that at times is a bit frustrating (first session and already problems). Seems like in certain scenarios .Net behaves slightly different in different windows build versions.

@lilyclements
Copy link
Contributor Author

lilyclements commented Oct 27, 2022

@Patowhiz @lloyddewit just if you were interested - my specs are the same version as @lloyddewit (21H2). But otherwise some differences

Edition	Windows 11 Home
Version	        21H2
Installed on	‎03/‎04/‎2022
OS build	22000.978
Experience	Windows Feature Experience Pack 1000.22000.978.0

@lilyclements lilyclements deleted the lilyclements-patch-1 branch October 27, 2022 10:54
@Patowhiz
Copy link
Contributor

Thanks @lilyclements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minor bug in Script Window message
3 participants