-
Notifications
You must be signed in to change notification settings - Fork 580
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
Can't Add Page without parent while Using Persian (Iran) Language #5054
Comments
@behzadvahidpour localization only affects the display of the UI text - it does not affect functionality. I am unable to reproduce the problem locally. This usually means that there is something specific to your environment or the data in your installation which is causing the issue. Please include the browser Url in the screen shot and also click the Parent dropdown so that the list of pages in displayed in the screen shot as well - this may provide hints why your installation is throwing an exception. The error message is indicating that the Page ID has single quotes enclosing it - which should not be possible as Page Id is stored an integer in the database. |
@sbwalker I did record the entire process, & also screenshots of the Parent dropdown list of pages thx. |
@behzadvahidpour I am able to reproduce the problem locally... but I have no explanation for the behavior. I added some debugging statements: The value of _parentid is "-1" however when the int.Parse() is executed it throws an error: This error only occurs when the culture is set to Persian (Iran) |
It appears that in order to support Persian, the InvariantCulture method of int.Parse needs to be used: int.Parse(_parentid, CultureInfo.InvariantCulture) And since the technique of using a "-1" string to represent an "undefined" option is used throughout the framework, this would require a lot of changes to address the problem (ie. it is not confined to "Add Page") |
Just tried setting up defaults in program.cs
but unfortunately that didn't help :( This issue can affect all Right-to-Left (RTL) languages (e.g., Arabic, Persian, Urdu, Hebrew) |
I tried to submit PR #5083 to resolve this issue. but it's not a perfect solution as we may introduce new references to int.Parse in future, also we can't make sure 3rd party module developers know this restrict and use this converter instead of original parse function. |
submitted another PR #5094 which should be the correct solution. |
Thank you for your effort to solve this issue. I am eagerly waiting for the new release. @sbwalker @zyhfish @leigh-pointer |
Fix #5054: resolve the issue in fa-IR language.
Oqtane Info
Version -6.0.2.0
Render Mode - Static
Interactivity - Server
Database - SQL Server
application returning error whenever in language section i select Iran(Fa) and try to add new page Parent:
Error Loading Page The input string '-1' was not in a correct format.
exception generated by the system
System.FormatException: The input string '-1' was not in a correct format.
at System.Number.ThrowFormatException[TChar](ReadOnlySpan
1 value) at System.Int32.Parse(String s) at Oqtane.Modules.Admin.Pages.Add.<OnInitializedAsync>b__34_0(Page item) in D:\Project\oqtane.framework-dev\oqtane.framework-dev\Oqtane.Client\Modules\Admin\Pages\Add.razor:line 276 at System.Linq.Enumerable.ListWhereIterator
1.MoveNext()at Oqtane.Modules.Admin.Pages.Add.OnInitializedAsync() in D:\Project\oqtane.framework-dev\oqtane.framework-dev\Oqtane.Client\Modules\Admin\Pages\Add.razor:line 276
{"Error":"The input string \u0027-1\u0027 was not in a correct format."}
Steps To Reproduce
1- Adding Persian (Iran) for localization and enable it
2- Add new Page
3- Select as Parent Page
The text was updated successfully, but these errors were encountered: