-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Empty values are not getting saved #11373
Comments
Is this happen in the latest bits too? If Yes it's a bug |
In 1.3.0? I haven't tested it. Let me upgrade and try. Are there any breaking changes other than .net core support? I am already using .net 6. |
AFAIK, there's no breaking in this release except changing the TFM |
This happens in 1.3.0 too. I tested this in the text field, link field, and checkboxes. Repro,
|
Which browser are you using when getting this issue? I just tried with the latest preview Nuget packages and I can't repro this issue. We need more details to be able to repro because this doesn't seem to be reproducible by using SQL Server and Google Chrome as the browser. When you say Decoupled; I assume that you are not using your own custom controller with views to edit your content items but using the actual Orchard Core admin interface to make your changes. Then, here Decoupled doesn't make a difference. Though, if you are using a custom controller that caches the data then you could potentially have a caching invalidation issue. This looks more like a cache issue than a browser issue to me. Unless your data never gets updated when you submit changes from the Admin UI ... that would be never seen before. |
I tried debugging and found the problem is in the DisplayDriver of each fields Here is an example that's easy for me to explain. Take this BooleanFieldDisplayDriver, The problem I faced in boolean fields is we were able to set that to true and save it. But when we want to uncheck it and save, it won't change and remain true always. So, I created a Module and copied the "BooleanFieldDisplayDriver" from OC code and added it to my module to debug it. model.Value is getting set with the latest value(in my case its "false") and the model.Field is still having true and this is why its not updating in the database. I tried setting the model.Field.Content.Value to the latest value and its working - I checked in the database. This is the same case for Link field, Text field and other fields as well. Thanks, |
Please let me know your views on this. |
This is not supposed to be required. You are simply affecting a value manually which gets affected when you do |
Hey @Skrypt , Thanks for the quick response. I tried with the sample App that is in Orchard Source. I didn't get this issue in the sample. I agree this is not in Orchard source. But when I import the content definition from my own app to the sample app, I get the issue. I don't do any other changes to the sample app. Would my own content types and content parts trigger this issue? Thanks, |
Yes, there may be an issue with your Content Definitions. Try to compare them with a Content Type exported from source code solution. If there are differences then let us know. Normally, it should have been migrated if the issue is that you upgraded from a previous version. |
@Skrypt I am using the below JsonSerializerSettings as default in my app.
This conflicts with the settings(JsonMergeSettings I hope) in OC. Please let me know your suggestions to overcome this. Thanks, |
You could try to create a scope that uses these settings only when requested for the parts that you require to use them. Else, changing the defaults of Orchard Core is probably not a good idea. |
OK, but I am using this setting in my MVC app as a default setting for all my JSON serialization. I don't want OC to pick this setting as I hope it has its own setting in it. Can you please explain how do we scope my setting to my app alone? |
@Skrypt Any inputs? |
Hmm, we use a lot Newtonsoft and I don't think we override any System.Text.Json settings at the tenant/modules level, meaning that we use the inherited default settings. So you may need to do revert your custom settings at the tenant level. We have
|
Thanks @jtkech. Let me try and update here. |
Thanks @jtkech @Skrypt for helping me in identifying the root cause, I have fixed the issue. Here is what worked for me, I am setting this in my .Net core app
and I am setting this in the OC tenant settings,
|
I know this is weird. But this happens in the Orchard 1.2.2 version.
Repro,
Expected is that the textbox should be empty.
The same goes for checkboxes when there is only one checkbox and unchecking it.
Thanks,
R. Venkatesan
The text was updated successfully, but these errors were encountered: