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

v10 feature: Nullable reference types #12017

Merged
merged 24 commits into from
Apr 22, 2022

Conversation

Zeegaan
Copy link
Member

@Zeegaan Zeegaan commented Feb 17, 2022

Notes

  • Add nullabillity to the Core project
    Some issues i ran into was nullable properties that was actually not nullable at all, just not initialized anywhere. Lets use UserSave as an example here:
    image
    We don't have a constructor for a UserSave, but we do use the json converter to Fill out the model when we get an incoming request, and with the attributes on "Username" we can see that it is required, and therefore it cannot be null.
    I've suppressed these nullable warnings for now using = null! but it is nonetheless interesting.

  • the compiler doesn't think that string.IsNullOrEmpty() is a null check, so I had to suppress a lot of these warnings.

  • Also the default ToString() method is now nullable, but it will only ever return null if you yourself overwrite it to do so, which means again a lot of these warnings just has to be suppressed with !

How to test

  • As this PR contains 925 files changes, this affects basically all of umbraco that uses core
  • Run all the unit, integration & acceptance tests and they should pass
  • Try creating a basic site with some document types & content

bergmania and others added 18 commits December 16, 2021 13:44
…le-reference-types-in-Umbraco-Core

# Conflicts:
#	src/Umbraco.Core/Configuration/Models/SecuritySettings.cs
#	src/Umbraco.Core/Events/DeleteEventArgs.cs
#	src/Umbraco.Core/Events/IEventDispatcher.cs
#	src/Umbraco.Core/Events/PassThroughEventDispatcher.cs
#	src/Umbraco.Core/Events/QueuingEventDispatcherBase.cs
#	src/Umbraco.Core/IO/MediaFileManager.cs
#	src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs
#	src/Umbraco.Core/PropertyEditors/DataValueEditor.cs
#	src/Umbraco.Core/Routing/DefaultUrlProvider.cs
@Zeegaan Zeegaan marked this pull request as draft February 17, 2022 12:11
@Zeegaan
Copy link
Member Author

Zeegaan commented Feb 17, 2022

We still have some problems with the SqlCE project preventing us from building, which is why this PR is still marked as draft 👍

Nikolaj Geisle added 4 commits February 24, 2022 11:23
…le-reference-types-in-Umbraco-Core

# Conflicts:
#	build/build.ps1
#	src/Umbraco.Core/Configuration/ConfigConnectionString.cs
#	src/Umbraco.Core/Configuration/Models/ConnectionStrings.cs
#	src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs
#	src/Umbraco.Core/Models/ContentType.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs
#	tests/Umbraco.Tests.AcceptanceTest/package.json
@Zeegaan Zeegaan marked this pull request as ready for review March 16, 2022 12:46
@Zeegaan Zeegaan merged commit 214bcce into v10/dev Apr 22, 2022
@Zeegaan Zeegaan deleted the v10/feature/nullable-reference-types-in-Umbraco-Core branch April 22, 2022 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants