Compare commits

...

485 Commits

Author SHA1 Message Date
perploug 08d74e3320 Tiny tweak more 2014-04-03 14:01:25 +02:00
perploug 98fd75b55d Updating user screen on the installer 2014-04-03 13:52:18 +02:00
perploug e7da70e076 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-04-03 11:52:01 +02:00
perploug 200cec0e23 Hardcodes starterkit guid into the installer
This way we can change it remotely to another package instead of relying
on just getting the first guid in the collection of kits
2014-04-03 11:51:51 +02:00
perploug 807778a737 Fixes: U4-4592 U7.1 - You can trigger a lot "Unsaved changes" bars 2014-04-03 11:50:50 +02:00
Sebastiaan Janssen 66d61c9d20 One more ImageProcessor update 2014-04-03 11:29:13 +02:00
Sebastiaan Janssen ecae5a856a Merge branch '6.2.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0
Conflicts:
	src/Umbraco.Core/Services/IRelationService.cs
	src/Umbraco.Web/Models/PublishedProperty.cs
	src/Umbraco.Web/PublishedCache/MemberPublishedContent.cs
2014-04-03 11:13:13 +02:00
Sebastiaan Janssen bf8add4f8d Manually picked up PR #343 2014-04-03 11:10:43 +02:00
perploug 256fa3385a Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-04-03 09:31:47 +02:00
perploug ebaa46b2fc Fixes: U4-4212 Insert Image in RTE not resizing image 2014-04-03 09:31:32 +02:00
Sebastiaan Janssen e207185d51 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-04-03 09:30:12 +02:00
Sebastiaan Janssen 5efc45a7dd Bump version number 2014-04-03 09:29:52 +02:00
Sebastiaan Janssen c3fc27565d Update version of ImageProcessor and refer to NuGet in the csproj instead of the bin (!) 2014-04-03 09:26:51 +02:00
Sebastiaan Janssen 0af3f9dce0 Fixes U4-4278 Multiple RadioButtonList on one Document
Manually applying pull request as it's a bit faster to copy&paste instead of resolve merge conflicts
2014-04-03 08:55:19 +02:00
perploug 426b02b08a Sets zoom throttle to 100 instead of 300
To limit the number of re-calculations, but still keep it somewhat
fluent
2014-04-03 00:41:27 +02:00
perploug a4e23ef82b Missing files in last commit 2014-04-03 00:40:36 +02:00
perploug d0c6c4aafa Fixes: U4-4332 MediaPicker - Typealias is hardcode several places 2014-04-03 00:37:59 +02:00
perploug 3ea7e6fb8a Partially fixes: U4-4479 Cropper preview in backoffice is a bit off from the actual crop
Makes the cropper card UI reset on save, ensuring changes populate
2014-04-02 23:04:37 +02:00
Stephan 9940b78a57 U4-4575 - fix 8371105 2014-04-02 17:00:24 +02:00
Stephan 8371105c10 U4-4575 - property converters use wrong source value 2014-04-02 16:00:46 +02:00
perploug d4b0f3c570 Resizing safeguards to ensure we only return positive 2014-04-02 14:21:40 +02:00
perploug 29416320d2 Fixes failing macrospec tests
doooh, it referenced marcoParamsDictionary - instead of
macroParamsDictionary - whats up with that Marco guy?
2014-04-02 13:43:03 +02:00
perploug d11eb485e1 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-04-02 13:19:41 +02:00
perploug 300bd3bed4 Fixes: U4-4558 U7 Macro Parameter Editors needs some love!
Adds some config to the media picker and fixes thumbnail issues
2014-04-02 13:19:26 +02:00
Sebastiaan Janssen 3ca5443350 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-04-02 12:02:29 +02:00
Sebastiaan Janssen f6d56f51d4 Merge branch '6.2.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0
Conflicts:
	src/Umbraco.Core/Services/IRelationService.cs
	src/Umbraco.Web/Controllers/UmbRegisterController.cs
2014-04-02 12:01:55 +02:00
Sebastiaan Janssen 53c0bd6938 Fixes: Password is not saved when using the Register snippet 2014-04-02 11:59:16 +02:00
perploug 174aa9f4ad Fixes: U4-4581 Hotkey - Click on disabled element 2014-04-02 11:51:56 +02:00
Sebastiaan Janssen a768fe5bb3 Ports behaviour from membershiphelper from v7 to 6 to make them the same 2014-04-02 11:42:48 +02:00
Sebastiaan Janssen d9c66cd4b3 Adds AddRelation and missing events in RelationService from v7 into v6 2014-04-02 11:41:59 +02:00
Stephan 6d3e8e1f6d U4-4559 - tests 2014-04-02 11:40:05 +02:00
Stephan b6185b847f U4-4575 - property converters use wrong source value 2014-04-02 11:39:53 +02:00
perploug c8877d0a2c Fixes failing dropdown prop editor tests 2014-04-02 11:35:23 +02:00
perploug 891810b045 Adds newsletter to installer
With the good ol' V6 installer code, ahhh the smell of code patina
2014-04-02 11:20:35 +02:00
Sebastiaan Janssen 77d910b6b6 We don't really need to scream greetings to people who try to use the member picker 2014-04-01 19:14:42 +02:00
Sebastiaan Janssen 47044b3a77 Merge branch '6.2.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-04-01 16:46:43 +02:00
Sebastiaan Janssen 5b693f9310 Adds ability to add/remove a single role to/from a single member, which is much nicer than having to instantiate arrays 2014-04-01 16:43:11 +02:00
Sebastiaan Janssen 40ebc1295c Fixes error thrown when saving password and actually using the Umbraco membership provider 2014-04-01 15:30:42 +02:00
Sebastiaan Janssen b769b224c2 Fixes error thrown when saving password and actually using the Umbraco membership provider 2014-04-01 15:29:16 +02:00
Sebastiaan Janssen 89efe40f41 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-04-01 14:27:47 +02:00
Sebastiaan Janssen 51660d918c Assembly redirect seems to help a lot installing NuGet pkg, should finally be able to close U4-4510 nuget targets file creates an invalid path in the property group 2014-04-01 14:22:13 +02:00
Sebastiaan Janssen ea7b053106 Merge pull request #340 from leekelleher/U4-4550
Fixes: U4-4550 Media Picker preview with transparent images
2014-04-01 13:06:58 +02:00
Sebastiaan Janssen 3e17201ce7 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-04-01 11:59:26 +02:00
Sebastiaan Janssen 1f03983628 Clean up belle/build folder when building with build.bat to make sure it's pristine 2014-04-01 11:54:25 +02:00
Sebastiaan Janssen 15aa6fc4b8 Fixed U4-4576 7.0.4 : InternalMemberSearcher config incorrectly uses 'enableLeadingWildcards', should be 'enableLeadingWildcard' 2014-04-01 11:53:56 +02:00
Sebastiaan Janssen 41e8a9ef2d Fixed U4-4576 7.0.4 : InternalMemberSearcher config incorrectly uses 'enableLeadingWildcards', should be 'enableLeadingWildcard' 2014-04-01 11:51:51 +02:00
perploug a492976a32 Fixes: U4-4557 Color Picker - default is black, but it can't be added without choosing another color first
Sets color to be black by default, so will be added if you click add
without setting anything, so its consistent with the default swatch
2014-04-01 10:08:50 +02:00
perploug 88e09f9077 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-04-01 10:02:23 +02:00
perploug 65a1709bd3 Fixes: U4-4537 Macro Textbox parameter in RTE Encoding issue 2014-04-01 10:02:10 +02:00
Sebastiaan Janssen 6478a8424a Fixes test, additional Tag mapper requires count to be updated 2014-04-01 09:11:07 +02:00
leekelleher 55ade4e491 Replaced solid/semi-transparent background, with a checkered background image. 2014-03-31 22:45:35 +01:00
Stephan a767aa9f3a Merge pull request #342 from kipusoep/7.1.0
Changed $('#form1') usage to $('form')
2014-03-31 18:19:29 +02:00
Sebastiaan Janssen 50321e5936 Merge pull request #336 from bjarnef/7.1.0_-_U4-4026
Fix for U4-4026 Inline styling affect header text
2014-03-31 17:32:50 +02:00
perploug 1321702d19 Fixes: U4-3649 Bottom button bar gradient overlaps last field
Temp fix, as we will likely refactor or editor directives before
building more core editors
2014-03-31 13:24:30 +02:00
perploug 005ff2f830 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-31 13:17:27 +02:00
perploug dff3fde840 Fixes: U4-4553 7.1 Template drop down has values but is blank
patches the it on the clientside for now, longerterm solution is to have
templates being returned as prevalues, but will leave that to shannon as
there could be other things accidentally being poked doing that.
2014-03-31 13:17:15 +02:00
Sebastiaan Janssen 44504ff6af Fixes summary for the TagMapper 2014-03-31 12:59:28 +02:00
Sebastiaan Janssen 25d3389759 Merge pull request #341 from robertjf/7.1.0
Fixes #U4-4544 Issue: TagService.GetAllTags(group) throws Exception in MappingResolver
2014-03-31 12:57:51 +02:00
Robert Foster 3f97c74712 removed commented out code 2014-03-31 22:00:54 +11:00
perploug 1152b61fb0 7.1 login greetings update 2014-03-31 12:43:05 +02:00
perploug b1842de045 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-31 12:37:26 +02:00
perploug 750a2862ee Fixes: U4-4562 Images and markdown editor 2014-03-31 12:37:08 +02:00
perploug 7632075df4 Fixes: U4-4536 Tree points to wrong views after install 2014-03-31 12:29:44 +02:00
perploug aa75cd4ea8 Fixes: U4-4549 Related Links "New Window" checkbox has css "display: none" 2014-03-31 12:28:56 +02:00
Sebastiaan Janssen 06827bd7a5 Merge pull request #338 from vnbaaij/7.1.0
Solution for  U4-4548
2014-03-31 11:57:13 +02:00
Stefan Kip 9a82ab7d4a Changed $('#form1') usage to $('form')
I'm having an issue with v6.1.6 where the form's id is 'aspnetForm' instead of 'form1', I don't know why.
Using $('form') is much safer than using $('#form1').
2014-03-31 09:56:16 +02:00
Robert Foster b1037d1936 Added a TagMapper class to resolve ITag back to TagDto. 2014-03-30 19:07:35 +11:00
leekelleher ccdc3a1eab Fixes: U4-4550 Media Picker preview with transparent images 2014-03-28 16:59:34 +00:00
Vincent Baaij a47387fec0 Solution for U4-4548 2014-03-28 16:03:51 +01:00
perploug c29d08c915 Fixes: U4-4489 7.1 RC, warn about changes partially overlays breadcrumb 2014-03-28 11:00:29 +01:00
perploug b8f796eb2c Fixes: U4-4532 Unable to insert Image in TinyMCE when Image property 'umbracoFile' is changed from type 'Upload' to the new 'Image Cropper' 2014-03-28 10:39:24 +01:00
Shannon b9088c9ac0 fixes build 2014-03-28 08:51:25 +11:00
Shannon 7a8f8ac0fe Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-28 08:31:52 +11:00
Shannon 49cf0f98ce U4-1752 - Add GetPreValueAsString(id) method to the @Umbraco helper 2014-03-28 08:31:21 +11:00
Shandem 22ffa86e18 Merge pull request #301 from Jeavon/U4-1752
U4-1752 - Add GetPreValueAsString(id) method to the @Umbraco helper
2014-03-28 08:21:32 +11:00
perploug c4e2d98138 U4-4532 Unable to insert Image in TinyMCE when Image property 'umbracoFile' is changed from type 'Upload' to the new 'Image Cropper'
Replaces the old media api with the resolveFile helper methods
2014-03-27 02:46:32 -07:00
Shannon c01211c62d Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs
2014-03-27 17:28:46 +11:00
Shannon d8a3e00440 Fixes: U4-2843 Copying Document Type when Selecting Master Doesn't Work (Master ignored), U4-3552 Copy nested document type is failing 2014-03-27 17:26:55 +11:00
Shannon 264c537b50 Fixes: U4-4530 Edit Profile Snippet: Check for null before loop 2014-03-27 16:52:43 +11:00
Shannon f26c61d736 renames file 2014-03-27 16:43:34 +11:00
Shannon 43f647fd94 Fixes U4-4531 dialogService.macroPicker callback wrong property name 2014-03-27 16:43:20 +11:00
Shannon cc0bcc2d59 Fixes unit tests 2014-03-27 16:27:57 +11:00
Shannon 1b23540b87 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Web/Cache/DistributedCache.cs
2014-03-27 16:12:37 +11:00
Shannon c309e18f13 Fixes: U4-459 Public Access permissions not set on distributed servers 2014-03-27 16:11:34 +11:00
Shannon dec60885b4 Fixes more thread safety issues with Access.cs 2014-03-27 15:50:56 +11:00
Shannon eee09ec45b Completes: U4-459 Public Access permissions not set on distributed servers 2014-03-27 14:43:07 +11:00
Shannon b4daab2856 started fixing: U4-459 Public Access permissions not set on distributed servers but have commented that code out for now because it will cause problem in some LB scenarios. 2014-03-27 14:28:45 +11:00
Shannon fdfbad254d Fixes some very badly handled threading issues with the Access (public access) class 2014-03-27 14:28:12 +11:00
bjarnef 0c6e766030 Fix for U4-4026 Inline styling affect header text
Inline styling on container affect header text and dropdown with
text-align:center on language in settings section.
2014-03-27 02:42:21 +01:00
Shannon 7444363cef adds another null check to the other TranslateItem method 2014-03-27 08:13:05 +11:00
Shandem a82097b92b Merge pull request #334 from Jeavon/U4-4527
Fix for U4-4527 U7 - Creating initial Folder in media section causes exc...
2014-03-27 08:05:56 +11:00
Jeavon Leopold 07934161a4 Fix for U4-4527 U7 - Creating initial Folder in media section causes exception 2014-03-26 10:07:20 +00:00
Shandem 9194030a9a Merge pull request #333 from Nicholas-Westby/7.1.0
Replaced "retreive" with "retrieve".
2014-03-26 17:45:03 +11:00
Shannon 1cbaace777 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	build/Build.proj
	build/NuSpecs/UmbracoCms.Core.nuspec
	build/NuSpecs/build/UmbracoCms.targets
	build/NuSpecs/tools/install.ps1
	src/Umbraco.Web.UI/umbraco_client/Editors/EditScript.js
2014-03-26 15:06:03 +11:00
Nicholas-Westby ef5052324b Replaced "retreive" with "retrieve". 2014-03-25 20:49:52 -07:00
Nicholas-Westby 204a8d813c Replaced "retreive" with "retrieve". 2014-03-25 20:48:05 -07:00
Nicholas-Westby 8009cb3892 Replaced "retreive" with "retrieve". 2014-03-25 20:46:23 -07:00
Nicholas-Westby 284d168cd7 Replaced "retreive" with "retrieve". 2014-03-25 20:45:28 -07:00
Nicholas-Westby fdd025aefd Replaced "retreive" with "retrieve". 2014-03-25 20:44:47 -07:00
Nicholas-Westby e36d4768e1 Replaced "retreive" with "retrieve". 2014-03-25 20:44:08 -07:00
Nicholas-Westby df2047e8f8 Replaced "retreive" with "retrieve". 2014-03-25 20:43:32 -07:00
Nicholas-Westby d9280d5238 Replaced "retreive" with "retrieve". 2014-03-25 20:42:29 -07:00
Nicholas-Westby 388249f500 Replaced "retreive" with "retrieve". 2014-03-25 20:41:32 -07:00
Nicholas-Westby a08b75592e Replaced "retreive" with "retrieve". 2014-03-25 20:40:44 -07:00
Nicholas-Westby 38ea6dfbfe Replaced "retreive" with "retrieve". 2014-03-25 20:39:45 -07:00
Nicholas-Westby 39ccde221a Replaced "retreive" with "retrieve". 2014-03-25 20:38:58 -07:00
Nicholas-Westby 17b6366ea3 Replaced "retreive" with "retrieve". 2014-03-25 20:37:20 -07:00
Nicholas-Westby 3d6a608b12 Replaced "retreive" with "retrieve". 2014-03-25 20:36:46 -07:00
Nicholas-Westby 851f58df9c Replaced "retreive" with "retrieve". 2014-03-25 20:35:36 -07:00
Nicholas-Westby 0ff0cc6366 Replaced "retreive" with "retrieve". 2014-03-25 20:34:44 -07:00
Nicholas-Westby 08004ecc68 Replaced "retreive" with "retrieve". 2014-03-25 20:33:59 -07:00
Nicholas-Westby 4a2544d0e6 Replaced "retreive" with "retrieve". 2014-03-25 20:32:39 -07:00
Nicholas-Westby bace1cce74 Replaced "retreive" with "retrieve". 2014-03-25 20:31:31 -07:00
Nicholas-Westby acc88e25d8 Replaced "retreive" with "retrieve". 2014-03-25 20:30:17 -07:00
Nicholas-Westby 2a1a16d478 Replaced "retreive" with "retrieve". 2014-03-25 20:28:47 -07:00
Nicholas-Westby a5afb8ed19 Replaced "retreive" with "retrieve". 2014-03-25 20:27:57 -07:00
Nicholas-Westby d02678e05c Replaced "retreive" with "retrieve". 2014-03-25 20:26:58 -07:00
Nicholas-Westby 9e0bbd3c99 Replaced "retreive" with "retrieve". 2014-03-25 20:26:06 -07:00
Nicholas-Westby 539efcc669 Replaced "retreive" with "retrieve". 2014-03-25 20:25:24 -07:00
Nicholas-Westby d0d9d85151 Replaced "retreive" with "retrieve". 2014-03-25 20:24:27 -07:00
Nicholas-Westby ffa307613c Replaced "retreive" with "retrieve". 2014-03-25 20:23:36 -07:00
Nicholas-Westby 19ea6d6005 Replaced "retreive" with "retrieve". 2014-03-25 20:22:34 -07:00
Nicholas-Westby 155b1737d3 Replaced "retreive" with "retrieve". 2014-03-25 20:20:51 -07:00
Nicholas-Westby b66253f33e Replaced "retreive" with "retrieve". 2014-03-25 20:19:50 -07:00
Nicholas-Westby bcbadfe648 Replaced "retreive" with "retrieve". 2014-03-25 20:19:12 -07:00
Nicholas-Westby 3325b06873 Replaced "retreive" with "retrieve". 2014-03-25 20:18:30 -07:00
Nicholas-Westby 852914bf6b Replaced "retreive" with "retrieve". 2014-03-25 20:17:55 -07:00
Nicholas-Westby 3e14807370 Replaced "retreive" with "retrieve". 2014-03-25 20:17:18 -07:00
Nicholas-Westby e44cb6708d Replaced "retreive" with "retrieve". 2014-03-25 20:16:31 -07:00
Nicholas-Westby fd43b27d00 Replaced "retreive" with "retrieve". 2014-03-25 20:15:34 -07:00
Nicholas-Westby 524f113611 Replaced "retreive" with "retrieve". 2014-03-25 20:14:54 -07:00
Nicholas-Westby 04dcf50218 Replaced "retreive" with "retrieve". 2014-03-25 20:14:23 -07:00
Nicholas-Westby 2b497deaa3 Replaced "retreive" with "retrieve". 2014-03-25 20:13:30 -07:00
Nicholas-Westby dbe2f8ea37 Replaced "retreive" with "retrieve". 2014-03-25 20:12:50 -07:00
Nicholas-Westby 7dc0239ad1 Replaced "retreive" with "retrieve". 2014-03-25 20:11:46 -07:00
Nicholas-Westby 72fdc5f472 Replaced "retreive" with "retrieve". 2014-03-25 20:10:34 -07:00
Shannon cde3c42cec Fixes: U4-4455 Javascript error with single quotes in literals
Conflicts:
	src/Umbraco.Web.UI/umbraco_client/Editors/EditScript.js
2014-03-26 13:34:26 +11:00
Shannon 10b544abb9 Fixes: U4-4455 Javascript error with single quotes in literals 2014-03-26 13:31:15 +11:00
Shannon 88aecdf672 fixes U4-4517 Color picker not showing colors 2014-03-26 13:07:07 +11:00
Shannon ad95736eaa Fixes issues relating to adding ability to sort pre-values, had to update all property editors that use the shared sortable pre-values, ensure the list items are an array and then sorted. 2014-03-26 13:01:53 +11:00
Shannon 34a21a78a0 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-26 11:23:58 +11:00
Shannon 1e01c2669f fixes missing semi-colon 2014-03-26 11:23:48 +11:00
Shandem d3a7389b89 Fixes file name casing 2014-03-26 11:21:31 +11:00
Shandem bc8b6c4bea Fixes file name casing 2014-03-26 11:21:08 +11:00
Shandem 3953a48a3b Merge pull request #332 from arknu/7.1_U4-3744
U4-3744: Make it possible to make individual selections while still selecting the entire text on first click
2014-03-26 11:08:50 +11:00
Shannon 2f44e94bd0 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-26 11:00:46 +11:00
Shannon 5eeb8d7df6 Fixes: U4-4520 Issue: MultipleTextStringValueConverter returns an empty string array due to mismatched XML value format 2014-03-26 11:00:32 +11:00
arknu 231f23cc6e Cleaned up the code a bit 2014-03-25 22:26:05 +01:00
Sebastiaan Janssen 3235678d29 U4-4510 nuget targets file creates an invalid path in the property group
That should fix this one properly now
2014-03-25 20:40:44 +01:00
Sebastiaan Janssen f13ddddc16 U4-4510 nuget targets file creates an invalid path in the property group
That should fix this one properly now
2014-03-25 20:39:46 +01:00
arknu 490c346fcf U4-3744: Make it possible to make individual selections while still selecting the entire text on first click 2014-03-25 19:34:19 +01:00
Shannon 8f1d8419a0 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	build/NuSpecs/build/net40/UmbracoCms.targets
	build/NuSpecs/build/net45/UmbracoCms.targets
	build/NuSpecs/build/net451/UmbracoCms.targets
	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
2014-03-25 15:47:57 +11:00
Shannon be8320bb4b fixes some compatibility issues with PR for sortable pre-vals 2014-03-25 14:14:09 +11:00
Shannon 1d4b6178e5 Merge branch 'wip-u4-3951' of https://github.com/AndyButland/Umbraco-CMS into AndyButland-wip-u4-3951
Conflicts:
	src/Umbraco.Web.UI.Client/src/views/prevalueeditors/multivalues.html
2014-03-25 13:31:21 +11:00
Shannon 3427f596e3 fixes up a few notes. 2014-03-25 13:07:16 +11:00
Shannon c31ea7409f Merge branch 'fix-u4-3839' of https://github.com/lars-erik/Umbraco-CMS into lars-erik-fix-u4-3839 2014-03-25 12:47:26 +11:00
Shannon f88e60bcb5 Fixes: U4-3481 Adding Scripting Files and Partial View Macro File with the same name and 'create macro' selected fails. 2014-03-25 12:16:27 +11:00
Shannon c81919e269 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-25 11:45:57 +11:00
Shannon c936aaa517 Fixes: U4-3845 v7.0.0 keepUserLoggedIn issue 2014-03-25 11:45:38 +11:00
Shandem b8f88e0459 Merge pull request #330 from Jeavon/7.1.0-ImageCropper-JeavonWIP
7.1.0 image cropper - removal of lots of duplicated code, fixes for various param options and some further unit tests
2014-03-25 10:47:09 +11:00
Shannon 1628ac917c Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-25 10:45:14 +11:00
Shannon ab586a49ce Fixes: U4-4508 Save causes content to vanish in IE 2014-03-25 10:44:55 +11:00
Jeavon Leopold ff2ee540e2 Fixing the CacheBusting on GetCropUrl as it was totally random which meant the server cache was creating a new cache file for every request. Now changed it to use item updateDate.ToFileTimeUtc as the cache busting value so it will change only when the item is updated in Umbraco. 2014-03-24 19:27:00 +00:00
Jeavon Leopold b450299d45 GetCropUrl - moved propertyAlias and cropAlias to after width and height so that GetCropUrl(100,100,"myProperty") is possible and renamed useFocalPoint to preferFocalPoint 2014-03-24 18:37:15 +00:00
Jeavon Leopold 0ebe535922 ImageCropDataSet - a little bit of Stylecop 2014-03-24 17:58:12 +00:00
Jeavon Leopold f5f8fe7b42 GetCropUrl - Stylecop and an additional test 2014-03-24 17:51:52 +00:00
Jeavon Leopold f51a66b728 GetCropUrl - further code duplication removal and 2 new unit tests 2014-03-24 16:32:50 +00:00
Sebastiaan Janssen f8a7b453c7 Sync the en and en_us translations 2014-03-24 17:26:04 +01:00
Sebastiaan Janssen 89235f707c Sync the en and en_us translations 2014-03-24 17:25:31 +01:00
Jeavon Leopold 550166c41b Removing HasPropertyAndValueAndCrop method as it's no longer needed 2014-03-24 15:49:04 +00:00
Jeavon Leopold 40be3957f6 GetCropUrl - ensuring that GetCropUrl(width,height) works and also adding the useFocalPoint parameter 2014-03-24 15:44:04 +00:00
Sebastiaan Janssen 6ccce4d914 U4-4515 GenericProperty.ascx.cs references non-existent lblAlias control, causing YSOD of death when editing certain document types
Whoops, missed some references
2014-03-24 16:01:47 +01:00
Sebastiaan Janssen 14ea374b24 Also removing stray semicolons here for U4-4510 nuget targets file creates an invalid path in the property group 2014-03-24 15:44:09 +01:00
Sebastiaan Janssen 4d49268c47 U4-4515 GenericProperty.ascx.cs references non-existent lblAlias control, causing YSOD of death when editing certain document types
Codebehind file somehow got out of sync
2014-03-24 15:16:57 +01:00
Sebastiaan Janssen a569796adb Removes stray semicolons from the nuget targets files 2014-03-24 14:00:12 +01:00
Jeavon Leopold 59de0613f5 GetCropUrl - Removing duplicate code 2014-03-24 11:43:55 +00:00
Sebastiaan Janssen 8391c32886 Fix whitespace 2014-03-24 09:34:48 +01:00
Sebastiaan Janssen bf2efd30e9 U4-4073 Audit Trail is missing from action menu
Removed the icons for now as they are missing and should be new style icons anyway
2014-03-24 09:34:47 +01:00
Shannon 187373132f Completes: U4-4154 convert existing property data from XML to JSON during upgrade v6 - 7 2014-03-24 18:44:18 +11:00
Shannon 79584a9cf9 Fixes thread safety issue with RichTextPreValueController 2014-03-24 16:32:42 +11:00
Shannon 96fa8c7dc9 Publicizes a few things, including the fix for U4-3981 Make Umbraco.Web.WebApi.Filters.UmbracoApplicationAuthorizeAttribute public 2014-03-24 15:41:46 +11:00
Shannon 5e43ddc13c Fixes: U4-4502 Umbraco7.0.4 media picker shows uploaded images minus 1 2014-03-24 13:43:20 +11:00
Shannon 98f76a989f Adds better error handling for the media picker - we were not detecting image types before and were getting loads of server errors. Fixes up some method return calls 2014-03-24 12:38:49 +11:00
Shannon 2e8993adb8 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	build/NuSpecs/build/net40/UmbracoCms.targets
	build/NuSpecs/build/net45/UmbracoCms.targets
	build/NuSpecs/build/net451/UmbracoCms.targets
	build/NuSpecs/tools/Readme.txt
	build/NuSpecs/tools/install.ps1
	src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMember.aspx.cs
2014-03-24 11:31:52 +11:00
Shannon 81600f0f3c Merge branch 'patch-2' of https://github.com/designagencytom/Umbraco-CMS into designagencytom-patch-2
Conflicts:
	src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMember.aspx.cs
2014-03-24 11:18:11 +11:00
Shannon 74ccd79408 Merge branch 'patch-1' of https://github.com/designagencytom/Umbraco-CMS into designagencytom-patch-1 2014-03-24 11:13:07 +11:00
Shandem 3e0a754dc0 Merge pull request #328 from arjanpot/7.1.0
CropUrl should be formatted with InvariantCulture.
2014-03-24 11:04:59 +11:00
Sebastiaan Janssen 006a89e136 U4-4498 Doc & Media Type, Server Error when upgrade, 7.0.4 to 7.1.0 RC via Nuget
Have to copy in the Umbraco and Umbraco_Client folder during NuGet updates as well.
2014-03-23 16:10:58 +01:00
Sebastiaan Janssen 29dbbee173 Imageprocessor config files are no longer required and shouldn't ship with Umbraco 2014-03-23 15:02:54 +01:00
arjanpot cd31637371 CropUrl should be formatted with InvariantCulture. 2014-03-22 11:22:01 +01:00
perploug ab70c98d4c Ensures the config is cleared properly every time 2014-03-20 09:41:30 -07:00
Sebastiaan Janssen 424ff02734 Forgot a few includes, fixed! 2014-03-20 17:29:16 +01:00
Sebastiaan Janssen 80bd8d962b Make sure the App_Plugins folder is there 2014-03-20 16:58:35 +01:00
Sebastiaan Janssen 4b4efde490 Make sure the App_Plugins folder is there 2014-03-20 16:57:53 +01:00
Sebastiaan Janssen 956364decd v7 NuGet changes also apply to v6 2014-03-20 16:02:24 +01:00
Sebastiaan Janssen 7bc2bdae75 Merge pull request #327 from Jeavon/7.1.0-ImageCropper-JeavonWIP
7.1.0 image cropper - GetCropUrl not using .Url anymore
2014-03-20 15:45:24 +01:00
Sebastiaan Janssen c43ab7942a Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-20 15:38:52 +01:00
Morten Christensen 166f9b939c Moving the sqlce dlls to UmbracoFile in the nuspec 2014-03-20 15:37:41 +01:00
Morten Christensen ede9e00a7f Updating the targets to include a few more folders 2014-03-20 15:37:21 +01:00
Sebastiaan Janssen 0bfbacfd66 No need to back up the config files, they don't get overwritten if you answer "No"
Updated the readme.
2014-03-20 15:33:41 +01:00
Jeavon Leopold 5c5827e319 If cropper property editor not in use on umbracoFile then we can use mediaItem.Url 2014-03-20 14:31:21 +00:00
Sebastiaan Janssen 05ca98219d Also copy the new config files over 2014-03-20 14:57:07 +01:00
Sebastiaan Janssen a83a0f1e25 Fix merge conflict 2014-03-20 14:27:39 +01:00
Sebastiaan Janssen ea7d476559 Backup config files properly 2014-03-20 14:26:11 +01:00
Jeavon Leopold 2d2f57a71b GetCropUrl - needed to get the url from within the json within the check for a crop otherwise a exception can occur 2014-03-20 13:22:45 +00:00
designagencytom 6133e8f8c2 Update loadMemberGroups.cs
Sort the roles alphabetically to make it easier to manage the list when it becomes very large.
2014-03-20 13:02:25 +00:00
Morten Christensen bfaace373c Updating the install ps1 to only copy over the web.config on initial install to ensure that the web.config is correct. 2014-03-20 14:00:43 +01:00
Morten Christensen a6d24fce93 Updating the targets files to copy in umbraco backoffice client dependencies AfterBuild with condition !Exists. 2014-03-20 14:00:42 +01:00
Jeavon Leopold 7e8aaebfce Merge remote-tracking branch 'origin/HEAD' into 7.1.0-ImageCropper-JeavonWIP 2014-03-20 12:42:14 +00:00
Jeavon Leopold 6a3fb87499 GetCropUrl to not use .Url property but get directly from cropper JSON 2014-03-20 12:42:05 +00:00
Sebastiaan Janssen 74cad56a6b Merge pull request #324 from Jeavon/7.1.0-ImageCropper-JeavonWIP
7.1.0 image cropper - fix and basic unit test and new overload GetCropUrl(cropAlias)
2014-03-20 13:30:09 +01:00
Jeavon Leopold 9b02457f7a Adding a basic unit test for GetCropUrl - more to come 2014-03-20 12:22:50 +00:00
Jeavon Leopold 6077e24685 Add GetCropUrl(string cropAlias) overload and fix mediaItem.Url 2014-03-20 11:23:17 +00:00
Sebastiaan Janssen 39a3a9dc56 Reference the correct ImageProcessor version to get it included in the build 2014-03-20 09:42:06 +01:00
Shannon 801a3731a2 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-20 17:55:03 +11:00
Shannon bcb7561e74 fixes unit test 2014-03-20 17:44:13 +11:00
Shannon f077520781 Fixes: U4-4154 convert existing property data from XML to JSON during upgrade v6 - 7 to ensure that other data types that have this property editor are upgraded as well. Fixes some of the installer bits so that the steps are not marked as completed if they have problems. 2014-03-20 17:35:51 +11:00
Shannon 61ec1e4c35 Fixes the Url property to work with the image cropper to be consistent with the upload field. 2014-03-20 14:58:18 +11:00
Shannon 3710c0916c Fixes up the Image cropper extensions, ensures that we don't recursively call Url (this is a special property). 2014-03-20 14:57:48 +11:00
Shannon 863667f5bd Moves the image crop enums to their correct location and renames them to be more descriptive (less generic). 2014-03-20 14:27:58 +11:00
Shannon 7475851bb5 Ensures that we log exceptions instead of completely ignoring them 2014-03-20 14:17:00 +11:00
Shannon a721ed5e0f Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Web/Cache/UserPermissionsCacheRefresher.cs
2014-03-20 13:19:50 +11:00
Shannon 0bc621c40f Merge branch 'Jeavon-7.1.0-ImageCropper-JeavonWIP' into 7.1.0 2014-03-20 13:19:26 +11:00
Shannon 620fbde1db Merge branch '7.1.0-ImageCropper-JeavonWIP' of https://github.com/Jeavon/Umbraco-CMS into Jeavon-7.1.0-ImageCropper-JeavonWIP
Conflicts:
	src/Umbraco.Web/ImageCropperBaseExtensions.cs
2014-03-20 13:18:57 +11:00
Shannon 39e7947435 fixes merge issues 2014-03-20 13:15:53 +11:00
Shannon 2792937b17 Merge branch '7.1_U4-4447' of https://github.com/arknu/Umbraco-CMS into arknu-7.1_U4-4447
Conflicts:
	src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs
	src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs
2014-03-20 13:10:39 +11:00
Shannon af9a9a9a7a Fixes: U4-4481 Image cropper pre value editor doesn't validate properly 2014-03-20 13:03:30 +11:00
Shannon 83f4c0262e Fixes: U4-4475 Creating new member doesn't put it in examine. Fixes up some cache refreshers to ensure they are calling the base method so that events fire consistently.
Conflicts:
	src/Umbraco.Web/Cache/UserPermissionsCacheRefresher.cs
2014-03-20 12:38:19 +11:00
Shannon 08d4ce7667 Fixes: U4-4475 Creating new member doesn't put it in examine. Fixes up some cache refreshers to ensure they are calling the base method so that events fire consistently. 2014-03-20 12:36:13 +11:00
Shannon 2340adbe94 Fixes: U4-4425 Umbraco Macros break on quote, U4-4290 RTE changes Macro parameter values containing right angle brackets, U4-4442 Line break in macro text area breaks the Macro 2014-03-20 12:21:40 +11:00
Shannon fb6b234491 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-20 10:38:40 +11:00
Shannon 15222e176e Fixes: U4-4474 YSOD when expanding Members tree 2014-03-20 10:37:54 +11:00
Shannon 63b92eaee5 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Models/MemberType.cs
	src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs
	src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs
2014-03-20 09:54:13 +11:00
Shannon 84dd7dc61a Fixes: U4-4466 6.2-beta - Creating Member Type without Alias results in no viewable Member Types in back office 2014-03-20 09:52:31 +11:00
Sebastiaan Janssen 5a4b09f9d1 Make sure we use the latest ImageProcessor version in VS as well, not just in the nuget package. 2014-03-19 19:56:48 +01:00
perploug bbbd03f001 Final tweak to the U4-4477 - media items could not be retreived on refreshing the editor 2014-03-19 19:14:39 +01:00
perploug 4a721ddf34 Fixes: U4-4477 Single Media picker doesn't show thumbnail any more 2014-03-19 18:44:46 +01:00
Jeavon Leopold d88745bf49 Adding ToLowerInvariant to compares and also removing a redundant method copied in from my cropper package but not needed 2014-03-19 16:53:13 +00:00
perploug 3543204794 Revert "Merge"
This reverts commit 1573eb2f74.
2014-03-19 09:51:07 -07:00
arknu c565744a9b Fix drag-and-drop upload 2014-03-19 17:46:04 +01:00
perploug 2470ec3ded Minor addition to the U4-4477 fix 2014-03-19 09:38:27 -07:00
perploug 7b4f7abbcd Fixes: U4-4477 Media picker doesn't show thumbnail any more 2014-03-19 09:38:24 -07:00
perploug 1573eb2f74 Merge 2014-03-19 09:38:22 -07:00
Jeavon Leopold e8e8b536f1 Fix for GetCropUrl method when mediaItem.Url has JSON data 2014-03-19 16:12:30 +00:00
Sebastiaan Janssen 704c3df597 No more need for imageprocessor configs in web.config, yay! 2014-03-19 16:59:06 +01:00
Sebastiaan Janssen 36c107c0ef Quick fix for U4-4206 - not the absolute correct fix, but it'll get rid of that horrible null reference error 2014-03-19 14:30:53 +01:00
Sebastiaan Janssen 70f5641b83 Change to overflow:auto so there's no horizontal scroll bar when not necessary 2014-03-19 13:28:28 +01:00
Sebastiaan Janssen bbb5fe728a Better styling of ChangeDocType dialog 2014-03-19 13:25:16 +01:00
Sebastiaan Janssen 307ea6bd74 Fixes last error in U4-3470 Errors in console window are failed to load resource at
/umbraco/%7B%7Bcmd.icon%7D%7D
2014-03-19 11:48:46 +01:00
Sebastiaan Janssen 76eb06784d Don't try to access model.value when model.value might be empty. Fixes broken prevalue editor for RTE. 2014-03-19 11:19:34 +01:00
Jeavon Leopold c6e1235ac4 Fixing GetCropUrl overload 2014-03-19 09:52:53 +00:00
Sebastiaan Janssen 6ac2cc9f8b Not sure how the logout button ended up in the help dialog, sorry! :) 2014-03-19 10:38:43 +01:00
Shannon 9d5c8e5aed Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-19 19:45:39 +11:00
Shannon 56001a8ccb Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Services/PackagingService.cs
2014-03-19 18:55:20 +11:00
Shannon ff5dadde53 Fixes unit test and another potential migration problem using an old alias for foreign key 2014-03-19 18:43:10 +11:00
Shannon 6d92393f08 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-19 17:56:45 +11:00
Shannon 6169d13eb5 fixes the config issue with unit tests 2014-03-19 17:56:30 +11:00
perploug 361c382a2e Makes cropper components size-able
So all UI components can be given a max-size so they can scale image and
ui up accordingly
2014-03-18 23:49:09 -07:00
perploug 375b3948e0 Fixes: U4-4177 U7 - Add Startnode Picker to Multiple Media Picker 2014-03-18 23:49:05 -07:00
perploug 6453a82717 Allow cropper thumbnails to downscale 2014-03-18 23:49:02 -07:00
perploug a4c9fae05c Fixes: U4-4461: Case sensitive crop alias's 2014-03-18 23:49:01 -07:00
perploug 29edbb90a6 Fixes: Image grid using fullsize images instead of thumbs 2014-03-18 23:49:00 -07:00
Shannon 71201970e9 Gets the new color spectrum pre-value editor working. 2014-03-19 17:45:21 +11:00
Shannon 992727821b Merge branch 'robertjf-7.0.2' into 7.1.0 2014-03-19 15:43:46 +11:00
Shannon 67fd3cc234 Merge branch 'moppa-7.0.2' into 7.1.0 2014-03-19 15:41:06 +11:00
Shannon f70717985c Cleans up a little bit of code and adds some null checks. 2014-03-19 15:32:31 +11:00
Shannon ded82611a7 Finalizes: U4-4472 Image cropper should use IFileSystem - currently uses standard IO 2014-03-19 15:09:50 +11:00
Shandem 6a8cb5e123 Merge pull request #270 from stefana99/6.2.0-imagecropper
Changes to imageCropper, supports new mediafilesystem
2014-03-19 14:48:38 +11:00
Shandem 09428d703c Merge pull request #298 from KevinJump/6.2.0--PackageServiceFixes
6.2.0  package service fixes
2014-03-19 14:43:19 +11:00
Shannon 2b6b8e9e8c Fixes: U4-4470 New Installer doesn't deal with 500 errors, also fixes a tree init problem causing this particular ysod 2014-03-19 13:28:23 +11:00
Shannon a46c088d0c Ensures correct exceptions are thrown when configurations cannot be loaded, before was just null ref exception which was not good. 2014-03-19 11:00:32 +11:00
Shannon 65e591501c Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Tests/Migrations/Stubs/AlterUserTableMigrationStub.cs
2014-03-19 10:35:46 +11:00
Shannon a0541b000e Fixes: U4-4463 Upgrade 6.2.0 > 7.1.0 fails - due to incorrect formatting of foreign keys for sql servers
Conflicts:
	src/Umbraco.Tests/Migrations/AlterMigrationTests.cs
	src/Umbraco.Tests/Migrations/Stubs/AlterUserTableMigrationStub.cs
2014-03-19 10:33:37 +11:00
Shannon 1f6b139cde Fixes: U4-4463 Upgrade 6.2.0 > 7.1.0 fails - due to incorrect formatting of foreign keys for sql servers 2014-03-19 10:31:19 +11:00
Shannon 17893715fc Fixes the CDF nuget reference since we need the latest version and it is marked as visible now (this just undoes our old workaround) 2014-03-19 09:38:41 +11:00
Shannon a25e6e0d2c Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	build/Build.bat
	build/NuSpecs/UmbracoCms.Core.nuspec
	build/NuSpecs/build/net40/UmbracoCms.targets
	build/NuSpecs/build/net45/UmbracoCms.targets
	build/NuSpecs/build/net451/UmbracoCms.targets
	src/Umbraco.Core/Persistence/Querying/BaseExpressionHelper.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
2014-03-19 09:34:37 +11:00
Shannon 668935548d Fixes: U4-4394 7.0.4: Inconsistency in member tree listings
Conflicts:
	src/Umbraco.Core/Persistence/Querying/BaseExpressionHelper.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
	src/Umbraco.Web/Trees/MemberTreeController.cs
2014-03-19 09:28:13 +11:00
Shannon 14141fcaa5 Fixes the dictionary query syntax properly for all db's 2014-03-19 09:24:57 +11:00
arknu 1948fe12b3 U4-4447: Make image properties populate when uploading from ImageCropper 2014-03-18 22:31:05 +01:00
Sebastiaan Janssen 4bcf3983c5 Update readme and remove non-functioning backups from install.ps1 2014-03-18 18:41:05 +01:00
Sebastiaan Janssen 7c5942b05f Updating minimum required versions of dependencies to be the same as v7. 2014-03-18 18:40:20 +01:00
Sebastiaan Janssen 8b4d4e3189 Update readme and remove non-functioning backups from install.ps1 2014-03-18 18:38:16 +01:00
Sebastiaan Janssen 4f008f5848 Bump version to RC 2014-03-18 18:37:42 +01:00
Sebastiaan Janssen 1a40ccc838 Updating nuget targets files, like on v7. Also updates nuget author name. 2014-03-18 17:51:33 +01:00
Sebastiaan Janssen 0bf43da825 Time to finally update the author name as well 2014-03-18 17:49:53 +01:00
Sebastiaan Janssen c83db52bd7 Update database type wording and dropdown width 2014-03-18 17:45:26 +01:00
Sebastiaan Janssen 00e1556504 Update to the correct minimum requirements for ImageProcessor 2014-03-18 17:26:09 +01:00
Jeavon Leopold 5c8440a7d6 ImageCropper helpers WIP 2014-03-18 15:20:48 +00:00
Sebastiaan Janssen 3e86fb6298 ImageProcessor.Web only has a v3 for some reason 2014-03-18 15:54:10 +01:00
Sebastiaan Janssen 9b0895c5b0 People tend to forget to deploy global.asax A LOT, doesn't hurt to have it as content and
included in the VS project, this should help a bit as it's no longer a hidden file
2014-03-18 15:48:41 +01:00
Sebastiaan Janssen 4ad9ea1537 Bump the version to RC 2014-03-18 15:40:09 +01:00
Sebastiaan Janssen 0b08f19f53 U4-4174 Umbraco Nuget Install by Visual Studio 2013 failed
Should be fixed by referencing this version of WebApi. ImageProcessor is also required
2014-03-18 15:39:54 +01:00
Sebastiaan Janssen 527402a6d8 The Overflow starter kit adds App_Code and needs this reference to be able
to use HttpResponseMessage
2014-03-18 15:35:07 +01:00
Sebastiaan Janssen 9eea8c85e0 Include global.asax and Config\splashes folder while publishing with msdeploy 2014-03-18 15:32:39 +01:00
Stephan e80963093d Fix MySql dictionary issue
Conflicts:
	src/umbraco.cms/businesslogic/language/Item.cs
2014-03-18 12:44:32 +01:00
Shannon 6f586c7eeb Ensures we are not directly referencing Membership.Provider and instead targetting our provider by alias. 2014-03-18 20:36:02 +11:00
Shannon ff3b5baf06 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
2014-03-18 20:12:03 +11:00
Shannon 0749124f45 fixes bug with col name 2014-03-18 20:11:22 +11:00
Shannon 549aeecf31 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Models/Member.cs
2014-03-18 19:40:41 +11:00
Shannon bef970437a doh, fix for new ctor 2014-03-18 19:39:17 +11:00
Shannon 0898b13072 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Models/Member.cs
2014-03-18 19:31:26 +11:00
Shannon dda36f0147 added additional ctor for member to create an empty one 2014-03-18 19:30:54 +11:00
Shannon 9d3f362029 fixes minor issue with the backing up of the install folder 2014-03-18 19:27:58 +11:00
Shannon 4d13925e3b Fixes merge issues 2014-03-18 19:05:07 +11:00
Shannon 02481dcfba Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Configuration/UmbracoSettings.cs
2014-03-18 18:53:04 +11:00
Shannon caad775399 Removes the User membership provider name constant - it is not a constant, this value is configurable! 2014-03-18 18:52:17 +11:00
Shannon fd14065f14 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Models/Member.cs
	src/Umbraco.Core/Models/Membership/MembershipUserExtensions.cs
	src/Umbraco.Core/Persistence/Factories/MemberFactory.cs
	src/Umbraco.Core/Persistence/Factories/MemberReadOnlyFactory.cs
	src/Umbraco.Core/Persistence/Mappers/MemberMapper.cs
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
	src/Umbraco.Core/Services/IMembershipUserService.cs
	src/Umbraco.Core/Services/UserService.cs
	src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs
	src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs
	src/Umbraco.Tests/Services/ContentServiceTests.cs
	src/Umbraco.Tests/TestHelpers/Entities/MockedMember.cs
	src/Umbraco.Tests/TestHelpers/Entities/MockedUser.cs
	src/Umbraco.Web.UI/install/steps/DefaultUser.ascx.cs
	src/Umbraco.Web/Controllers/UmbProfileController.cs
	src/Umbraco.Web/Routing/PublishedContentRequestEngine.cs
	src/Umbraco.Web/Security/WebSecurity.cs
	src/Umbraco.Web/umbraco.presentation/LegacyClasses.cs
	src/Umbraco.Web/umbraco.presentation/install/steps/LegacyClasses.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/create/member.ascx.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/create/memberTasks.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/ChangePassword.ascx.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMember.aspx.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs
2014-03-18 18:47:49 +11:00
Shannon 7a7720c460 Gets #U4-4454 Can't log in a new member created through memberservice completed 2014-03-18 18:41:18 +11:00
Shannon b2aeb835d5 Implements the SavePassword method of the MemberService 2014-03-18 17:45:11 +11:00
Shannon 8dd950bd52 Ensures all access to the users membership provider is done with our extension method 2014-03-18 17:22:25 +11:00
Shannon e2881e07d1 Ensures that all calls to the members membership provider are done so explicitly with the membership provider alias - this decouples the need to have the umbraco membership provider declared as the default, we were doing both before. 2014-03-18 17:08:21 +11:00
Shannon e0e0076a7a allows for client side validation on the text box and date picker controls and updates the models to allow support for this for any prop editor. 2014-03-18 15:29:14 +11:00
Shannon 00a96a4888 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-18 14:51:43 +11:00
Shandem b16cf375b9 Merge pull request #320 from imulus/u4-4432
U4-4432 - Expose Mandatory setting in ContentProperty
2014-03-18 14:48:53 +11:00
Shannon a3b433c73c Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-18 14:39:58 +11:00
Shandem 855a4961dd Merge pull request #321 from robbaman/7.1.0
Added datepicker support for IsRequired
2014-03-18 14:37:56 +11:00
Shannon 71de4dc7de Fixes: U4-3675 [NonAction] attribute should be ignored by Umbraco RenderActionInvoker 2014-03-18 14:28:05 +11:00
Shannon 19d3c06470 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Tests/TestHelpers/BaseUmbracoApplicationTest.cs
2014-03-18 14:20:45 +11:00
Shannon e22476f54a fixes some test logic 2014-03-18 14:19:26 +11:00
Shannon 20ae16b2d7 Merge branch '6.2.0' of https://github.com/umbraco/Umbraco-CMS into 6.2.0 2014-03-18 14:18:50 +11:00
Shannon 9e466971af fixes some test logic 2014-03-18 14:18:34 +11:00
Shannon 7017d8094d Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-18 13:08:39 +11:00
Shannon 0e40971178 Fixes remaining tests 2014-03-18 13:08:24 +11:00
perploug 1ae9816c28 Updates grunt file to work with latest jshint cfg format 2014-03-18 02:24:38 +01:00
Shannon e40cf3b8fc fixes js unit tests 2014-03-18 12:23:10 +11:00
Shannon 09ea82b37f fixes last unit tests 2014-03-18 11:57:53 +11:00
Shannon c44918f830 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-18 11:40:32 +11:00
Shannon 760dd42c43 Optimizes integration test performance and fixes failing unit tests. 2014-03-18 11:40:20 +11:00
perploug 0409192892 Fixes: U4-4449 Issue: Discard Changes popup inconsistency 2014-03-18 01:09:50 +01:00
Shannon d575eaa9c1 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/TypeFinder.cs
	src/Umbraco.Tests/Services/PackagingServiceTests.cs
	src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs
	src/Umbraco.Web/umbraco.presentation/CompatibilityHelper.cs
2014-03-18 09:46:43 +11:00
Shannon 373e9755ed Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-18 09:22:08 +11:00
perploug d6f00d9367 Fixes: U4-4405 List view icons are broken in firefox 2014-03-17 20:53:19 +01:00
perploug 3cabec84d4 Fixes broken IE11 slider in ImageCropper 2014-03-17 20:01:39 +01:00
perploug c9d12f7dc5 WIP on seperating logic from the content editor into smaller units 2014-03-17 19:40:52 +01:00
perploug 9e97b84fb8 Fixes issues with crop sizes prevalues 2014-03-17 19:40:52 +01:00
perploug f4fa090857 Removes dog with glasses + fixes unit tests 2014-03-17 19:40:51 +01:00
perploug 0e22a2bb5a Fixes installer progress bar 2014-03-17 19:40:50 +01:00
Stephan 36b10e71d7 U4-4373, U4-4374 - finalize fixes
Conflicts:
	src/Umbraco.Web/umbraco.presentation/CompatibilityHelper.cs
2014-03-17 15:44:16 +01:00
Stephan 3c6029c969 Merge remote-tracking branch 'origin/6.2.0' into 6.2.0 2014-03-17 15:27:25 +01:00
Stephan a4a0de3503 U4-4373, U4-4374 - finalize fixes 2014-03-17 15:25:25 +01:00
Shannon 217267bf94 Supercharges integration tests - now running at a great speed. 2014-03-17 22:22:44 +11:00
Shannon 4748366766 Fixes up some more test attributes 2014-03-17 20:59:31 +11:00
Shannon de15dc36e7 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs
2014-03-17 20:54:48 +11:00
Shannon ab00782d84 Fixes potential issue with why test were failing 2014-03-17 20:33:30 +11:00
Shannon 2d6d95a63e Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Tests/Persistence/Auditing/AuditTests.cs
	src/Umbraco.Tests/Persistence/PetaPocoExtensionsTest.cs
	src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs
	src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs
	src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs
	src/Umbraco.Tests/Persistence/Repositories/UserTypeRepositoryTest.cs
	src/Umbraco.Tests/PublishedContent/DynamicDocumentTestsBase.cs
	src/Umbraco.Tests/PublishedContent/PublishedContentExtensionTests.cs
	src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs
	src/Umbraco.Tests/Services/LocalizationServiceTests.cs
	src/Umbraco.Tests/Services/PackagingServiceTests.cs
	src/Umbraco.Tests/Services/PerformanceTests.cs
	src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs
	src/Umbraco.Tests/Umbraco.Tests.csproj
2014-03-17 19:44:34 +11:00
Shannon d19d1b3a18 Changes database behavior in integration tests to be opt-in, removes the db behavior to have a new schema per fixture, now we only deal in new files + schema per fixture/tests as it was taking longer to uninstall the db tables than just delete the file. 2014-03-17 19:38:29 +11:00
Shannon 5a779c24d0 Fixes: U4-4428 Upload field on members fails on resizing 2014-03-17 18:39:53 +11:00
Shannon c669a2702b Fixes: U4-4210 MNTP not working with Member and ensures the content picker has real validation built into it. Fixes up the EntityController switching out the global action selector. 2014-03-17 18:34:41 +11:00
Shannon f777f1b3d6 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/umbraco.providers/members/UmbracoMembershipProvider.cs
2014-03-17 16:23:49 +11:00
Shannon 3e8ada24e4 reverts sebastian's commit as this will cause unwanted other side affects 2014-03-17 16:08:06 +11:00
Shannon fe884b2070 Fixes: U4-4426 Upload field on Member Type doesn't work 2014-03-17 16:01:09 +11:00
Shannon 30cfa4c0ae moves MemberCountType to correct namespace 2014-03-17 14:18:38 +11:00
Shannon 66aa3084f9 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Web.UI/packages.config
	src/Umbraco.Web/packages.config
	src/umbraco.cms/packages.config
	src/umbraco.cms/umbraco.cms.csproj
	src/umbraco.controls/packages.config
	src/umbraco.editorControls/packages.config
	src/umbraco.macroRenderings/packages.config
	src/umbraco.macroRenderings/umbraco.macroRenderings.csproj
2014-03-17 14:15:14 +11:00
Shannon d028ee2c3e Completes: U4-4457 Upgrade to latest CDF 2014-03-17 14:08:07 +11:00
Shannon 2bd5e908db Fixes merge issues 2014-03-17 14:01:42 +11:00
Shannon 154652c896 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs
	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AddChangeDocumentTypePermission.cs
	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs
	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AssignMissingPrimaryForMySqlKeys.cs
	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/UpdateToNewMemberPropertyAliases.cs
	src/Umbraco.Core/Umbraco.Core.csproj
	src/Umbraco.Tests/Umbraco.Tests.csproj
	src/umbraco.controls/TreePicker/SimpleContentPicker.cs
2014-03-17 13:39:49 +11:00
Shannon a60e2318ad Fix Null Prevalue Values on Export of DataTypes
Exporting a DataType that has a Numeric pre-value that has no value
causes an Exception - added null checking to pre value.value
2014-03-17 13:23:26 +11:00
Shannon f642a7fd63 Fixes: U4-4368 Cannot insert the value NULL into column 'name' when creating new relation type from API 2014-03-17 13:21:17 +11:00
Shandem b4cce4860f Merge pull request #313 from KevinJump/7.1.0---Null-DataType-PropertyValue-Fix
Fix Null Prevalue Values on Export of DataTypes
2014-03-17 13:20:24 +11:00
Shannon d1d54d8e84 Fixes: U4-4427 Exception with selecting content start node in Multi-node tree picker 6.2.0 2014-03-17 13:12:08 +11:00
Shannon bbeedb6c1b Fixes: U4-4373 @Library.NodeById(-1).Id returns "0" instead of "-1"(6.2.0 beta) & U4-4374 @Model.NodeById(-1).DescendantsOrSelf().First().Id results in Excecption (6.2.0 beta) 2014-03-17 12:27:37 +11:00
Shannon 4745995f92 Fixes: U4-4373 @Library.NodeById(-1).Id returns "0" instead of "-1"(6.2.0 beta) 2014-03-17 11:45:42 +11:00
Shannon c66aca2d41 Adds migration to rename the index umbracoUserLogins_Index to IX_umbracoUserLogins_Index so that it follows standards, fixes unit test 2014-03-17 11:24:01 +11:00
Shannon af148a4544 reverts the notion of shema migration - we will run migrations normally as we've been doing, this fixes a couple of unit tests too. 2014-03-17 10:48:56 +11:00
Shannon d7ea8e02d6 fixes unit test 2014-03-17 09:40:28 +11:00
Shannon 3acec1dd65 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-17 09:38:46 +11:00
Sebastiaan Janssen e52f8dcbc9 Update wording on upgrades 2014-03-16 19:37:08 +01:00
Sebastiaan Janssen 60edf7d3b9 Pointing to the typical error log folder 2014-03-16 12:00:36 +01:00
Sebastiaan Janssen f626738174 DoResize(-1,-1) - I don't know why you'd ever want to attempt to resize to -1,-1.
Also removed the else clause as it hides the error until later, now size will be null at the appropriate time.
2014-03-16 11:46:49 +01:00
Shannon ad3c004d95 Added another property to a migration to specify a minimum current version - needed for specifically targeting a migration 'from' a version. Finally got mysql upgrading from 6.1 to 7.1 without issue, had to re-order a few things and ensure some migrations don't execute based on the 'from' version. 2014-03-15 20:15:01 +11:00
Shannon 58814d4ac2 updates the migration order 2014-03-15 20:11:42 +11:00
Shannon c29dbf444a Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs
	src/Umbraco.Core/Services/PackagingService.cs
	src/Umbraco.Core/Umbraco.Core.csproj
2014-03-15 19:02:59 +11:00
Shannon bd06729619 oops, fixes some logic with a closing bracket in the wrong place 2014-03-15 18:54:08 +11:00
Shannon bd1dc4f88d Merge branch '6.2.0' of https://github.com/umbraco/Umbraco-CMS into 6.2.0 2014-03-15 18:53:25 +11:00
Shannon 67c1cc44c5 oops, fixes some logic with a closing bracket in the wrong place 2014-03-15 18:53:03 +11:00
Morten Christensen b680f87c12 Adding a note about the usage of the PackageInstallation class in the PackagingService 2014-03-14 12:14:43 +01:00
Morten Christensen 8db6633c91 Initial implementation of a new package installation approach based on PR-297. Everything is left internal as we don't know when something like this can be introduced.
Idea is to be able to install a complete package using the PackagingService, so that we eventually can obsolete the old Packager/Installer-code.
2014-03-14 12:11:38 +01:00
Robert Mulder 8843f6c02c Added datepicker support for IsRequired
Added support for the model.config.IsRequired flag to the datepicker property editor.
2014-03-14 10:15:48 +01:00
Shannon 6561a79b5c Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Tests/Migrations/AlterMigrationTests.cs
2014-03-14 19:35:11 +11:00
Shannon 3e5128147c fixes typo 2014-03-14 19:34:09 +11:00
Shannon 64c126ea61 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Configuration/GlobalSettings.cs
	src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs
	src/Umbraco.Tests/Umbraco.Tests.csproj
	src/Umbraco.Web/Security/Providers/UsersMembershipProvider.cs
	src/umbraco.providers/members/UmbracoMembershipProvider.cs
2014-03-14 19:33:53 +11:00
Shannon 3dcbcba9cf Updates the required migrations to be Schema migrations, ensures the foreign key deletion occurs with the correct supported syntax across db types. Ensures we don't try to drop a pk in mysql when it never existed. 2014-03-14 19:24:45 +11:00
Shannon b5329ace3b Backports fixes for legacy encoding checks and to not do any db lookups for the new membership providers and also ensures the legacy membership provider doesn't do any db lookups on init. 2014-03-14 18:38:57 +11:00
Shannon e1a134f587 Fixes: U4-4430 MySql primary key issues 2014-03-14 17:11:21 +11:00
Tom Fulton 1ec2901762 Expose Mandatory setting in ContentProperty
This allows a PropertyEditor to be aware of whether it's required or not, via: `$scope.model.mandatory` (along with `$scope.model.alias`, etc)
2014-03-13 23:32:12 -06:00
Robert Foster 58bfb6999d Merge remote-tracking branch 'upstream/7.0.2' into 7.0.2 2014-03-14 13:45:40 +11:00
Shannon e8056de589 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs
	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs
	src/Umbraco.Web.UI/install/Default.aspx.cs
2014-03-14 13:06:45 +11:00
Shannon bbe6194b06 Exception is thrown if trying to run mysql in med trust. Migrations arranged to execute schema migrations first and then data migrations. If a schema migration fails it will attempt to run the downgrade scripts of the migrations if running mysql since schema changes aren't supported in transactions. Updated all sql syntax providers to try to return only the column indexes, not key indexes. Updates the db version checker to include errors for all missing columns, indexes and constraints in the db and vice versa in the schema. 2014-03-14 13:04:20 +11:00
Shandem 06a08be6de Merge pull request #317 from BatJan/patch-1
Fix of U4-4414 UX: Replace Change placeholder text in new installer
2014-03-14 11:35:10 +11:00
Shandem f1e8e845a2 Merge pull request #319 from BatJan/7.1.0_-_U4-4378
Fix of U4-4378 Label needed under button graphics for videos
2014-03-14 11:33:57 +11:00
Jan Skovgaard 20c5be0a8e Fix of U4-4378 Label needed under button graphics for videos 2014-03-13 13:32:35 +01:00
Shannon 6990c46262 Fixes installer when it fails on the db install or upgrades, fixes some upgrade queries with mysql, fixes ignoring case check for checking version 2014-03-13 21:47:08 +11:00
Shannon 099c558797 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-13 20:46:06 +11:00
Shannon d76fd7d25e updates schema result to have case ignored. 2014-03-13 20:45:07 +11:00
Shannon e020989577 Give some love to mysql with regards to schema validation and the syntax provider - need ignore case comparisons. 2014-03-13 20:42:57 +11:00
Shannon f2541cae86 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Web.UI/web.Template.Debug.config
2014-03-13 20:16:08 +11:00
Shannon a907b5bdcd Fixes up the dbconnection checker to work with all supported db types. 2014-03-13 20:14:56 +11:00
Shannon 7258964bb7 Ensures version specific db providers are not referenced in the web.config 2014-03-13 20:14:11 +11:00
Shannon d290ffa306 Fixes: U4-4392 Umbraco 7 delete member from others 2014-03-13 18:47:36 +11:00
Shannon 75bc3e09c6 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-13 18:43:40 +11:00
Shannon bcc2424577 fixes issue with getting 'other' 'members 2014-03-13 18:43:16 +11:00
Shannon 67f8b8f88b Fixes: U4-3606 Handle caching issues from server requests correctly 2014-03-13 18:24:37 +11:00
BatJan 2d44650139 Fix of U4-4414 UX: Replace Change placeholder text in new installer
Changed "First Last" in the name placeholder to "Full name".
2014-03-13 07:27:08 +01:00
Shannon 8eaea3fb54 fixes: U4-4285 Expose/Publicize (3rd party) PropertyEditors 2014-03-13 16:34:54 +11:00
Shannon 2166a4a5ac Fixes: U4-4394 7.0.4: Inconsistency in member tree listings 2014-03-13 15:25:30 +11:00
Shannon 3ba6391dda Ensures that 6.2 migrations are run for 7.1 as well. 2014-03-13 14:23:32 +11:00
Shannon 8574c6b7d0 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml
	src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml
	src/Umbraco.Web/Models/ProfileModel.cs
	src/Umbraco.Web/Models/RegisterModel.cs
	src/Umbraco.Web/Models/UmbracoProperty.cs
2014-03-13 14:12:45 +11:00
Shannon b533a9f690 Merge commit '85a74e4fa700c83bab4bf3436f69f045029932cd' into 7.1.0
Conflicts:
	src/Umbraco.Core/Umbraco.Core.csproj
	src/Umbraco.Web/Controllers/UmbLoginController.cs
	src/Umbraco.Web/Controllers/UmbLoginStatusController.cs
	src/Umbraco.Web/Controllers/UmbProfileController.cs
	src/Umbraco.Web/Controllers/UmbRegisterController.cs
2014-03-13 14:12:02 +11:00
Shannon 221bfa5f3d Fixes up issues with editing the member profile and registering a member with our snippets including specifying a custom member type. 2014-03-13 14:10:05 +11:00
Shannon 85a74e4fa7 Fixes: U4-4419 TempData is not being cleared on RedirectToCurrentUmbracoPage - it actually shouldn't be cleared but we need to handle how we add it properly as tempdata only clears when it is read 2014-03-13 12:21:31 +11:00
Shannon 62d4bff8aa Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Web.UI/config/ClientDependency.config
2014-03-13 11:11:51 +11:00
Shannon 095be823c6 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-13 11:11:10 +11:00
Shannon a8858ecfdd fixes unit tests 2014-03-13 11:10:29 +11:00
Shandem 9c48330aae Merge pull request #314 from esn303/7.1.0
fix typos, thousands separator and casing of installer facts
2014-03-13 11:03:59 +11:00
Marc 22792a2f8e fix typos, thousands separator and casing of installer facts 2014-03-12 11:05:50 +01:00
Shannon 0dc00a62e2 Adds ability to have proxy migrations so there is no duplication of declaring migrations and no duplication of executing already executed migrations. Would have been a bit nicer to have 2014-03-12 20:36:40 +11:00
Shannon 0c4e442578 Checks for index existence before trying to add 2014-03-12 18:52:05 +11:00
Shannon 9d7d866467 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/CoreBootManager.cs
	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs
	src/Umbraco.Core/Umbraco.Core.csproj
2014-03-12 18:44:54 +11:00
Shannon 3b26834484 updates migration to make it a little faster 2014-03-12 18:40:39 +11:00
Shannon aee10348e5 Ensures not to add new indexes if they already exist 2014-03-12 18:37:22 +11:00
Shannon d0fc3ddba5 ensures applicationeventsresolver is disposed of in the correct place. 2014-03-12 18:11:05 +11:00
Shannon 3aadca167f oops, updated the reset to resetcollections for clearing collections for resolvers. 2014-03-12 18:00:00 +11:00
Shannon 3a92c26a7f Adds ability to extract index details from databases using sql syntax provider. 2014-03-12 17:17:52 +11:00
Shannon 6a4ea56dc5 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/CoreBootManager.cs
	src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs
2014-03-12 17:17:05 +11:00
Shannon cdd6768966 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-12 15:09:48 +11:00
Shannon d89205abaf Fixes: U4-4395 YSOD when creating membergroup 2014-03-12 15:08:55 +11:00
Shannon ff21379547 Makes ApplicationEventsResolver IDisposable so we can clear resources after startup. 2014-03-12 14:16:52 +11:00
Sebastiaan Janssen 74f00a9f89 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-12 00:33:03 +01:00
Sebastiaan Janssen 3912300f83 Really... nobody noticed "MEH"? 2014-03-12 00:30:25 +01:00
Shannon c8ff708a43 adds null check to MemberGroupCacheRefresher 2014-03-12 10:04:33 +11:00
Sebastiaan Janssen 693899935b For absolute clarity added the fact that this is the current Umbraco version. 2014-03-11 19:09:17 +01:00
Sebastiaan Janssen 1a87d96f77 Temporary fix to at least have a scrollbar when protecting a page (only added inline style, and
removed an unopened </div>, the rest is just formatting)
2014-03-11 18:47:50 +01:00
Sebastiaan Janssen 0a959b5b84 Thought I'd moved the version up a already but looks like I forgot to commit. Also made it
have a bit more contrast with it's background.
2014-03-11 17:39:11 +01:00
Sebastiaan Janssen f2202eb337 Removing 503 header as Azure Websites would just stop doing anything after seeing this, so
the rewrite to noNodes.aspx would never happen and you'd get a blank screen with:
Service Unavailable HTTP Error 503. The service is unavailable.
2014-03-11 17:28:55 +01:00
Shannon 19b7a9dfff Completes: U4-4369 Remove the need for an Areas folder for the installer 2014-03-11 18:09:54 +11:00
Shannon f432e23a47 Removes files that should never have been committed 2014-03-11 18:07:07 +11:00
Kevin Jump 20d92432b2 Fix Null Prevalue Values on Export of DataTypes
Exporting a DataType that has a Numeric pre-value that has no value
causes an Exception - added null checking to pre value.value
2014-03-11 06:55:59 +00:00
Shannon 59cdb8a6fe Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-11 17:27:30 +11:00
Shannon aed4c1faed minor code cleanup and a null check. 2014-03-11 17:26:14 +11:00
Shannon 2ecab70772 Fixes: U4-4182 Exception during plugins loading 2014-03-11 17:00:35 +11:00
Shannon 894a649574 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-11 15:02:48 +11:00
Shannon 48bbf1ecb2 Fixes unit tests 2014-03-11 15:02:23 +11:00
Shannon 5dc44ca612 fixes some merge issues 2014-03-11 15:02:14 +11:00
Shannon 3c771648e3 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Core/Models/Member.cs
	src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
	src/Umbraco.Core/Persistence/Factories/MemberReadOnlyFactory.cs
	src/Umbraco.Tests/Umbraco.Tests.csproj
	src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml
	src/Umbraco.Web/Models/ProfileModel.cs
	src/Umbraco.Web/Models/UmbracoProperty.cs
	src/Umbraco.Web/Security/MembershipHelper.cs
	src/Umbraco.Web/UmbracoHelper.cs
2014-03-11 14:47:00 +11:00
Shannon c500d29029 adds some exceptions 2014-03-11 14:44:18 +11:00
Shannon 2c8fe5a130 fixes a few issues 2014-03-11 14:35:49 +11:00
Shannon d737afa327 Working on 2014-03-11 14:23:51 +11:00
Shannon 2db1c1bb40 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-11 10:39:55 +11:00
Shannon d95ca7bc6f updates naming from CreateProfileModel to GetCurrentMemberProfile 2014-03-11 10:39:19 +11:00
Sebastiaan Janssen 6b491ac6cd Merge pull request #312 from vnbaaij/patch-1
Update en_us.xml
2014-03-10 10:13:58 +01:00
vnbaaij 278b681501 Update en_us.xml
header was incorrect:
<language alias="en" intName="English (GB)" localName="English (GB)" lcid="" culture="en-GB">
2014-03-10 10:07:30 +01:00
Shannon abd72e7676 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0 2014-03-10 18:09:20 +11:00
Shannon ec6cb4520c Fixes: U4-3835 U7(nightly214) - Umbraco.Field not working 2014-03-10 17:44:40 +11:00
Shannon 2dfa85c9b4 Fixes merge issues 2014-03-10 17:35:28 +11:00
Shannon 921a5963e2 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	src/Umbraco.Web.UI/umbraco/create/simple.ascx
	src/Umbraco.Web.UI/umbraco/developer/DataTypes/editDatatype.aspx
	src/Umbraco.Web/Umbraco.Web.csproj
	src/Umbraco.Web/umbraco.presentation/umbraco/create/nodeType.ascx.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/developer/DataTypes/editDatatype.aspx.cs
	src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs
2014-03-10 17:30:46 +11:00
Shannon 3626d5b79d fixes unit tests 2014-03-10 17:27:22 +11:00
Shannon 980e8e84a6 Fixes: U4-4353 You are able to create duplicate content/media/member type's with the same alias 2014-03-10 17:26:04 +11:00
Shannon 4070669e7d Completes: U4-4335 It's Possible to Create Duplicate Data Types 2014-03-10 16:00:53 +11:00
Shannon b20e61d316 Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts:
	build/Build.bat
	src/Umbraco.Web.UI/umbraco/create/simple.ascx
	src/Umbraco.Web/Umbraco.Web.csproj
	src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx
	src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.designer.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs
	src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs
2014-03-10 15:27:09 +11:00
Shannon fb764641c5 Fixes: U4-4335 It's Possible to Create Duplicate Data Types 2014-03-10 15:16:17 +11:00
Shannon 405727f1ac Completes: U4-3919 Get google spellchecker working in new RTE editor in a much better way that requires no server side implementations - it enables spell checking by the browser in the RTE which is heaps better and less code for us 2014-03-10 14:36:20 +11:00
Shannon 6446f63dcb Fixes: U4-4366 Lots of js errors in RteController when editing the rte data type 2014-03-10 14:16:24 +11:00
Shannon f1963fb404 Merge branch '7.1.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0 2014-03-10 12:56:01 +11:00
Shannon c26b72bd10 fixes a locking issue and exception logging 2014-03-10 12:55:45 +11:00
Shannon b94cee68e7 Merge branch '6.2.0' of https://github.com/umbraco/Umbraco-CMS into 6.2.0 2014-03-10 11:23:06 +11:00
Shannon b67fbbcbd8 Fixes: U4-4015 Usercontrol Browse Properties error 2014-03-10 11:22:49 +11:00
perploug 71fcc77e9b merge 2014-03-09 22:24:04 +01:00
perploug 38509f9d5a Adds details view to media picker to edit alt text 2014-03-09 22:21:55 +01:00
perploug 3ff04f585c Fixes issue with late-loaded file resolvers 2014-03-09 22:21:36 +01:00
Sebastiaan Janssen 3de8f9bd18 Merge pull request #311 from arknu/71-issue3691
U4-3691: Use empty alt text instead of 'Some description'
2014-03-08 14:05:52 +01:00
arknu c95e7c245e U4-3691: Use empty alt text instead of 'Some description' 2014-03-07 22:24:28 +01:00
Sebastiaan Janssen 4d3eef1124 Update version 2014-03-07 15:25:10 +01:00
Jeavon Leopold b048ae4d36 U4-1752 - Add GetPreValueAsString(id) method to the @Umbraco helper 2014-02-21 10:17:29 +00:00
Kevin Jump 366697f4eb PackageService: Fixes Single import for DataTypes
Importing a file with a single data type failed, because the DataType
element is at the root when exported.
2014-02-18 15:10:11 +00:00
Kevin Jump 987644379e Fix U4-4119 - Export Fails for Generic Properties
Adds null checking for PropertyGroupID on export so that properties with
no group (tab) don't throw an exception.
2014-02-18 15:07:47 +00:00
Mårten Palm 4a095184bb Prevent NullReferenceException
The variable val was not referenced later in the function and caused a
NullReferenceException.
2014-01-27 10:54:41 +01:00
Robert Foster f674fdf014 Implemented spectrum for picking colors for the color picker pre-value editor and added broader bgColor directive 2014-01-13 03:26:55 +11:00
Lars-Erik Aabech 6eeb9d6af4 Forgot document type on general properties tab 2014-01-07 18:53:47 +01:00
Lars-Erik Aabech cbefabb724 Changed TabsAndPropertyResolver's translation mechanism to use CultureDictionaryFactory. Also added translation to ContentTypeController.GetAllowedChildren. Localization "complete" and working for content editing. 2014-01-07 17:44:01 +01:00
Lars-Erik Aabech f7f6cc64ce More or less fixes content localization. Must do more tests and fix create dialog. Only tested manually on my box. 2014-01-07 16:43:03 +01:00
Lars-Erik Aabech 1408e4f64e DictionaryRepository now excludes translations with missing language. Should've committed a test to prove that TabsAndPropertiesResolver.TranslateTab uncommented fails, but can't find a nice existing fixture, so just debugging to see if it works now. 2014-01-07 16:15:59 +01:00
Lars-Erik Aabech 0a68d2f4ee Language repo now returns null for non-existing ids, making Get_WhenIdDoesntExist_ReturnsNull pass. 2014-01-07 16:03:26 +01:00
Lars-Erik Aabech 11a4a0436d Proves LanguageRepository lines 37-38 to be useless, but probably intended 2014-01-07 15:55:49 +01:00
Lars-Erik Aabech 2583800b2c Proves dictionary repository fails to get when weird 0 languageid dictionary item exists. 2014-01-07 15:53:17 +01:00
stefana99 067268a96e Changes to imageCropper, supports new mediafilesystem 2013-12-16 13:35:18 +00:00
570 changed files with 10430 additions and 5381 deletions
+5 -1
View File
@@ -1,6 +1,6 @@
@ECHO OFF
SET release=7.1.0
SET comment=beta
SET comment=
SET version=%release%
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
@@ -12,6 +12,9 @@ ECHO Installing the Microsoft.Bcl.Build package before anything else, otherwise
SET nuGetFolder=%CD%\..\src\packages\
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder%
ECHO Removing the belle build folder to make sure everything is clean as a whistle
RD ..\src\Umbraco.Web.UI.Client\build /Q /S
ECHO Performing MSBuild and producing Umbraco binaries zip files
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%
@@ -30,6 +33,7 @@ echo This file is only here so that the containing folder will be included in th
ECHO Adding Web.config transform files to the NuGet package
ren .\_BuildOutput\WebApp\MacroScripts\Web.config Web.config.transform
ren .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
ren .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform
ECHO Packing the NuGet release files
..\src\.nuget\NuGet.exe pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%
+11 -1
View File
@@ -310,7 +310,12 @@
</Target>
<Target Name="SetVersionNumber" Condition="'$(BUILD_RELEASE)'!=''">
<!-- Match & replace 3 and 4 digit version numbers and -beta (if it's there) -->
<PropertyGroup>
<NewVersion>$(BUILD_RELEASE)</NewVersion>
<NewVersion Condition="'$(BUILD_COMMENT)'!=''">$(BUILD_RELEASE)-$(BUILD_COMMENT)</NewVersion>
</PropertyGroup>
<!-- Match & replace 3 and 4 digit version numbers and -beta (if it's there) -->
<FileUpdate
Files="..\src\Umbraco.Core\Configuration\UmbracoVersion.cs"
Regex="(\d+)\.(\d+)\.(\d+)(.(\d+))?"
@@ -319,5 +324,10 @@
<FileUpdate Files="..\src\Umbraco.Core\Configuration\UmbracoVersion.cs"
Regex="CurrentComment { get { return &quot;([a-zA-Z]+)?&quot;"
ReplacementText="CurrentComment { get { return &quot;$(BUILD_COMMENT)&quot;"/>
<XmlPoke XmlInputPath=".\NuSpecs\build\UmbracoCms.targets"
Namespaces="&lt;Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/msbuild/2003' /&gt;"
Query="//x:UmbracoVersion"
Value="$(NewVersion)" />
</Target>
</Project>
+7 -6
View File
@@ -4,7 +4,7 @@
<id>UmbracoCms.Core</id>
<version>7.0.0</version>
<title>Umbraco Cms Core Binaries</title>
<authors>Morten Christensen</authors>
<authors>Umbraco HQ</authors>
<owners>Umbraco HQ</owners>
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
<projectUrl>http://umbraco.com/</projectUrl>
@@ -16,8 +16,8 @@
<tags>umbraco</tags>
<dependencies>
<dependency id="Microsoft.AspNet.Mvc" version="[4.0.0,5.0.0)" />
<dependency id="Microsoft.AspNet.WebApi" version="[4.0.0,5.0.0)" />
<dependency id="Microsoft.AspNet.WebApi.Client" version="[4.0.0, 5.0.0)" />
<dependency id="Microsoft.AspNet.WebApi" version="[4.0.30506,5.0.0)" />
<dependency id="Microsoft.AspNet.WebApi.Client" version="[4.0.30506, 5.0.0)" />
<dependency id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" />
<dependency id="Microsoft.Net.Http" version="[2.0.0, 3.0.0)" />
<dependency id="MiniProfiler" version="[2.1.0, 3.0.0)" />
@@ -26,16 +26,17 @@
<dependency id="SharpZipLib" version="[0.86.0, 1.0.0)" />
<dependency id="MySql.Data" version="[6.6.5]" />
<dependency id="xmlrpcnet" version="[2.5.0, 3.0.0)" />
<!--<dependency id="ClientDependency" version="[1.7.0, 2.0.0)" />-->
<dependency id="ClientDependency-Mvc" version="[1.7.0, 2.0.0)" />
<dependency id="ClientDependency" version="[1.7.1.2, 2.0.0)" />
<dependency id="ClientDependency-Mvc" version="[1.7.0.4, 2.0.0)" />
<dependency id="AutoMapper" version="[3.0.0, 4.0.0)" />
<dependency id="Newtonsoft.Json" version="[4.5.11, 5.0.0)" />
<dependency id="ImageProcessor" version="[1.8.7, 2.0.0)" />
<dependency id="ImageProcessor.Web" version="[3.2.1, 4.0.0)" />
</dependencies>
</metadata>
<files>
<file src="..\_BuildOutput\WebApp\bin\businesslogic.dll" target="lib\businesslogic.dll" />
<file src="..\_BuildOutput\WebApp\bin\businesslogic.xml" target="lib\businesslogic.xml" />
<file src="..\_BuildOutput\WebApp\bin\ClientDependency.Core.dll" target="lib\ClientDependency.Core.dll" />
<file src="..\_BuildOutput\WebApp\bin\cms.dll" target="lib\cms.dll" />
<file src="..\_BuildOutput\WebApp\bin\cms.xml" target="lib\cms.xml" />
<file src="..\_BuildOutput\WebApp\bin\controls.dll" target="lib\controls.dll" />
+5 -7
View File
@@ -4,7 +4,7 @@
<id>UmbracoCms</id>
<version>7.0.0</version>
<title>Umbraco Cms</title>
<authors>Morten Christensen</authors>
<authors>Umbraco HQ</authors>
<owners>Umbraco HQ</owners>
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
<projectUrl>http://umbraco.com/</projectUrl>
@@ -19,8 +19,6 @@
</dependencies>
</metadata>
<files>
<file src="..\_BuildOutput\WebApp\bin\amd64\**" target="Content\bin\amd64" />
<file src="..\_BuildOutput\WebApp\bin\x86\**" target="Content\bin\x86" />
<file src="..\_BuildOutput\Configs\**" target="Content\config" exclude="..\_BuildOutput\Configs\Web.config.transform" />
<file src="..\_BuildOutput\WebApp\css\**" target="Content\css" />
<file src="..\_BuildOutput\WebApp\macroScripts\**" target="Content\macroScripts" exclude="..\_BuildOutput\WebApp\macroScripts\Web.config" />
@@ -32,14 +30,14 @@
<file src="..\_BuildOutput\WebApp\xslt\**" target="Content\xslt" />
<file src="..\_BuildOutput\WebApp\default.aspx" target="Content\default.aspx" />
<file src="..\_BuildOutput\WebApp\Web.config" target="Content\Web.config" />
<file src="..\_BuildOutput\WebApp\Global.asax" target="Content\Global.asax" />
<file src="..\_BuildOutput\WebApp\App_Browsers\**" target="UmbracoFiles\App_Browsers" />
<file src="..\_BuildOutput\WebApp\App_Code\**" target="UmbracoFiles\App_Code" />
<file src="..\_BuildOutput\WebApp\App_Data\**" target="UmbracoFiles\App_Data" />
<file src="..\_BuildOutput\WebApp\App_Plugins\**" target="UmbracoFiles\App_Plugins" />
<file src="..\_BuildOutput\WebApp\App_Plugins\**" target="UmbracoFiles\App_Plugins" />
<file src="..\_BuildOutput\WebApp\bin\amd64\**" target="UmbracoFiles\bin\amd64" />
<file src="..\_BuildOutput\WebApp\bin\x86\**" target="UmbracoFiles\bin\x86" />
<file src="..\_BuildOutput\WebApp\config\splashes\**" target="UmbracoFiles\config\splashes" />
<file src="..\_BuildOutput\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
<file src="..\_BuildOutput\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
<file src="..\_BuildOutput\WebApp\Global.asax" target="UmbracoFiles\Global.asax" />
<file src="..\_BuildOutput\WebApp\Web.config" target="UmbracoFiles\Web.config" />
<file src="tools\install.ps1" target="tools\install.ps1" />
<file src="tools\Readme.txt" target="tools\Readme.txt" />
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
</Project>
+50
View File
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UmbracoVersion>7.1.0</UmbracoVersion>
</PropertyGroup>
<Target Name="CopyUmbracoFilesToWebRoot" BeforeTargets="AfterBuild">
<PropertyGroup>
<UmbracoFilesFolder>..\packages\UmbracoCms.$(UmbracoVersion)\UmbracoFiles\</UmbracoFilesFolder>
</PropertyGroup>
<ItemGroup>
<UmbracoFiles Include="$(UmbracoFilesFolder)**\*" />
</ItemGroup>
<Copy SourceFiles="%(UmbracoFiles.FullPath)" DestinationFiles="%(RecursiveDir)%(Filename)%(Extension)" Condition="!Exists('%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<Target Name="AddUmbracoFilesToOutput">
<!-- With help from: http://blog.samstephens.co.nz/2010-10-18/msbuild-including-extra-files-multiple-builds/ -->
<ItemGroup>
<CustomFilesToInclude Include=".\App_Browsers\**\*">
<Dir>App_Browsers</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\App_Code\**\*">
<Dir>App_Code</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\App_Plugins\**\*">
<Dir>App_Plugins</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\bin\amd64\**\*">
<Dir>bin\amd64</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\bin\x86\**\*">
<Dir>bin\x86</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\Config\Splashes\**\*">
<Dir>Config\Splashes</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\umbraco\**\*">
<Dir>umbraco</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\umbraco_client\**\*">
<Dir>umbraco_client</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\Global.asax">
<Dir>.</Dir>
</CustomFilesToInclude>
<FilesForPackagingFromProject Include="@(CustomFilesToInclude)">
<DestinationRelativePath>%(CustomFilesToInclude.Dir)\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
</Project>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="AddUmbracoFilesToOutput">
<ItemGroup>
<UmbracoFiles Include=".\umbraco\**\*;" />
<UmbracoClientFiles Include=".\umbraco_client\**\*;" />
<AppBrowsersFiles Include=".\App_Browsers\**\*" />
<FilesForPackagingFromProject Include="%(UmbracoFiles.Identity)">
<DestinationRelativePath>umbraco\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
<FilesForPackagingFromProject Include="%(UmbracoClientFiles.Identity)">
<DestinationRelativePath>umbraco_client\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
<FilesForPackagingFromProject Include="%(AppBrowsersFiles.Identity)">
<DestinationRelativePath>App_Browsers\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
</Project>
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
</Project>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="AddUmbracoFilesToOutput">
<ItemGroup>
<UmbracoFiles Include=".\umbraco\**\*;" />
<UmbracoClientFiles Include=".\umbraco_client\**\*;" />
<AppBrowsersFiles Include=".\App_Browsers\**\*" />
<FilesForPackagingFromProject Include="%(UmbracoFiles.Identity)">
<DestinationRelativePath>umbraco\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
<FilesForPackagingFromProject Include="%(UmbracoClientFiles.Identity)">
<DestinationRelativePath>umbraco_client\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
<FilesForPackagingFromProject Include="%(AppBrowsersFiles.Identity)">
<DestinationRelativePath>App_Browsers\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
</Project>
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
</Project>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="AddUmbracoFilesToOutput">
<ItemGroup>
<UmbracoFiles Include=".\umbraco\**\*;" />
<UmbracoClientFiles Include=".\umbraco_client\**\*;" />
<AppBrowsersFiles Include=".\App_Browsers\**\*" />
<FilesForPackagingFromProject Include="%(UmbracoFiles.Identity)">
<DestinationRelativePath>umbraco\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
<FilesForPackagingFromProject Include="%(UmbracoClientFiles.Identity)">
<DestinationRelativePath>umbraco_client\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
<FilesForPackagingFromProject Include="%(AppBrowsersFiles.Identity)">
<DestinationRelativePath>App_Browsers\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
</Project>
+14 -5
View File
@@ -1,8 +1,17 @@
A note about running Umbraco from Visual Studio.
When upgrading your website using nuget a backup of config files and web.config will be created. Only the web.config will
be overwritten by default to ensure that it has the necessary settings from the current release. This means that you'll
have to merge the files if you made any changes to the previous config files.
When upgrading your website using NuGet you should answer "No" to the questions to overwrite the Web.config
file (and config files in the config folder).
We will overwrite Web.config anyway but we keep a backup in the App_Data\NuGetBackup folder. There you'll
find a folder with the current date and time in which the backup has been placed. Make sure to merge the
new file with the old backup files before you proceed.
The web.config will be overwritten by default to ensure that it has the necessary settings from the current release.
We've also overwritten all the files in the Umbraco and Umbraco_Client folder, these have also been backed up in
App_Data\NuGetBackup. We didn't overwrite the UI.xml file nor did we remove any files or folders that you or a package
might have added. Only the existing files were overwritten. If you customized anything then make sure to do a compare
and merge with the NuGetBackup folder.
The config files found in the config folder will usually not be changed for patch releases, so they can usually be skipped,
but the web.config will have to have its previous "umbracoConfigurationStatus"-appsetting and "umbracoDbDSN" connection string
copied over (as a minimum).
@@ -10,8 +19,8 @@ copied over (as a minimum).
This nuget package includes build targets that extends the creation of a deploy package, which is generated by
Publishing from Visual Studio. The targets will only work once Publishing is configured, so if you don't use
Publish this won't affect you.
These folders will now be automatically included when creating a deploy package or publishing to the file system:
umbraco and umbraco_client.
These things will now be automatically included when creating a deploy package or publishing to the file system:
umbraco, umbraco_client, config\splashes and global.asax.
Please read the release notes on our.umbraco.org:
http://our.umbraco.org/contribute/releases
+30 -19
View File
@@ -1,27 +1,38 @@
param($rootPath, $toolsPath, $package, $project)
if ($project) {
# Create a backup of extisting umbraco config files
$configPath = Join-Path (Split-Path $project.FullName -Parent) "\config"
$backupPath = Join-Path $configPath "\backup"
Get-ChildItem -path $configPath |
Where -filterscript {($_.Name.EndsWith("config"))} | Foreach-Object {
$newFileName = Join-Path $backupPath $_.Name.replace(".config",".config.backup")
New-Item -ItemType File -Path $newFileName -Force
Copy-Item $_.FullName $newFileName -Force
}
if ($project) {
$dateTime = Get-Date -Format yyyyMMdd-HHmmss
$backupPath = Join-Path (Split-Path $project.FullName -Parent) "\App_Data\NuGetBackup\$dateTime"
# Create backup folder if it doesn't exist yet
New-Item -ItemType Directory -Force -Path $backupPath
# Create a backup of original web.config
$projectDestinationPath = Split-Path $project.FullName -Parent
$webConfigSource = Join-Path $projectDestinationPath "web.config"
$webConfigDestination = Join-Path $projectDestinationPath "web.config.backup"
Copy-Item $webConfigSource $webConfigDestination
$webConfigSource = Join-Path $projectDestinationPath "Web.config"
Copy-Item $webConfigSource $backupPath -Force
# Copy umbraco files from package to project folder
$projectDestinationPath = Split-Path $project.FullName -Parent
$umbracoFilesPath = Join-Path $rootPath "UmbracoFiles\*"
Copy-Item $umbracoFilesPath $projectDestinationPath -recurse -force
# Copy Web.config from package to project folder
$umbracoFilesPath = Join-Path $rootPath "UmbracoFiles\Web.config"
Copy-Item $umbracoFilesPath $projectDestinationPath -Force
# Copy umbraco and umbraco_files from package to project folder
# This is only done when these folders already exist because we
# only want to do this for upgrades
$umbracoFolder = Join-Path $projectDestinationPath "Umbraco\"
if(Test-Path $umbracoFolder) {
$umbracoFolderSource = Join-Path $rootPath "UmbracoFiles\Umbraco"
Copy-Item $umbracoFolder $backupPath -Force
robocopy $umbracoFolderSource $umbracoFolder /e /xf UI.xml
}
$umbracoClientFolder = Join-Path $projectDestinationPath "Umbraco_Client"
if(Test-Path $umbracoClientFolder) {
$umbracoClientFolderSource = Join-Path $rootPath "UmbracoFiles\Umbraco_Client"
Copy-Item $umbracoClientFolder $backupPath -Force
robocopy $umbracoFolderSource $umbracoClientFolder /e
}
# Open readme.txt file
$DTE.ItemOperations.OpenFile($toolsPath + '\Readme.txt')
}
@@ -287,11 +287,11 @@ namespace Umbraco.Core.Configuration
{
get
{
return IsConfiguredMembershipProviderUsingLegacyEncoding(Constants.Conventions.User.UmbracoUsersProviderName);
return IsConfiguredMembershipProviderUsingLegacyEncoding(UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider);
}
set
{
SetMembershipProvidersLegacyEncoding(Constants.Conventions.User.UmbracoUsersProviderName, value);
SetMembershipProvidersLegacyEncoding(UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider, value);
}
}
+24 -15
View File
@@ -34,31 +34,19 @@ namespace Umbraco.Core.Configuration
{
if (_umbracoSettings == null)
{
var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettingsSection;
if (umbracoSettings == null)
{
LogHelper.Warn<UmbracoConfig>("Could not load the " + typeof(IUmbracoSettingsSection) + " from config file!");
}
var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettingsSection;
SetUmbracoSettings(umbracoSettings);
}
if (_baseRestExtensions == null)
{
var baseRestExtensions = ConfigurationManager.GetSection("umbracoConfiguration/BaseRestExtensions") as IBaseRestSection;
if (baseRestExtensions == null)
{
LogHelper.Warn<UmbracoConfig>("Could not load the " + typeof(IBaseRestSection) + " from config file!");
}
var baseRestExtensions = ConfigurationManager.GetSection("umbracoConfiguration/BaseRestExtensions") as IBaseRestSection;
SetBaseRestExtensions(baseRestExtensions);
}
if (_dashboardSection == null)
{
var dashboardConfig = ConfigurationManager.GetSection("umbracoConfiguration/dashBoard") as IDashboardSection;
if (dashboardConfig == null)
{
LogHelper.Warn<UmbracoConfig>("Could not load the " + typeof(IDashboardSection) + " from config file!");
}
var dashboardConfig = ConfigurationManager.GetSection("umbracoConfiguration/dashBoard") as IDashboardSection;
SetDashboardSettings(dashboardConfig);
}
}
@@ -85,6 +73,13 @@ namespace Umbraco.Core.Configuration
/// </summary>
public IDashboardSection DashboardSettings()
{
if (_dashboardSection == null)
{
var ex = new ConfigurationErrorsException("Could not load the " + typeof(IDashboardSection) + " from config file, ensure the web.config and Dashboard.config files are formatted correctly");
LogHelper.Error<UmbracoConfig>("Config error", ex);
throw ex;
}
return _dashboardSection;
}
@@ -105,6 +100,13 @@ namespace Umbraco.Core.Configuration
/// </summary>
public IUmbracoSettingsSection UmbracoSettings()
{
if (_umbracoSettings == null)
{
var ex = new ConfigurationErrorsException("Could not load the " + typeof (IUmbracoSettingsSection) + " from config file, ensure the web.config and umbracoSettings.config files are formatted correctly");
LogHelper.Error<UmbracoConfig>("Config error", ex);
throw ex;
}
return _umbracoSettings;
}
@@ -119,6 +121,13 @@ namespace Umbraco.Core.Configuration
/// </summary>
public IBaseRestSection BaseRestExtensions()
{
if (_baseRestExtensions == null)
{
var ex = new ConfigurationErrorsException("Could not load the " + typeof(IBaseRestSection) + " from config file, ensure the web.config and BaseRestExtensions.config files are formatted correctly");
LogHelper.Error<UmbracoConfig>("Config error", ex);
throw ex;
}
return _baseRestExtensions;
}
@@ -11,8 +11,8 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
{
return new OptionalInnerTextConfigurationElement<string>(
(InnerTextConfigurationElement<string>)this["DefaultBackofficeProvider"],
//set the default
Constants.Conventions.User.UmbracoUsersProviderName);
//set the default
"UsersMembershipProvider");
}
}
@@ -23,7 +23,7 @@ namespace Umbraco.Core.Configuration
/// Gets the version comment (like beta or RC).
/// </summary>
/// <value>The version comment.</value>
public static string CurrentComment { get { return "beta"; } }
public static string CurrentComment { get { return ""; } }
// Get the version of the umbraco.dll by looking at a class in that dll
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
+5 -14
View File
@@ -93,16 +93,7 @@ namespace Umbraco.Core
/// </summary>
public const string Image = "Image";
}
/// <summary>
/// Constants for Umbraco user
/// </summary>
public static class User
{
public static readonly string UmbracoUsersProviderName = "UsersMembershipProvider";
}
/// <summary>
/// Constants for Umbraco Member property aliases.
/// </summary>
@@ -136,28 +127,28 @@ namespace Umbraco.Core
/// </summary>
public const string Comments = "umbracoMemberComments";
public const string CommentsLabel = "Comments";
public const string CommentsLabel = "Comments";
/// <summary>
/// Property alias for the Approved boolean of a Member
/// </summary>
public const string IsApproved = "umbracoMemberApproved";
public const string IsApprovedLabel = "Is Approved";
public const string IsApprovedLabel = "Is Approved";
/// <summary>
/// Property alias for the Locked out boolean of a Member
/// </summary>
public const string IsLockedOut = "umbracoMemberLockedOut";
public const string IsLockedOutLabel = "Is Locked Out";
public const string IsLockedOutLabel = "Is Locked Out";
/// <summary>
/// Property alias for the last date the Member logged in
/// </summary>
public const string LastLoginDate = "umbracoMemberLastLogin";
public const string LastLoginDateLabel = "Last Login Date";
public const string LastLoginDateLabel = "Last Login Date";
/// <summary>
/// Property alias for the last date a Member changed its password
+51
View File
@@ -0,0 +1,51 @@
namespace Umbraco.Core
{
public static partial class Constants
{
/// <summary>
/// Defines the constants used for Umbraco packages in the package.config xml
/// </summary>
public static class Packaging
{
public const string UmbPackageNodeName = "umbPackage";
public const string DataTypesNodeName = "DataTypes";
public const string PackageXmlFileName = "package.xml";
public const string UmbracoPackageExtention = ".umb";
public const string DataTypeNodeName = "DataType";
public const string LanguagesNodeName = "Languages";
public const string FilesNodeName = "Files";
public const string StylesheetsNodeName = "Stylesheets";
public const string TemplatesNodeName = "Templates";
public const string OrgnameNodeName = "orgName";
public const string NameNodeName = "Name";
public const string TemplateNodeName = "Template";
public const string AliasNodeName = "Alias";
public const string DictionaryitemsNodeName = "DictionaryItems";
public const string MacrosNodeName = "macros";
public const string DocumentSetNodeName = "DocumentSet";
public const string DocumentTypesNodeName = "DocumentTypes";
public const string DocumentTypeNodeName = "DocumentType";
public const string FileNodeName = "file";
public const string OrgPathNodeName = "orgPath";
public const string GuidNodeName = "guid";
public const string StylesheetNodeName = "styleSheet";
public const string MacroNodeName = "macro";
public const string InfoNodeName = "info";
public const string PackageRequirementsMajorXpath = "/package/requirements/major";
public const string PackageRequirementsMinorXpath = "/package/requirements/minor";
public const string PackageRequirementsPatchXpath = "/package/requirements/patch";
public const string PackageNameXpath = "/package/name";
public const string PackageVersionXpath = "/package/version";
public const string PackageUrlXpath = "/package/url";
public const string PackageLicenseXpath = "/package/license";
public const string AuthorNameXpath = "/author/name";
public const string AuthorWebsiteXpath = "/author/website";
public const string ReadmeXpath = "/readme";
public const string ControlNodeName = "control";
public const string ActionNodeName = "Action";
public const string ActionsNodeName = "Actions";
public const string UndoNodeAttribute = "undo";
public const string RunatNodeAttribute = "runat";
}
}
}
+4 -7
View File
@@ -243,7 +243,6 @@ namespace Umbraco.Core
//stop the timer and log the output
_timer.Dispose();
return this;
}
@@ -312,17 +311,15 @@ namespace Umbraco.Core
//the database migration objects
MigrationResolver.Current = new MigrationResolver(
() => PluginManager.Current.ResolveMigrationTypes());
() => PluginManager.Current.ResolveTypes<IMigration>());
// todo: remove once we drop IPropertyEditorValueConverter support.
PropertyEditorValueConvertersResolver.Current = new PropertyEditorValueConvertersResolver(
PluginManager.Current.ResolvePropertyEditorValueConverters());
//add the internal ones, these are not public currently so need to add them manually
PropertyValueConvertersResolver.Current = new PropertyValueConvertersResolver(
PluginManager.Current.ResolvePropertyValueConverters());
// fixme - why not use the following syntax?
//PluginManager.Current.ResolveTypes<IPropertyValueConverter>());
// need to filter out the ones we dont want!!
PropertyValueConvertersResolver.Current = new PropertyValueConvertersResolver(
PluginManager.Current.ResolveTypes<IPropertyValueConverter>());
// use the new DefaultShortStringHelper
ShortStringHelperResolver.Current = new ShortStringHelperResolver(
+31 -16
View File
@@ -3,6 +3,7 @@ using System.Configuration;
using System.Data.SqlServerCe;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Xml.Linq;
using Umbraco.Core.Configuration;
@@ -435,6 +436,13 @@ namespace Umbraco.Core
if (_result == null)
{
if (SystemUtilities.GetCurrentTrustLevel() != AspNetHostingPermissionLevel.Unrestricted
&& ProviderName == "MySql.Data.MySqlClient")
{
throw new InvalidOperationException("Cannot use MySql in Medium Trust configuration");
}
var database = new UmbracoDatabase(_connectionString, ProviderName);
var dbSchema = new DatabaseSchemaCreation(database);
_result = dbSchema.ValidateSchema();
@@ -443,15 +451,15 @@ namespace Umbraco.Core
}
internal Result CreateDatabaseSchemaAndData()
{
var readyForInstall = CheckReadyForInstall();
if (readyForInstall.Success == false)
{
return readyForInstall.Result;
}
{
try
{
var readyForInstall = CheckReadyForInstall();
if (readyForInstall.Success == false)
{
return readyForInstall.Result;
}
LogHelper.Info<DatabaseContext>("Database configuration status: Started");
string message;
@@ -509,14 +517,15 @@ namespace Umbraco.Core
/// <returns></returns>
internal Result UpgradeSchemaAndData()
{
var readyForInstall = CheckReadyForInstall();
if (readyForInstall.Success == false)
{
return readyForInstall.Result;
}
try
{
var readyForInstall = CheckReadyForInstall();
if (readyForInstall.Success == false)
{
return readyForInstall.Result;
}
LogHelper.Info<DatabaseContext>("Database upgrade started");
var database = new UmbracoDatabase(_connectionString, ProviderName);
@@ -529,11 +538,11 @@ namespace Umbraco.Core
//DO the upgrade!
var configuredVersion = string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus)
var currentVersion = string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus)
? installedVersion
: new Version(GlobalSettings.ConfigurationStatus);
var targetVersion = UmbracoVersion.Current;
var runner = new MigrationRunner(configuredVersion, targetVersion, GlobalSettings.UmbracoMigrationName);
var runner = new MigrationRunner(currentVersion, targetVersion, GlobalSettings.UmbracoMigrationName);
var upgraded = runner.Execute(database, true);
message = message + "<p>Upgrade completed!</p>";
@@ -576,6 +585,12 @@ namespace Umbraco.Core
private Attempt<Result> CheckReadyForInstall()
{
if (SystemUtilities.GetCurrentTrustLevel() != AspNetHostingPermissionLevel.Unrestricted
&& ProviderName == "MySql.Data.MySqlClient")
{
throw new InvalidOperationException("Cannot use MySql in Medium Trust configuration");
}
if (_configured == false || (string.IsNullOrEmpty(_connectionString) || string.IsNullOrEmpty(ProviderName)))
{
return Attempt.Fail(new Result
@@ -591,7 +606,7 @@ namespace Umbraco.Core
private Result HandleInstallException(Exception ex)
{
LogHelper.Info<DatabaseContext>("Database configuration failed with the following error and stack trace: " + ex.Message + "\n" + ex.StackTrace);
LogHelper.Error<DatabaseContext>("Database configuration failed", ex);
if (_result != null)
{
+7 -16
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using Umbraco.Core.Logging;
namespace Umbraco.Core
{
@@ -14,7 +15,7 @@ namespace Umbraco.Core
public static IEnumerable<IEnumerable<T>> InGroupsOf<T>(this IEnumerable<T> source, int groupSize)
{
if (source == null)
throw new NullReferenceException("source");
throw new NullReferenceException("source");
// enumerate the source only once!
return new InGroupsEnumerator<T>(source, groupSize).Groups();
@@ -125,23 +126,13 @@ namespace Umbraco.Core
}
/// <summary>The flatten list.</summary>
/// <param name="items">The items.</param>
/// <param name="selectChild">The select child.</param>
/// <typeparam name="TItem">Item type</typeparam>
/// <param name="e">The items.</param>
/// <param name="f">The select child.</param>
/// <typeparam name="T">Item type</typeparam>
/// <returns>list of TItem</returns>
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "By design")]
public static IEnumerable<TItem> FlattenList<TItem>(this IEnumerable<TItem> items, Func<TItem, IEnumerable<TItem>> selectChild)
public static IEnumerable<T> FlattenList<T>(this IEnumerable<T> e, Func<T, IEnumerable<T>> f)
{
IEnumerable<TItem> children = items != null && items.Any()
? items.SelectMany(selectChild).FlattenList(selectChild)
: Enumerable.Empty<TItem>();
if (items != null)
{
return items.Concat(children);
}
return null;
return e.SelectMany(c => f(c).FlattenList(f)).Concat(e);
}
/// <summary>
@@ -0,0 +1,13 @@
using System;
namespace Umbraco.Core
{
/// <summary>
/// Used to notify the TypeFinder to ignore any class attributed with this during it's discovery
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public sealed class HideFromTypeFinderAttribute : Attribute
{
}
}
+4 -5
View File
@@ -206,11 +206,10 @@ namespace Umbraco.Core.IO
var fileNameThumb = string.IsNullOrWhiteSpace(fileNameAddition)
? string.Format("{0}_UMBRACOSYSTHUMBNAIL.jpg", Path.Substring(0, Path.LastIndexOf(".", StringComparison.Ordinal)))
: string.Format("{0}_{1}.jpg", Path.Substring(0, Path.LastIndexOf(".", StringComparison.Ordinal)), fileNameAddition);
var thumbnail = maxWidthHeight == -1
?ImageHelper.GenerateThumbnail(image, maxWidthHeight, fileNameThumb, Extension, _fs)
: ImageHelper.GenerateThumbnail(image, width, height, fileNameThumb, Extension, _fs);
var thumbnail = maxWidthHeight == -1
? ImageHelper.GenerateThumbnail(image, width, height, fileNameThumb, Extension, _fs)
: ImageHelper.GenerateThumbnail(image, maxWidthHeight, fileNameThumb, Extension, _fs);
return thumbnail.FileName;
}
+76 -43
View File
@@ -15,65 +15,104 @@ namespace Umbraco.Core.Models
public class Member : ContentBase, IMember
{
private readonly IMemberType _contentType;
private string _contentTypeAlias;
private readonly string _contentTypeAlias;
private string _username;
private string _email;
private string _password;
private string _rawPasswordValue;
private object _providerUserKey;
private Type _userTypeKey;
/// <summary>
/// Constructor for creating an empty Member object
/// </summary>
/// <param name="contentType">ContentType for the current Content object</param>
public Member(IMemberType contentType)
: base("", -1, contentType, new PropertyCollection())
{
Mandate.ParameterNotNull(contentType, "contentType");
_contentTypeAlias = contentType.Alias;
_contentType = contentType;
IsApproved = true;
//this cannot be null but can be empty
_rawPasswordValue = "";
_email = "";
_username = "";
}
/// <summary>
/// Constructor for creating a Member object
/// </summary>
/// <param name="name">Name of the content</param>
/// <param name="contentType">ContentType for the current Content object</param>
public Member(string name, IMemberType contentType)
: this(contentType)
{
Mandate.ParameterNotNull(contentType, "contentType");
Mandate.ParameterNotNullOrEmpty(name, "name");
_contentTypeAlias = contentType.Alias;
_contentType = contentType;
IsApproved = true;
//this cannot be null but can be empty
_rawPasswordValue = "";
_email = "";
_username = "";
}
/// <summary>
/// Constructor for creating a Member object
/// </summary>
/// <param name="name"></param>
/// <param name="email"></param>
/// <param name="username"></param>
/// <param name="contentType"></param>
public Member(string name, string email, string username, IMemberType contentType)
: base(name, -1, contentType, new PropertyCollection())
{
_contentType = contentType;
IsApproved = true;
}
//TODO: Should we just get rid of this one? no reason to have a level set.
internal Member(string name, string email, string username, string password, int parentId, IMemberType contentType)
: base(name, parentId, contentType, new PropertyCollection())
{
Mandate.ParameterNotNull(contentType, "contentType");
Mandate.ParameterNotNullOrEmpty(name, "name");
Mandate.ParameterNotNullOrEmpty(email, "email");
Mandate.ParameterNotNullOrEmpty(username, "username");
_contentTypeAlias = contentType.Alias;
_contentType = contentType;
_email = email;
_username = username;
_password = password;
IsApproved = true;
//this cannot be null but can be empty
_rawPasswordValue = "";
}
public Member(string name, string email, string username, string password, IMemberType contentType)
: this(name, email, username, password, -1, contentType)
/// <summary>
/// Constructor for creating a Member object
/// </summary>
/// <param name="name"></param>
/// <param name="email"></param>
/// <param name="username"></param>
/// <param name="rawPasswordValue">
/// The password value passed in to this parameter should be the encoded/encrypted/hashed format of the member's password
/// </param>
/// <param name="contentType"></param>
public Member(string name, string email, string username, string rawPasswordValue, IMemberType contentType)
: base(name, -1, contentType, new PropertyCollection())
{
Mandate.ParameterNotNull(contentType, "contentType");
_contentTypeAlias = contentType.Alias;
_contentType = contentType;
_email = email;
_username = username;
_password = password;
_rawPasswordValue = rawPasswordValue;
IsApproved = true;
}
//public Member(string name, string email, string username, string password, IContentBase parent, IMemberType contentType)
// : base(name, parent, contentType, new PropertyCollection())
//{
// Mandate.ParameterNotNull(contentType, "contentType");
// _contentType = contentType;
// _email = email;
// _username = username;
// _password = password;
//}
private static readonly PropertyInfo DefaultContentTypeAliasSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.ContentTypeAlias);
private static readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Username);
private static readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Email);
private static readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Password);
private static readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.RawPasswordValue);
private static readonly PropertyInfo ProviderUserKeySelector = ExpressionHelper.GetPropertyInfo<Member, object>(x => x.ProviderUserKey);
private static readonly PropertyInfo UserTypeKeySelector = ExpressionHelper.GetPropertyInfo<Member, Type>(x => x.ProviderUserKeyType);
@@ -112,19 +151,19 @@ namespace Umbraco.Core.Models
}
/// <summary>
/// Gets or sets the Password
/// Gets or sets the raw password value
/// </summary>
[DataMember]
public string Password
public string RawPasswordValue
{
get { return _password; }
get { return _rawPasswordValue; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_password = value;
return _password;
}, _password, PasswordSelector);
_rawPasswordValue = value;
return _rawPasswordValue;
}, _rawPasswordValue, PasswordSelector);
}
}
@@ -168,14 +207,16 @@ namespace Umbraco.Core.Models
}
/// <summary>
/// Gets or sets the Password Answer
/// Gets or sets the raw password answer value
/// </summary>
/// <remarks>
/// For security reasons this value should be encrypted, the encryption process is handled by the memberhip provider
/// Alias: umbracoMemberPasswordRetrievalAnswer
///
/// Part of the standard properties collection.
/// </remarks>
[IgnoreDataMember]
public string PasswordAnswer
public string RawPasswordAnswerValue
{
get
{
@@ -433,14 +474,6 @@ namespace Umbraco.Core.Models
public virtual string ContentTypeAlias
{
get { return _contentTypeAlias; }
internal set
{
SetPropertyValueAndDetectChanges(o =>
{
_contentTypeAlias = value;
return _contentTypeAlias;
}, _contentTypeAlias, DefaultContentTypeAliasSelector);
}
}
/// <summary>
+3 -1
View File
@@ -44,7 +44,9 @@ namespace Umbraco.Core.Models
SetPropertyValueAndDetectChanges(o =>
{
_alias = value == "_umbracoSystemDefaultProtectType" ? value : value.ToSafeAlias();
_alias = value == "_umbracoSystemDefaultProtectType"
? value
: (value == null ? string.Empty : value.ToSafeAlias() );
return _alias;
}, _alias, AliasSelector);
}
@@ -9,9 +9,19 @@ namespace Umbraco.Core.Models.Membership
object ProviderUserKey { get; set; }
string Username { get; set; }
string Email { get; set; }
string Password { get; set; }
/// <summary>
/// Gets or sets the raw password value
/// </summary>
string RawPasswordValue { get; set; }
string PasswordQuestion { get; set; }
string PasswordAnswer { get; set; }
/// <summary>
/// Gets or sets the raw password answer value
/// </summary>
string RawPasswordAnswerValue { get; set; }
string Comments { get; set; }
bool IsApproved { get; set; }
bool IsLockedOut { get; set; }
@@ -1,4 +1,4 @@
namespace Umbraco.Core.Services
namespace Umbraco.Core.Models.Membership
{
/// <summary>
/// The types of members to count
@@ -1,10 +1,11 @@
using System;
using System.Web.Security;
using Umbraco.Core.Security;
using Umbraco.Core.Services;
namespace Umbraco.Core.Models.Membership
{
internal static class MembershipExtensions
internal static class MembershipUserExtensions
{
internal static UmbracoMembershipMember AsConcreteMembershipUser(this IMembershipUser member, string providerName)
{
@@ -32,7 +33,8 @@ namespace Umbraco.Core.Models.Membership
{
if (_scenario.HasValue == false)
{
if (System.Web.Security.Membership.Provider.Name == Constants.Conventions.Member.UmbracoMemberProviderName)
var provider = MembershipProviderExtensions.GetMembersMembershipProvider();
if (provider.IsUmbracoMembershipProvider())
{
return MembershipScenario.NativeUmbraco;
}
+13 -10
View File
@@ -27,6 +27,7 @@ namespace Umbraco.Core.Models.Membership
if (userType == null) throw new ArgumentNullException("userType");
_userType = userType;
_defaultPermissions = _userType.Permissions;
//Groups = new List<object> { userType };
SessionTimeout = 60;
_sectionCollection = new ObservableCollection<string>();
@@ -38,15 +39,17 @@ namespace Umbraco.Core.Models.Membership
_isLockedOut = false;
_startContentId = -1;
_startMediaId = -1;
//cannot be null
_rawPasswordValue = "";
}
public User(string name, string email, string username, string password, IUserType userType)
public User(string name, string email, string username, string rawPasswordValue, IUserType userType)
: this(userType)
{
_name = name;
_email = email;
_username = username;
_password = password;
_rawPasswordValue = rawPasswordValue;
_isApproved = true;
_isLockedOut = false;
_startContentId = -1;
@@ -67,7 +70,7 @@ namespace Umbraco.Core.Models.Membership
private string _username;
private string _email;
private string _password;
private string _rawPasswordValue;
private bool _isApproved;
private bool _isLockedOut;
private string _language;
@@ -84,7 +87,7 @@ namespace Umbraco.Core.Models.Membership
private static readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Username);
private static readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Email);
private static readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Password);
private static readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.RawPasswordValue);
private static readonly PropertyInfo IsLockedOutSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsLockedOut);
private static readonly PropertyInfo IsApprovedSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsApproved);
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Language);
@@ -204,16 +207,16 @@ namespace Umbraco.Core.Models.Membership
}
}
[DataMember]
public string Password
public string RawPasswordValue
{
get { return _password; }
get { return _rawPasswordValue; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_password = value;
return _password;
}, _password, PasswordSelector);
_rawPasswordValue = value;
return _rawPasswordValue;
}, _rawPasswordValue, PasswordSelector);
}
}
@@ -251,7 +254,7 @@ namespace Umbraco.Core.Models.Membership
[IgnoreDataMember]
public string PasswordQuestion { get; set; }
[IgnoreDataMember]
public string PasswordAnswer { get; set; }
public string RawPasswordAnswerValue { get; set; }
[IgnoreDataMember]
public string Comments { get; set; }
[IgnoreDataMember]
+14 -2
View File
@@ -5,10 +5,17 @@
/// </summary>
public class PreValue
{
public PreValue(int id, string value, int sortOrder)
{
Id = id;
Value = value;
SortOrder = sortOrder;
}
public PreValue(int id, string value)
{
Value = value;
Id = id;
Id = id;
Value = value;
}
public PreValue(string value)
@@ -25,5 +32,10 @@
/// The database id for the pre-value field value
/// </summary>
public int Id { get; private set; }
/// <summary>
/// The sort order stored for the pre-value field value
/// </summary>
public int SortOrder { get; private set; }
}
}
@@ -141,9 +141,21 @@ namespace Umbraco.Core.Models.PublishedContent
if (GetPublishedContentTypeCallback != null)
return GetPublishedContentTypeCallback(alias);
var contentType = itemType == PublishedItemType.Content
? (IContentTypeComposition) ApplicationContext.Current.Services.ContentTypeService.GetContentType(alias)
: (IContentTypeComposition) ApplicationContext.Current.Services.ContentTypeService.GetMediaType(alias);
IContentTypeComposition contentType;
switch (itemType)
{
case PublishedItemType.Content:
contentType = ApplicationContext.Current.Services.ContentTypeService.GetContentType(alias);
break;
case PublishedItemType.Media:
contentType = ApplicationContext.Current.Services.ContentTypeService.GetMediaType(alias);
break;
case PublishedItemType.Member:
contentType = ApplicationContext.Current.Services.MemberTypeService.Get(alias);
break;
default:
throw new ArgumentOutOfRangeException("itemType");
}
if (contentType == null)
throw new Exception(string.Format("ContentTypeService failed to find a {0} type with alias \"{1}\".",
@@ -269,7 +269,7 @@ namespace Umbraco.Core.Models.PublishedContent
: Enumerable.Empty<IPropertyValueConverter>();
}
class CompatConverter : PropertyValueConverterBase
private class CompatConverter : PropertyValueConverterBase
{
private readonly IPropertyEditorValueConverter _converter;
+6 -1
View File
@@ -13,6 +13,11 @@ namespace Umbraco.Core.Models
/// <summary>
/// A media.
/// </summary>
Media
Media,
/// <summary>
/// A member.
/// </summary>
Member
}
}
@@ -10,7 +10,7 @@ namespace Umbraco.Core.Models.Rdbms
internal class PreviewXmlDto
{
[Column("nodeId")]
[PrimaryKeyColumn(AutoIncrement = false, Name = "", OnColumns = "nodeId, versionId")]
[PrimaryKeyColumn(AutoIncrement = false, Name = "PK_cmsContentPreviewXml", OnColumns = "nodeId, versionId")]
[ForeignKey(typeof(ContentDto), Column = "nodeId")]
public int NodeId { get; set; }
@@ -9,7 +9,7 @@ namespace Umbraco.Core.Models.Rdbms
internal class UserLoginDto
{
[Column("contextID")]
[Index(IndexTypes.Clustered, Name = "umbracoUserLogins_Index")]
[Index(IndexTypes.Clustered, Name = "IX_umbracoUserLogins_Index")]
public Guid ContextId { get; set; }
[Column("userID")]
+9
View File
@@ -21,9 +21,18 @@ namespace Umbraco.Core.Models
public RelationType(Guid childObjectType, Guid parentObjectType, string @alias)
{
Mandate.ParameterNotNullOrEmpty(@alias, "alias");
_childObjectType = childObjectType;
_parentObjectType = parentObjectType;
_alias = alias;
Name = _alias;
}
public RelationType(Guid childObjectType, Guid parentObjectType, string @alias, string name)
:this(childObjectType, parentObjectType, @alias)
{
Mandate.ParameterNotNullOrEmpty(name, "name");
Name = name;
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Name);
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using umbraco.interfaces;
namespace Umbraco.Core.ObjectResolution
@@ -8,7 +9,10 @@ namespace Umbraco.Core.ObjectResolution
/// <summary>
/// A resolver to return all IApplicationEvents objects
/// </summary>
internal sealed class ApplicationEventsResolver : ManyObjectsResolverBase<ApplicationEventsResolver, IApplicationEventHandler>
/// <remarks>
/// This is disposable because after the app has started it should be disposed to release any memory being occupied by instances.
/// </remarks>
internal sealed class ApplicationEventsResolver : ManyObjectsResolverBase<ApplicationEventsResolver, IApplicationEventHandler>, IDisposable
{
private readonly LegacyStartupHandlerResolver _legacyResolver;
@@ -53,7 +57,7 @@ namespace Umbraco.Core.ObjectResolution
protected override bool SupportsClear
{
get { return false; }
get { return false; }
}
protected override bool SupportsInsert
@@ -61,7 +65,7 @@ namespace Umbraco.Core.ObjectResolution
get { return false; }
}
private class LegacyStartupHandlerResolver : ManyObjectsResolverBase<ApplicationEventsResolver, IApplicationStartupHandler>
private class LegacyStartupHandlerResolver : ManyObjectsResolverBase<ApplicationEventsResolver, IApplicationStartupHandler>, IDisposable
{
internal LegacyStartupHandlerResolver(IEnumerable<Type> legacyStartupHandlers)
: base(legacyStartupHandlers)
@@ -73,7 +77,72 @@ namespace Umbraco.Core.ObjectResolution
{
get { return Values; }
}
}
public void Dispose()
{
ResetCollections();
}
}
private bool _disposed;
private readonly ReaderWriterLockSlim _disposalLocker = new ReaderWriterLockSlim();
/// <summary>
/// Gets a value indicating whether this instance is disposed.
/// </summary>
/// <value>
/// <c>true</c> if this instance is disposed; otherwise, <c>false</c>.
/// </value>
public bool IsDisposed
{
get { return _disposed; }
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
/// <filterpriority>2</filterpriority>
public void Dispose()
{
Dispose(true);
// Use SupressFinalize in case a subclass of this type implements a finalizer.
GC.SuppressFinalize(this);
}
~ApplicationEventsResolver()
{
// Run dispose but let the class know it was due to the finalizer running.
Dispose(false);
}
private void Dispose(bool disposing)
{
// Only operate if we haven't already disposed
if (IsDisposed || disposing == false) return;
using (new WriteLock(_disposalLocker))
{
// Check again now we're inside the lock
if (IsDisposed) return;
// Call to actually release resources. This method is only
// kept separate so that the entire disposal logic can be used as a VS snippet
DisposeResources();
// Indicate that the instance has been disposed.
_disposed = true;
}
}
/// <summary>
/// Clear out all of the instances, we don't want them hanging around and cluttering up memory
/// </summary>
private void DisposeResources()
{
_legacyResolver.Dispose();
ResetCollections();
}
}
}
@@ -18,7 +18,7 @@ namespace Umbraco.Core.ObjectResolution
/// <para>Important notes about this resolver: it does not support Insert or Remove and therefore does not support any ordering unless
/// the types are marked with the WeightedPluginAttribute.</para>
/// </remarks>
internal abstract class LazyManyObjectsResolverBase<TResolver, TResolved> : ManyObjectsResolverBase<TResolver, TResolved>
public abstract class LazyManyObjectsResolverBase<TResolver, TResolved> : ManyObjectsResolverBase<TResolver, TResolved>
where TResolved : class
where TResolver : ResolverBase
{
@@ -322,7 +322,7 @@ namespace Umbraco.Core.ObjectResolution
}
/// <summary>
/// Clears the list of types.
/// Clears the list of types
/// </summary>
/// <exception cref="InvalidOperationException">the resolver does not support clearing types.</exception>
public virtual void Clear()
@@ -336,6 +336,20 @@ namespace Umbraco.Core.ObjectResolution
}
}
/// <summary>
/// WARNING! Do not use this unless you know what you are doing, clear all types registered and instances
/// created. Typically only used if a resolver is no longer used in an application and memory is to be GC'd
/// </summary>
internal void ResetCollections()
{
using (new WriteLock(_lock))
{
_instanceTypes.Clear();
_sortedValues = null;
_applicationInstances = null;
}
}
/// <summary>
/// Inserts a type at the specified index.
/// </summary>
@@ -0,0 +1,21 @@
using System;
using System.Runtime.Serialization;
using System.Xml;
namespace Umbraco.Core.Packaging.Models
{
[Serializable]
[DataContract(IsReference = true)]
internal class InstallAction
{
public string Alias { get; set; }
public string PackageName { get; set; }
public string RunAt { get; set; }//NOTE Should this default to "install"
public bool Undo { get; set; }
public XmlNode XmlData { get; set; }
}
}
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Umbraco.Core.Packaging.Models
{
[Serializable]
[DataContract(IsReference = true)]
internal class InstallationSummary
{
public MetaData MetaData { get; set; }
public IEnumerable<int> DataTypesInstalled { get; set; }
public IEnumerable<int> LanguagesInstalled { get; set; }
public IEnumerable<int> DictionaryItemsInstalled { get; set; }
public IEnumerable<int> MacrosInstalled { get; set; }
public IEnumerable<KeyValuePair<string, bool>> FilesInstalled { get; set;}
public IEnumerable<int> TemplatesInstalled { get; set; }
public IEnumerable<int> DocumentTypesInstalled { get; set; }
public IEnumerable<int> StylesheetsInstalled { get; set; }
public IEnumerable<int> DocumentsInstalled { get; set; }
public IEnumerable<InstallAction> InstallActions { get; set; }
public IEnumerable<UninstallAction> UninstallActions { get; set; }
}
}
@@ -0,0 +1,23 @@
using System;
using System.Runtime.Serialization;
namespace Umbraco.Core.Packaging.Models
{
[Serializable]
[DataContract(IsReference = true)]
internal class MetaData
{
public string Name { get; set; }
public string Version { get; set; }
public string Url { get; set; }
public string License { get; set; }
public string LicenseUrl { get; set; }
public int ReqMajor { get; set; }
public int ReqMinor { get; set; }
public int ReqPatch { get; set; }
public string AuthorName { get; set; }
public string AuthorUrl { get; set; }
public string Readme { get; set; }
public string Control { get; set; }
}
}
@@ -0,0 +1,21 @@
using System;
using System.Runtime.Serialization;
using System.Xml;
namespace Umbraco.Core.Packaging.Models
{
[Serializable]
[DataContract(IsReference = true)]
internal class UninstallAction
{
public string Alias { get; set; }
public string PackageName { get; set; }
public string RunAt { get; set; }//NOTE Should this default to "install"
public bool Undo { get; set; }//NOTE: Should thid default to "False"?
public XmlNode XmlData { get; set; }
}
}
@@ -0,0 +1,18 @@
using Umbraco.Core.Services;
namespace Umbraco.Core.Packaging
{
internal interface IPackageBuilding
{
}
internal class PackageBuilding : IPackageBuilding
{
private readonly PackagingService _packagingService;
public PackageBuilding(PackagingService packagingService)
{
_packagingService = packagingService;
}
}
}
@@ -0,0 +1,34 @@
using System;
using System.IO;
using Umbraco.Core.IO;
namespace Umbraco.Core.Packaging
{
internal interface IPackageExtraction
{
bool Extract(string packageFilePath, string destinationFolder);
string ExtractToTemporaryFolder(string packageFilePath);
string GetPackageConfigFromArchive(string packageFilePath, string fileToRead = "package.xml");
}
internal class PackageExtraction : IPackageExtraction
{
public bool Extract(string packageFilePath, string destinationFolder)
{
return true;
}
public string ExtractToTemporaryFolder(string packageFilePath)
{
string tempDir = Path.Combine(IOHelper.MapPath(SystemDirectories.Data), Guid.NewGuid().ToString("D"));
Directory.CreateDirectory(tempDir);
Extract(packageFilePath, tempDir);
return tempDir;
}
public string GetPackageConfigFromArchive(string packageFilePath, string fileToRead = "package.xml")
{
return string.Empty;
}
}
}
@@ -0,0 +1,35 @@
using Umbraco.Core.Packaging.Models;
using Umbraco.Core.Services;
namespace Umbraco.Core.Packaging
{
internal interface IPackageInstallation
{
InstallationSummary InstallPackage(string packageFilePath, int userId = 0);
MetaData GetPackageMetaData(string packageFilePath);
}
internal class PackageInstallation : IPackageInstallation
{
private readonly PackagingService _packagingService;
private readonly PackageExtraction _packageExtraction;
public PackageInstallation(PackagingService packagingService, PackageExtraction packageExtraction)
{
_packagingService = packagingService;
_packageExtraction = packageExtraction;
}
public InstallationSummary InstallPackage(string packageFilePath, int userId = 0)
{
var summary = new InstallationSummary();
return summary;
}
public MetaData GetPackageMetaData(string packageFilePath)
{
var metaData = new MetaData();
return metaData;
}
}
}
@@ -0,0 +1,13 @@
namespace Umbraco.Core.Persistence.DatabaseModelDefinitions
{
/// <summary>
/// Represents a database index definition retreived by querying the database
/// </summary>
internal class DbIndexDefinition
{
public virtual string IndexName { get; set; }
public virtual string TableName { get; set; }
public virtual string ColumnName { get; set; }
public virtual bool IsUnique { get; set; }
}
}
@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Core.Persistence
{
internal static class DbConnectionExtensions
{
public static DatabaseProviders DetectProviderFromConnectionString(string connString)
{
var builder = new DbConnectionStringBuilder {ConnectionString = connString};
var allKeys = builder.Keys.Cast<string>();
var mySql = new[] {"Server", "Database", "Uid", "Pwd"};
if (mySql.All(x => allKeys.InvariantContains(x)))
{
return DatabaseProviders.MySql;
}
if (allKeys.InvariantContains("Data Source")
//this dictionary is case insensitive
&& builder["Data source"].ToString().InvariantContains(".sdf"))
{
return DatabaseProviders.SqlServerCE;
}
return DatabaseProviders.SqlServer;
}
public static bool IsConnectionAvailable(string connString, DatabaseProviders provider)
{
DbProviderFactory factory;
switch (provider)
{
case DatabaseProviders.SqlServer:
case DatabaseProviders.SqlAzure:
factory = DbProviderFactories.GetFactory("System.Data.SqlClient");
break;
case DatabaseProviders.SqlServerCE:
factory = DbProviderFactories.GetFactory("System.Data.SqlServerCe.4.0");
break;
case DatabaseProviders.MySql:
factory = DbProviderFactories.GetFactory("MySql.Data.MySqlClient");
break;
case DatabaseProviders.PostgreSQL:
case DatabaseProviders.Oracle:
case DatabaseProviders.SQLite:
default:
throw new NotSupportedException("The provider " + provider + " is not supported");
}
var conn = factory.CreateConnection();
if (conn == null)
{
throw new InvalidOperationException("Could not create a connection for provider " + provider);
}
conn.ConnectionString = connString;
using (var connection = conn)
{
return connection.IsAvailable();
}
}
public static bool IsAvailable(this IDbConnection connection)
{
try
{
connection.Open();
connection.Close();
}
catch (SqlException)
{
return false;
}
return true;
}
}
}
@@ -30,7 +30,7 @@ namespace Umbraco.Core.Persistence.Factories
NodeId = entity.Id,
Email = entity.Email,
LoginName = entity.Username,
Password = entity.Password,
Password = entity.RawPasswordValue,
ContentVersionDto = BuildDto(entity as Member)
};
return member;
@@ -19,7 +19,7 @@ namespace Umbraco.Core.Persistence.Factories
{
var properties = CreateProperties(_memberTypes[dto.ContentTypeAlias], dto.Properties, dto.CreateDate);
var member = new Member(dto.Text, dto.Email, dto.LoginName, dto.Password, dto.ParentId, _memberTypes[dto.ContentTypeAlias])
var member = new Member(dto.Text, dto.Email, dto.LoginName, dto.Password, _memberTypes[dto.ContentTypeAlias])
{
Id = dto.NodeId,
CreateDate = dto.CreateDate,
@@ -33,7 +33,6 @@ namespace Umbraco.Core.Persistence.Factories
Path = dto.Path,
SortOrder = dto.SortOrder,
Version = dto.VersionId,
ContentTypeAlias = dto.ContentTypeAlias,
Properties = new PropertyCollection(properties)
};
@@ -26,7 +26,7 @@ namespace Umbraco.Core.Persistence.Factories
Key = guidId,
StartContentId = dto.ContentStartId,
StartMediaId = dto.MediaStartId.HasValue ? dto.MediaStartId.Value : -1,
Password = dto.Password,
RawPasswordValue = dto.Password,
Username = dto.Login,
Name = dto.UserName,
IsLockedOut = dto.NoConsole,
@@ -59,7 +59,7 @@ namespace Umbraco.Core.Persistence.Factories
Email = entity.Email,
Login = entity.Username,
NoConsole = entity.IsLockedOut,
Password = entity.Password,
Password = entity.RawPasswordValue,
UserLanguage = entity.Language,
UserName = entity.Name,
Type = short.Parse(entity.UserType.Id.ToString(CultureInfo.InvariantCulture)),
@@ -48,12 +48,12 @@ namespace Umbraco.Core.Persistence.Mappers
CacheMap<Member, MemberDto>(src => src.Email, dto => dto.Email);
CacheMap<Member, MemberDto>(src => src.Username, dto => dto.LoginName);
CacheMap<Member, MemberDto>(src => src.Password, dto => dto.Password);
CacheMap<Member, MemberDto>(src => src.RawPasswordValue, dto => dto.Password);
CacheMap<Member, PropertyDataDto>(src => src.IsApproved, dto => dto.Integer);
CacheMap<Member, PropertyDataDto>(src => src.IsLockedOut, dto => dto.Integer);
CacheMap<Member, PropertyDataDto>(src => src.Comments, dto => dto.Text);
CacheMap<Member, PropertyDataDto>(src => src.PasswordAnswer, dto => dto.VarChar);
CacheMap<Member, PropertyDataDto>(src => src.RawPasswordAnswerValue, dto => dto.VarChar);
CacheMap<Member, PropertyDataDto>(src => src.PasswordQuestion, dto => dto.VarChar);
CacheMap<Member, PropertyDataDto>(src => src.FailedPasswordAttempts, dto => dto.Integer);
CacheMap<Member, PropertyDataDto>(src => src.LastLockoutDate, dto => dto.Date);
@@ -0,0 +1,43 @@
using System.Collections.Concurrent;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Rdbms;
namespace Umbraco.Core.Persistence.Mappers
{
/// <summary>
/// Represents a <see cref="Tag"/> to DTO mapper used to translate the properties of the public api
/// implementation to that of the database's DTO as sql: [tableName].[columnName].
/// </summary>
[MapperFor(typeof(Tag))]
[MapperFor(typeof(ITag))]
public sealed class TagMapper : BaseMapper
{
private static readonly ConcurrentDictionary<string, DtoMapModel> PropertyInfoCacheInstance = new ConcurrentDictionary<string, DtoMapModel>();
//NOTE: its an internal class but the ctor must be public since we're using Activator.CreateInstance to create it
// otherwise that would fail because there is no public constructor.
public TagMapper()
{
BuildMap();
}
#region Overrides of BaseMapper
internal override ConcurrentDictionary<string, DtoMapModel> PropertyInfoCache
{
get { return PropertyInfoCacheInstance; }
}
internal override void BuildMap()
{
if (PropertyInfoCache.IsEmpty)
{
CacheMap<Tag, TagDto>(src => src.Id, dto => dto.Id);
CacheMap<Tag, TagDto>(src => src.Text, dto => dto.Tag);
CacheMap<Tag, TagDto>(src => src.Group, dto => dto.Group);
}
}
#endregion
}
}
@@ -31,7 +31,7 @@ namespace Umbraco.Core.Persistence.Mappers
CacheMap<User, UserDto>(src => src.Id, dto => dto.Id);
CacheMap<User, UserDto>(src => src.Email, dto => dto.Email);
CacheMap<User, UserDto>(src => src.Username, dto => dto.Login);
CacheMap<User, UserDto>(src => src.Password, dto => dto.Password);
CacheMap<User, UserDto>(src => src.RawPasswordValue, dto => dto.Password);
CacheMap<User, UserDto>(src => src.Name, dto => dto.UserName);
//NOTE: This column in the db is *not* used!
//CacheMap<User, UserDto>(src => src.DefaultPermissions, dto => dto.DefaultPermissions);
@@ -0,0 +1,22 @@
using System;
namespace Umbraco.Core.Persistence.Migrations
{
/// <summary>
/// Used if a migration has executed but the whole process has failed and cannot be rolled back
/// </summary>
internal class DataLossException : Exception
{
public DataLossException(string msg)
: base(msg)
{
}
public DataLossException(string msg, Exception inner)
: base(msg, inner)
{
}
}
}
@@ -124,67 +124,60 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
{
var result = new DatabaseSchemaResult();
//get the db index defs
result.DbIndexDefinitions = SqlSyntaxContext.SqlSyntaxProvider.GetDefinedIndexes(_database)
.Select(x => new DbIndexDefinition()
{
TableName = x.Item1,
IndexName = x.Item2,
ColumnName = x.Item3,
IsUnique = x.Item4
}).ToArray();
foreach (var item in OrderedTables.OrderBy(x => x.Key))
{
var tableDefinition = DefinitionFactory.GetTableDefinition(item.Value);
result.TableDefinitions.Add(tableDefinition);
}
//Check tables in configured database against tables in schema
var tablesInDatabase = SqlSyntaxContext.SqlSyntaxProvider.GetTablesInSchema(_database).ToList();
var tablesInSchema = result.TableDefinitions.Select(x => x.Name).ToList();
//Add valid and invalid table differences to the result object
var validTableDifferences = tablesInDatabase.Intersect(tablesInSchema);
foreach (var tableName in validTableDifferences)
{
result.ValidTables.Add(tableName);
}
var invalidTableDifferences =
tablesInDatabase.Except(tablesInSchema)
.Union(tablesInSchema.Except(tablesInDatabase));
foreach (var tableName in invalidTableDifferences)
{
result.Errors.Add(new Tuple<string, string>("Table", tableName));
}
ValidateDbTables(result);
//Check columns in configured database against columns in schema
var columnsInDatabase = SqlSyntaxContext.SqlSyntaxProvider.GetColumnsInSchema(_database);
var columnsPerTableInDatabase = columnsInDatabase.Select(x => string.Concat(x.TableName, ",", x.ColumnName)).ToList();
var columnsPerTableInSchema = result.TableDefinitions.SelectMany(x => x.Columns.Select(y => string.Concat(y.TableName, ",", y.Name))).ToList();
//Add valid and invalid column differences to the result object
var validColumnDifferences = columnsPerTableInDatabase.Intersect(columnsPerTableInSchema);
foreach (var column in validColumnDifferences)
{
result.ValidColumns.Add(column);
}
var invalidColumnDifferences = columnsPerTableInDatabase.Except(columnsPerTableInSchema);
foreach (var column in invalidColumnDifferences)
{
result.Errors.Add(new Tuple<string, string>("Column", column));
}
ValidateDbColumns(result);
ValidateDbIndexes(result);
ValidateDbConstraints(result);
return result;
}
private void ValidateDbConstraints(DatabaseSchemaResult result)
{
//MySql doesn't conform to the "normal" naming of constraints, so there is currently no point in doing these checks.
//NOTE: At a later point we do other checks for MySql, but ideally it should be necessary to do special checks for different providers.
//TODO: At a later point we do other checks for MySql, but ideally it should be necessary to do special checks for different providers.
// ALso note that to get the constraints for MySql we have to open a connection which we currently have not.
if (SqlSyntaxContext.SqlSyntaxProvider is MySqlSyntaxProvider)
return result;
return;
//Check constraints in configured database against constraints in schema
var constraintsInDatabase = SqlSyntaxContext.SqlSyntaxProvider.GetConstraintsPerColumn(_database).DistinctBy(x => x.Item3).ToList();
var foreignKeysInDatabase = constraintsInDatabase.Where(x => x.Item3.StartsWith("FK_")).Select(x => x.Item3).ToList();
var primaryKeysInDatabase = constraintsInDatabase.Where(x => x.Item3.StartsWith("PK_")).Select(x => x.Item3).ToList();
var indexesInDatabase = constraintsInDatabase.Where(x => x.Item3.StartsWith("IX_")).Select(x => x.Item3).ToList();
var foreignKeysInDatabase = constraintsInDatabase.Where(x => x.Item3.InvariantStartsWith("FK_")).Select(x => x.Item3).ToList();
var primaryKeysInDatabase = constraintsInDatabase.Where(x => x.Item3.InvariantStartsWith("PK_")).Select(x => x.Item3).ToList();
var indexesInDatabase = constraintsInDatabase.Where(x => x.Item3.InvariantStartsWith("IX_")).Select(x => x.Item3).ToList();
var indexesInSchema = result.TableDefinitions.SelectMany(x => x.Indexes.Select(y => y.Name)).ToList();
var unknownConstraintsInDatabase =
constraintsInDatabase.Where(
x =>
x.Item3.StartsWith("FK_") == false && x.Item3.StartsWith("PK_") == false &&
x.Item3.StartsWith("IX_") == false).Select(x => x.Item3).ToList();
x.Item3.InvariantStartsWith("FK_") == false && x.Item3.InvariantStartsWith("PK_") == false &&
x.Item3.InvariantStartsWith("IX_") == false).Select(x => x.Item3).ToList();
var foreignKeysInSchema = result.TableDefinitions.SelectMany(x => x.ForeignKeys.Select(y => y.Name)).ToList();
var primaryKeysInSchema = result.TableDefinitions.SelectMany(x => x.Columns.Select(y => y.PrimaryKeyName)).ToList();
var indexesInSchema = result.TableDefinitions.SelectMany(x => x.Indexes.Select(y => y.Name)).ToList();
var primaryKeysInSchema = result.TableDefinitions.SelectMany(x => x.Columns.Select(y => y.PrimaryKeyName))
.Where(x => x.IsNullOrWhiteSpace() == false).ToList();
//Add valid and invalid foreign key differences to the result object
foreach (var unknown in unknownConstraintsInDatabase)
{
if (foreignKeysInSchema.Contains(unknown) || primaryKeysInSchema.Contains(unknown) || indexesInSchema.Contains(unknown))
if (foreignKeysInSchema.InvariantContains(unknown) || primaryKeysInSchema.InvariantContains(unknown) || indexesInSchema.InvariantContains(unknown))
{
result.ValidConstraints.Add(unknown);
}
@@ -193,40 +186,122 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
result.Errors.Add(new Tuple<string, string>("Unknown", unknown));
}
}
var validForeignKeyDifferences = foreignKeysInDatabase.Intersect(foreignKeysInSchema);
//Foreign keys:
var validForeignKeyDifferences = foreignKeysInDatabase.Intersect(foreignKeysInSchema, StringComparer.InvariantCultureIgnoreCase);
foreach (var foreignKey in validForeignKeyDifferences)
{
result.ValidConstraints.Add(foreignKey);
}
var invalidForeignKeyDifferences = foreignKeysInDatabase.Except(foreignKeysInSchema);
var invalidForeignKeyDifferences =
foreignKeysInDatabase.Except(foreignKeysInSchema, StringComparer.InvariantCultureIgnoreCase)
.Union(foreignKeysInSchema.Except(foreignKeysInDatabase, StringComparer.InvariantCultureIgnoreCase));
foreach (var foreignKey in invalidForeignKeyDifferences)
{
result.Errors.Add(new Tuple<string, string>("Constraint", foreignKey));
}
//Primary keys:
//Add valid and invalid primary key differences to the result object
var validPrimaryKeyDifferences = primaryKeysInDatabase.Intersect(primaryKeysInSchema);
var validPrimaryKeyDifferences = primaryKeysInDatabase.Intersect(primaryKeysInSchema, StringComparer.InvariantCultureIgnoreCase);
foreach (var primaryKey in validPrimaryKeyDifferences)
{
result.ValidConstraints.Add(primaryKey);
}
var invalidPrimaryKeyDifferences = primaryKeysInDatabase.Except(primaryKeysInSchema);
var invalidPrimaryKeyDifferences =
primaryKeysInDatabase.Except(primaryKeysInSchema, StringComparer.InvariantCultureIgnoreCase)
.Union(primaryKeysInSchema.Except(primaryKeysInDatabase, StringComparer.InvariantCultureIgnoreCase));
foreach (var primaryKey in invalidPrimaryKeyDifferences)
{
result.Errors.Add(new Tuple<string, string>("Constraint", primaryKey));
}
//Constaints:
//NOTE: SD: The colIndex checks above should really take care of this but I need to keep this here because it was here before
// and some schema validation checks might rely on this data remaining here!
//Add valid and invalid index differences to the result object
var validIndexDifferences = indexesInDatabase.Intersect(indexesInSchema);
var validIndexDifferences = indexesInDatabase.Intersect(indexesInSchema, StringComparer.InvariantCultureIgnoreCase);
foreach (var index in validIndexDifferences)
{
result.ValidConstraints.Add(index);
}
var invalidIndexDifferences = indexesInDatabase.Except(indexesInSchema);
var invalidIndexDifferences =
indexesInDatabase.Except(indexesInSchema, StringComparer.InvariantCultureIgnoreCase)
.Union(indexesInSchema.Except(indexesInDatabase, StringComparer.InvariantCultureIgnoreCase));
foreach (var index in invalidIndexDifferences)
{
result.Errors.Add(new Tuple<string, string>("Constraint", index));
}
}
return result;
private void ValidateDbColumns(DatabaseSchemaResult result)
{
//Check columns in configured database against columns in schema
var columnsInDatabase = SqlSyntaxContext.SqlSyntaxProvider.GetColumnsInSchema(_database);
var columnsPerTableInDatabase = columnsInDatabase.Select(x => string.Concat(x.TableName, ",", x.ColumnName)).ToList();
var columnsPerTableInSchema = result.TableDefinitions.SelectMany(x => x.Columns.Select(y => string.Concat(y.TableName, ",", y.Name))).ToList();
//Add valid and invalid column differences to the result object
var validColumnDifferences = columnsPerTableInDatabase.Intersect(columnsPerTableInSchema, StringComparer.InvariantCultureIgnoreCase);
foreach (var column in validColumnDifferences)
{
result.ValidColumns.Add(column);
}
var invalidColumnDifferences =
columnsPerTableInDatabase.Except(columnsPerTableInSchema, StringComparer.InvariantCultureIgnoreCase)
.Union(columnsPerTableInSchema.Except(columnsPerTableInDatabase, StringComparer.InvariantCultureIgnoreCase));
foreach (var column in invalidColumnDifferences)
{
result.Errors.Add(new Tuple<string, string>("Column", column));
}
}
private void ValidateDbTables(DatabaseSchemaResult result)
{
//Check tables in configured database against tables in schema
var tablesInDatabase = SqlSyntaxContext.SqlSyntaxProvider.GetTablesInSchema(_database).ToList();
var tablesInSchema = result.TableDefinitions.Select(x => x.Name).ToList();
//Add valid and invalid table differences to the result object
var validTableDifferences = tablesInDatabase.Intersect(tablesInSchema, StringComparer.InvariantCultureIgnoreCase);
foreach (var tableName in validTableDifferences)
{
result.ValidTables.Add(tableName);
}
var invalidTableDifferences =
tablesInDatabase.Except(tablesInSchema, StringComparer.InvariantCultureIgnoreCase)
.Union(tablesInSchema.Except(tablesInDatabase, StringComparer.InvariantCultureIgnoreCase));
foreach (var tableName in invalidTableDifferences)
{
result.Errors.Add(new Tuple<string, string>("Table", tableName));
}
}
private void ValidateDbIndexes(DatabaseSchemaResult result)
{
//These are just column indexes NOT constraints or Keys
//var colIndexesInDatabase = result.DbIndexDefinitions.Where(x => x.IndexName.InvariantStartsWith("IX_")).Select(x => x.IndexName).ToList();
var colIndexesInDatabase = result.DbIndexDefinitions.Select(x => x.IndexName).ToList();
var indexesInSchema = result.TableDefinitions.SelectMany(x => x.Indexes.Select(y => y.Name)).ToList();
//Add valid and invalid index differences to the result object
var validColIndexDifferences = colIndexesInDatabase.Intersect(indexesInSchema, StringComparer.InvariantCultureIgnoreCase);
foreach (var index in validColIndexDifferences)
{
result.ValidIndexes.Add(index);
}
var invalidColIndexDifferences =
colIndexesInDatabase.Except(indexesInSchema, StringComparer.InvariantCultureIgnoreCase)
.Union(indexesInSchema.Except(colIndexesInDatabase, StringComparer.InvariantCultureIgnoreCase));
foreach (var index in invalidColIndexDifferences)
{
result.Errors.Add(new Tuple<string, string>("Index", index));
}
}
#region Events
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -17,6 +17,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
ValidTables = new List<string>();
ValidColumns = new List<string>();
ValidConstraints = new List<string>();
ValidIndexes = new List<string>();
}
public List<Tuple<string, string>> Errors { get; set; }
@@ -29,6 +30,10 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
public List<string> ValidConstraints { get; set; }
public List<string> ValidIndexes { get; set; }
internal IEnumerable<DbIndexDefinition> DbIndexDefinitions { get; set; }
/// <summary>
/// Determines the version of the currently installed database.
/// </summary>
@@ -39,43 +44,53 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
public Version DetermineInstalledVersion()
{
//If (ValidTables.Count == 0) database is empty and we return -> new Version(0, 0, 0);
if(ValidTables.Count == 0)
if (ValidTables.Count == 0)
return new Version(0, 0, 0);
//If Errors is empty or if TableDefinitions tables + columns correspond to valid tables + columns then we're at current version
if (!Errors.Any() ||
if (Errors.Any() == false ||
(TableDefinitions.All(x => ValidTables.Contains(x.Name))
&& TableDefinitions.SelectMany(definition => definition.Columns).All(x => ValidColumns.Contains(x.Name))))
return UmbracoVersion.Current;
//If Errors contains umbracoApp or umbracoAppTree its pre-6.0.0 -> new Version(4, 10, 0);
if (Errors.Any(x => x.Item1.Equals("Table") && (x.Item2.Equals("umbracoApp") || x.Item2.Equals("umbracoAppTree"))))
if (Errors.Any(x => x.Item1.Equals("Table") && (x.Item2.InvariantEquals("umbracoApp") || x.Item2.InvariantEquals("umbracoAppTree"))))
{
//If Errors contains umbracoUser2app or umbracoAppTree foreignkey to umbracoApp exists its pre-4.8.0 -> new Version(4, 7, 0);
if (Errors.Any(x =>
x.Item1.Equals("Constraint")
&& (x.Item2.Contains("umbracoUser2app_umbracoApp")
|| x.Item2.Contains("umbracoAppTree_umbracoApp"))))
&& (x.Item2.InvariantContains("umbracoUser2app_umbracoApp")
|| x.Item2.InvariantContains("umbracoAppTree_umbracoApp"))))
{
return new Version(4, 7, 0);
}
return new Version(4, 9, 0);
}
//if the error is for umbracoServer
if (Errors.Any(x => x.Item1.Equals("Table") && (x.Item2.Equals("umbracoServer"))))
if (Errors.Any(x => x.Item1.Equals("Table") && (x.Item2.InvariantEquals("umbracoServer"))))
{
return new Version(6, 0, 0);
}
//if the error indicates a problem with the column cmsMacroProperty.macroPropertyType then it is not version 7 and the
// last db change we made was the umbracoServer in 6.1
if (Errors.Any(x => x.Item1.Equals("Column") && (x.Item2.Equals("cmsMacroProperty,macroPropertyType"))))
//if the error indicates a problem with the column cmsMacroProperty.macroPropertyType then it is not version 7
// since these columns get removed in v7
if (Errors.Any(x => x.Item1.Equals("Column") && (x.Item2.InvariantEquals("cmsMacroProperty,macroPropertyType"))))
{
return new Version(6, 1, 0);
//if the error is for this IX_umbracoNodeTrashed which is added in 6.2 AND in 7.1 but we do not have the above columns
// then it must mean that we aren't on 6.2 so must be 6.1
if (Errors.Any(x => x.Item1.Equals("Index") && (x.Item2.InvariantEquals("IX_umbracoNodeTrashed"))))
{
return new Version(6, 1, 0);
}
else
{
//if there are no errors for that index, then the person must have 6.2 installed
return new Version(6, 2, 0);
}
}
return UmbracoVersion.Current;
}
@@ -113,6 +128,13 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
sb.AppendLine(string.Join(",", Errors.Where(x => x.Item1.Equals("Constraint")).Select(x => x.Item2)));
sb.AppendLine(" ");
}
//Index error summary
if (Errors.Any(x => x.Item1.Equals("Index")))
{
sb.AppendLine("The following indexes were found in the database, but are not in the current schema:");
sb.AppendLine(string.Join(",", Errors.Where(x => x.Item1.Equals("Index")).Select(x => x.Item2)));
sb.AppendLine(" ");
}
//Unknown constraint error summary
if (Errors.Any(x => x.Item1.Equals("Unknown")))
{
@@ -6,8 +6,8 @@ namespace Umbraco.Core.Persistence.Migrations
/// Represents the Migration attribute, which is used to mark classes as
/// database migrations with Up/Down methods for pushing changes UP or pulling them DOWN.
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class MigrationAttribute : Attribute
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class MigrationAttribute : Attribute
{
public MigrationAttribute(string targetVersion, int sortOrder, string product)
{
@@ -16,8 +16,21 @@ namespace Umbraco.Core.Persistence.Migrations
ProductName = product;
}
public MigrationAttribute(string minimumCurrentVersion, string targetVersion, int sortOrder, string product)
{
TargetVersion = new Version(targetVersion);
MinimumCurrentVersion = new Version(minimumCurrentVersion);
SortOrder = sortOrder;
ProductName = product;
}
/// <summary>
/// Gets or sets the target version of this migration.
/// Gets the minimum current version for which this migration is allowed to execute
/// </summary>
public Version MinimumCurrentVersion { get; private set; }
/// <summary>
/// Gets the target version of this migration.
/// </summary>
public Version TargetVersion { get; private set; }
@@ -27,26 +27,8 @@ namespace Umbraco.Core.Persistence.Migrations
/// </summary>
public IEnumerable<IMigration> Migrations
{
get { return GetSortedValues(); }
get { return Values; }
}
/// <summary>
/// Override how we determine object weight, for this resolver we use the MigrationAttribute attribute
/// </summary>
/// <param name="o"></param>
/// <returns></returns>
protected override int GetObjectWeight(object o)
{
var type = o.GetType();
var attr = type.GetCustomAttribute<MigrationAttribute>(true);
return attr == null ? DefaultPluginWeight : attr.SortOrder;
}
protected override int DefaultPluginWeight
{
get { return 0; } //set's the default to 0
set { base.DefaultPluginWeight = value; }
}
}
}
@@ -3,22 +3,23 @@ using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Events;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence.Migrations.Syntax.IfDatabase;
namespace Umbraco.Core.Persistence.Migrations
{
/// <summary>
/// <summary>
/// Represents the Migration Runner, which is used to apply migrations to
/// the umbraco database.
/// </summary>
public class MigrationRunner
{
private readonly Version _configuredVersion;
private readonly Version _currentVersion;
private readonly Version _targetVersion;
private readonly string _productName;
public MigrationRunner(Version configuredVersion, Version targetVersion, string productName)
public MigrationRunner(Version currentVersion, Version targetVersion, string productName)
{
_configuredVersion = configuredVersion;
_currentVersion = currentVersion;
_targetVersion = targetVersion;
_productName = productName;
}
@@ -45,33 +46,50 @@ namespace Umbraco.Core.Persistence.Migrations
{
LogHelper.Info<MigrationRunner>("Initializing database migrations");
var foundMigrations = MigrationResolver.Current.Migrations;
var foundMigrations = MigrationResolver.Current.Migrations.ToArray();
//filter all non-schema migrations
var migrations = isUpgrade
? OrderedUpgradeMigrations(foundMigrations).ToList()
: OrderedDowngradeMigrations(foundMigrations).ToList();
if (Migrating.IsRaisedEventCancelled(new MigrationEventArgs(migrations, _configuredVersion, _targetVersion, true), this))
//SD: Why do we want this?
if (Migrating.IsRaisedEventCancelled(new MigrationEventArgs(migrations, _currentVersion, _targetVersion, true), this))
return false;
//Loop through migrations to generate sql
var context = new MigrationContext(databaseProvider, database);
foreach (MigrationBase migration in migrations)
var migrationContext = InitializeMigrations(migrations, database, databaseProvider, isUpgrade);
try
{
if (isUpgrade)
ExecuteMigrations(migrationContext, database);
}
catch (Exception ex)
{
//if this fails then the transaction will be rolled back, BUT if we are using MySql this is not the case,
//since it does not support schema changes in a transaction, see: http://dev.mysql.com/doc/refman/5.0/en/implicit-commit.html
//so in that case we have to downgrade
if (databaseProvider == DatabaseProviders.MySql)
{
migration.GetUpExpressions(context);
LogHelper.Info<MigrationRunner>(string.Format("Added UPGRADE migration '{0}' to context", migration.GetType().Name));
}
else
{
migration.GetDownExpressions(context);
LogHelper.Info<MigrationRunner>(string.Format("Added DOWNGRADE migration '{0}' to context", migration.GetType().Name));
throw new DataLossException(
"An error occurred running a schema migration but the changes could not be rolled back. Error: " + ex.Message + ". In some cases, it may be required that the database be restored to it's original state before running this upgrade process again.",
ex);
}
//continue throwing the exception
throw;
}
Migrated.RaiseEvent(new MigrationEventArgs(migrations, migrationContext, _currentVersion, _targetVersion, false), this);
return true;
}
private void ExecuteMigrations(IMigrationContext context, Database database)
{
//Transactional execution of the sql that was generated from the found migrations
using (Transaction transaction = database.GetTransaction())
using (var transaction = database.GetTransaction())
{
int i = 1;
foreach (var expression in context.Expressions)
@@ -90,38 +108,89 @@ namespace Umbraco.Core.Persistence.Migrations
transaction.Complete();
}
}
Migrated.RaiseEvent(new MigrationEventArgs(migrations, context, _configuredVersion, _targetVersion, false), this);
internal MigrationContext InitializeMigrations(List<IMigration> migrations, Database database, DatabaseProviders databaseProvider, bool isUpgrade = true)
{
//Loop through migrations to generate sql
var context = new MigrationContext(databaseProvider, database);
foreach (var migration in migrations)
{
var baseMigration = migration as MigrationBase;
if (baseMigration != null)
{
if (isUpgrade)
{
baseMigration.GetUpExpressions(context);
LogHelper.Info<MigrationRunner>(string.Format("Added UPGRADE migration '{0}' to context", baseMigration.GetType().Name));
}
else
{
baseMigration.GetDownExpressions(context);
LogHelper.Info<MigrationRunner>(string.Format("Added DOWNGRADE migration '{0}' to context", baseMigration.GetType().Name));
}
}
else
{
//this is just a normal migration so we can only call Up/Down
if (isUpgrade)
{
migration.Up();
LogHelper.Info<MigrationRunner>(string.Format("Added UPGRADE migration '{0}' to context", migration.GetType().Name));
}
else
{
migration.Down();
LogHelper.Info<MigrationRunner>(string.Format("Added DOWNGRADE migration '{0}' to context", migration.GetType().Name));
}
}
}
return true;
}
return context;
}
/// <summary>
/// Filters and orders migrations based on the migrations listed and the currently configured version and the target installation version
/// </summary>
/// <param name="foundMigrations"></param>
/// <returns></returns>
internal IEnumerable<IMigration> OrderedUpgradeMigrations(IEnumerable<IMigration> foundMigrations)
{
var migrations = (from migration in foundMigrations
let migrationAttribute = migration.GetType().FirstAttribute<MigrationAttribute>()
where migrationAttribute != null
where
migrationAttribute.TargetVersion > _configuredVersion &&
migrationAttribute.TargetVersion <= _targetVersion &&
migrationAttribute.ProductName == _productName
orderby migrationAttribute.TargetVersion, migrationAttribute.SortOrder ascending
select migration);
let migrationAttributes = migration.GetType().GetCustomAttributes<MigrationAttribute>(false)
from migrationAttribute in migrationAttributes
where migrationAttribute != null
where
migrationAttribute.TargetVersion > _currentVersion &&
migrationAttribute.TargetVersion <= _targetVersion &&
migrationAttribute.ProductName == _productName &&
//filter if the migration specifies a minimum current version for which to execute
(migrationAttribute.MinimumCurrentVersion == null || _currentVersion >= migrationAttribute.MinimumCurrentVersion)
orderby migrationAttribute.TargetVersion, migrationAttribute.SortOrder ascending
select migration).Distinct();
return migrations;
}
/// <summary>
/// Filters and orders migrations based on the migrations listed and the currently configured version and the target installation version
/// </summary>
/// <param name="foundMigrations"></param>
/// <returns></returns>
public IEnumerable<IMigration> OrderedDowngradeMigrations(IEnumerable<IMigration> foundMigrations)
{
var migrations = (from migration in foundMigrations
let migrationAttribute = migration.GetType().FirstAttribute<MigrationAttribute>()
where migrationAttribute != null
where
migrationAttribute.TargetVersion > _configuredVersion &&
migrationAttribute.TargetVersion <= _targetVersion &&
migrationAttribute.ProductName == _productName
orderby migrationAttribute.TargetVersion, migrationAttribute.SortOrder descending
select migration);
let migrationAttributes = migration.GetType().GetCustomAttributes<MigrationAttribute>(false)
from migrationAttribute in migrationAttributes
where migrationAttribute != null
where
migrationAttribute.TargetVersion > _currentVersion &&
migrationAttribute.TargetVersion <= _targetVersion &&
migrationAttribute.ProductName == _productName &&
//filter if the migration specifies a minimum current version for which to execute
(migrationAttribute.MinimumCurrentVersion == null || _currentVersion >= migrationAttribute.MinimumCurrentVersion)
orderby migrationAttribute.TargetVersion, migrationAttribute.SortOrder descending
select migration).Distinct();
return migrations;
}
@@ -1,4 +1,5 @@
using System;
using System.Linq;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.SqlSyntax;
@@ -41,7 +42,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions
if (string.IsNullOrEmpty(ForeignKey.Name))
{
ForeignKey.Name = string.Format("FK_{0}_{1}", ForeignKey.ForeignTable, ForeignKey.PrimaryTable);
ForeignKey.Name = string.Format("FK_{0}_{1}_{2}", ForeignKey.ForeignTable, ForeignKey.PrimaryTable, ForeignKey.PrimaryColumns.First());
}
return string.Format(SqlSyntaxContext.SqlSyntaxProvider.DeleteConstraint,
@@ -1,4 +1,5 @@
using Umbraco.Core.Persistence.Migrations.Syntax.Delete.Column;
using System;
using Umbraco.Core.Persistence.Migrations.Syntax.Delete.Column;
using Umbraco.Core.Persistence.Migrations.Syntax.Delete.Constraint;
using Umbraco.Core.Persistence.Migrations.Syntax.Delete.DefaultConstraint;
using Umbraco.Core.Persistence.Migrations.Syntax.Delete.ForeignKey;
@@ -11,6 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete
void Table(string tableName);
IDeleteColumnFromTableSyntax Column(string columnName);
IDeleteForeignKeyFromTableSyntax ForeignKey();
[Obsolete("Do not use this construct as it does not work with MySql, use the syntax: Delete.ForeignKey().FromTable(\"umbracoUser2app\").ForeignColumn(... instead")]
IDeleteForeignKeyOnTableSyntax ForeignKey(string foreignKeyName);
IDeleteDataSyntax FromTable(string tableName);
IDeleteIndexForTableSyntax Index();
@@ -8,9 +8,21 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionFourNineZero
{
public override void Up()
{
Delete.ForeignKey().FromTable("umbracoUser2app").ForeignColumn("app").ToTable("umbracoApp").PrimaryColumn("appAlias");
//This will work on mysql and should work on mssql however the old keys were not named consistently with how the keys are
// structured now. So we need to do a check and manually remove them based on their old aliases.
Delete.ForeignKey().FromTable("umbracoAppTree").ForeignColumn("appAlias").ToTable("umbracoApp").PrimaryColumn("appAlias");
if (this.Context.CurrentDatabaseProvider == DatabaseProviders.MySql)
{
Delete.ForeignKey().FromTable("umbracoUser2app").ForeignColumn("app").ToTable("umbracoApp").PrimaryColumn("appAlias");
Delete.ForeignKey().FromTable("umbracoAppTree").ForeignColumn("appAlias").ToTable("umbracoApp").PrimaryColumn("appAlias");
}
else
{
//These are the old aliases
Delete.ForeignKey("FK_umbracoUser2app_umbracoApp").OnTable("umbracoUser2app");
Delete.ForeignKey("FK_umbracoUser2app_umbracoUser").OnTable("umbracoUser2app");
}
}
public override void Down()
@@ -1,5 +1,8 @@
using System;
using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
{
@@ -9,18 +12,45 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
[Migration("7.0.0", 5, GlobalSettings.UmbracoMigrationName)]
public class AddIndexToCmsMacroPropertyTable : MigrationBase
{
private readonly bool _skipIndexCheck;
internal AddIndexToCmsMacroPropertyTable(bool skipIndexCheck)
{
_skipIndexCheck = skipIndexCheck;
}
public AddIndexToCmsMacroPropertyTable()
{
}
public override void Up()
{
Create.Index("IX_cmsMacroProperty_Alias").OnTable("cmsMacroProperty")
var dbIndexes = _skipIndexCheck ? new DbIndexDefinition[]{} : SqlSyntaxContext.SqlSyntaxProvider.GetDefinedIndexes(Context.Database)
.Select(x => new DbIndexDefinition()
{
TableName = x.Item1,
IndexName = x.Item2,
ColumnName = x.Item3,
IsUnique = x.Item4
}).ToArray();
//make sure it doesn't already exist
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_cmsMacroProperty_Alias")) == false)
{
Create.Index("IX_cmsMacroProperty_Alias").OnTable("cmsMacroProperty")
.OnColumn("macro")
.Ascending()
.OnColumn("macroPropertyAlias")
.Unique();
}
}
public override void Down()
{
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
Delete.Index("IX_cmsMacroProperty_Alias").OnTable("cmsMacroProperty");
}
}
}
@@ -1,5 +1,9 @@
using System;
using System.CodeDom;
using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
{
@@ -9,14 +13,40 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
[Migration("7.0.0", 4, GlobalSettings.UmbracoMigrationName)]
public class AddIndexToCmsMacroTable : MigrationBase
{
private readonly bool _skipIndexCheck;
internal AddIndexToCmsMacroTable(bool skipIndexCheck)
{
_skipIndexCheck = skipIndexCheck;
}
public AddIndexToCmsMacroTable()
{
}
public override void Up()
{
Create.Index("IX_cmsMacro_Alias").OnTable("cmsMacro").OnColumn("macroAlias").Unique();
var dbIndexes = _skipIndexCheck ? new DbIndexDefinition[] { } : SqlSyntaxContext.SqlSyntaxProvider.GetDefinedIndexes(Context.Database)
.Select(x => new DbIndexDefinition()
{
TableName = x.Item1,
IndexName = x.Item2,
ColumnName = x.Item3,
IsUnique = x.Item4
}).ToArray();
//make sure it doesn't already exist
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_cmsMacro_Alias")) == false)
{
Create.Index("IX_cmsMacro_Alias").OnTable("cmsMacro").OnColumn("macroAlias").Unique();
}
}
public override void Down()
{
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
Delete.Index("IX_cmsMacro_Alias").OnTable("cmsMacro");
}
}
}
@@ -14,7 +14,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
public override void Down()
{
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
Delete.Column("propertyEditorAlias").FromTable("cmsDataType");
}
}
}
@@ -22,8 +22,8 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
Delete.Column("macroPropertyHidden").FromTable("cmsMacroProperty");
Delete.ForeignKey("FK_cmsMacroProperty_cmsMacroPropertyType_id").OnTable("cmsMacroProperty");
Delete.ForeignKey().FromTable("cmsMacroProperty").ForeignColumn("macroPropertyType").ToTable("cmsMacroPropertyType").PrimaryColumn("id");
Alter.Table("cmsMacroProperty").AddColumn("editorAlias").AsString(255).NotNullable().WithDefaultValue("");
//we need to get the data and create the migration scripts before we change the actual schema bits below!
@@ -52,7 +52,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
public override void Down()
{
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified");
}
}
}
@@ -4,6 +4,8 @@ using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
{
@@ -25,12 +27,28 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
{
//create a new col which we will make a foreign key, but first needs to be populated with data.
Alter.Table("cmsTagRelationship").AddColumn("propertyTypeId").AsInt32().Nullable();
//drop the foreign key on umbracoNode. Must drop foreign key first before primary key can be removed in MySql.
Delete.ForeignKey("FK_cmsTagRelationship_umbracoNode_id").OnTable("cmsTagRelationship");
//we need to drop the primary key
Delete.PrimaryKey("PK_cmsTagRelationship").FromTable("cmsTagRelationship");
Delete.ForeignKey().FromTable("cmsTagRelationship").ForeignColumn("nodeId").ToTable("umbracoNode").PrimaryColumn("id");
//we need to drop the primary key, this is sql specific since MySQL has never had primary keys on this table
// at least since 6.0 and the new installation way but perhaps it had them way back in 4.x so we need to check
// it exists before trying to drop it.
if (Context.CurrentDatabaseProvider == DatabaseProviders.MySql)
{
var constraints = SqlSyntaxContext.SqlSyntaxProvider.GetConstraintsPerColumn(Context.Database).Distinct().ToArray();
//this will let us know if this pk exists on this table
if (constraints.Count(x => x.Item1.InvariantEquals("cmsTagRelationship") && x.Item3.InvariantEquals("PRIMARY")) > 0)
{
Delete.PrimaryKey("PK_cmsTagRelationship").FromTable("cmsTagRelationship");
}
}
else
{
Delete.PrimaryKey("PK_cmsTagRelationship").FromTable("cmsTagRelationship");
}
}
private void Upgrade()
@@ -115,7 +133,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
public override void Down()
{
throw new NotSupportedException();
throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified");
}
/// <summary>
@@ -1,6 +1,9 @@
using System;
using System.Data;
using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
{
@@ -9,6 +12,15 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
{
public override void Up()
{
var dbIndexes = SqlSyntaxContext.SqlSyntaxProvider.GetDefinedIndexes(Context.Database)
.Select(x => new DbIndexDefinition()
{
TableName = x.Item1,
IndexName = x.Item2,
ColumnName = x.Item3,
IsUnique = x.Item4
}).ToArray();
//add a foreign key to the parent id column too!
Create.ForeignKey("FK_cmsTags_cmsTags")
.FromTable("cmsTags")
@@ -16,15 +28,20 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
.ToTable("cmsTags")
.PrimaryColumn("id")
.OnDelete(Rule.None)
.OnUpdate(Rule.None);
.OnUpdate(Rule.None);
//add an index to tag/group since it's queried often
Create.Index("IX_cmsTags").OnTable("cmsTags").OnColumn("tag").Ascending().OnColumn("group").Ascending().WithOptions().NonClustered();
//make sure it doesn't already exist
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_cmsTags")) == false)
{
//add an index to tag/group since it's queried often
Create.Index("IX_cmsTags").OnTable("cmsTags").OnColumn("tag").Ascending().OnColumn("group").Ascending().WithOptions().NonClustered();
}
}
public override void Down()
{
throw new NotImplementedException();
throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified");
}
}
}
@@ -17,7 +17,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
public override void Down()
{
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified");
}
}
}
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
public override void Down()
{
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified");
}
}
}
@@ -13,7 +13,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
public override void Down()
{
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified");
}
}
}
@@ -55,7 +55,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
public override void Down()
{
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified");
}
}
}
@@ -7,6 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Xml;
using System.Xml.Linq;
using Newtonsoft.Json;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
@@ -26,81 +27,86 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
{
if (database != null)
{
try
var dtSql = new Sql().Select("nodeId").From<DataTypeDto>().Where<DataTypeDto>(dto => dto.PropertyEditorAlias == Constants.PropertyEditors.RelatedLinksAlias);
var dataTypeIds = database.Fetch<int>(dtSql);
var propertyData =
database.Fetch<PropertyDataDto>(
"WHERE propertyTypeId in (SELECT id from cmsPropertyType where dataTypeID IN (@dataTypeIds))", new { dataTypeIds = dataTypeIds });
if (!propertyData.Any()) return string.Empty;
var nodesIdsWithProperty = propertyData.Select(x => x.NodeId).Distinct();
var cmsContentXmlEntries = database.Fetch<ContentXmlDto>(
"WHERE nodeId in (@nodeIds)", new { nodeIds = nodesIdsWithProperty });
var propertyTypeIds = propertyData.Select(x => x.PropertyTypeId).Distinct();
var propertyTypes = database.Fetch<PropertyTypeDto>(
"WHERE id in (@propertyTypeIds)", new { propertyTypeIds = propertyTypeIds });
foreach (var data in propertyData)
{
var propertyData =
database.Fetch<PropertyDataDto>(
"WHERE propertyTypeId in (SELECT id from cmsPropertyType where dataTypeID = 1040)");
foreach (var data in propertyData)
if (string.IsNullOrEmpty(data.Text) == false)
{
if (!string.IsNullOrEmpty(data.Text))
//fetch the current data (that's in xml format)
var xml = new XmlDocument();
xml.LoadXml(data.Text);
var links = new List<ExpandoObject>();
//loop all the stored links
foreach (XmlNode node in xml.DocumentElement.ChildNodes)
{
//var cs = ApplicationContext.Current.Services.ContentService;
var title = node.Attributes["title"].Value;
var type = node.Attributes["type"].Value;
var newwindow = node.Attributes["newwindow"].Value.Equals("1") ? true : false;
var lnk = node.Attributes["link"].Value;
//fetch the current data (that's in xml format)
var xml = new XmlDocument();
xml.LoadXml(data.Text);
//create the links in the format the new prop editor expects it to be
var link = new ExpandoObject() as IDictionary<string, Object>;
link.Add("title", title);
link.Add("caption", title);
link.Add("link", lnk);
link.Add("newWindow", newwindow);
link.Add("type", type.Equals("internal") ? "internal" : "external");
link.Add("internal", type.Equals("internal") ? lnk : null);
if (xml != null)
link.Add("edit", false);
link.Add("isInternal", type.Equals("internal"));
links.Add((ExpandoObject)link);
}
//store the serialized data
data.Text = JsonConvert.SerializeObject(links);
database.Update(data);
//now we need to update the cmsContentXml table
var propertyType = propertyTypes.SingleOrDefault(x => x.Id == data.PropertyTypeId);
if (propertyType != null)
{
var xmlItem = cmsContentXmlEntries.SingleOrDefault(x => x.NodeId == data.NodeId);
if (xmlItem != null)
{
var links = new List<ExpandoObject>();
//loop all the stored links
foreach (XmlNode node in xml.DocumentElement.ChildNodes)
var x = XElement.Parse(xmlItem.Xml);
var prop = x.Element(propertyType.Alias);
if (prop != null)
{
var title = node.Attributes["title"].Value;
var type = node.Attributes["type"].Value;
var newwindow = node.Attributes["newwindow"].Value.Equals("1") ? true : false;
var lnk = node.Attributes["link"].Value;
//create the links in the format the new prop editor expects it to be
var link = new ExpandoObject() as IDictionary<string, Object>;
link.Add("title", title);
link.Add("caption", title);
link.Add("link", lnk);
link.Add("newWindow", newwindow);
link.Add("type", type.Equals("internal") ? "internal" : "external");
link.Add("internal", type.Equals("internal") ? lnk : null);
link.Add("edit", false);
link.Add("isInternal", type.Equals("internal"));
//try
//{
// if (type.Equals("internal"))
// {
// int nodeId;
// if (int.TryParse(lnk, out nodeId))
// link.Add("internalName", cs.GetById(nodeId).Name);
// }
//}
//catch (Exception ex)
//{
// LogHelper.Error<UpdateRelatedLinksData>("Exception was thrown when trying to update related links property data, fetching internal node id", ex);
//}
links.Add((ExpandoObject) link);
prop.ReplaceAll(new XCData(data.Text));
database.Update(xmlItem);
}
//store the serialized data
data.Text = JsonConvert.SerializeObject(links);
database.Update(data);
}
}
}
}
catch (Exception ex)
{
LogHelper.Error<UpdateRelatedLinksData>("Exception was thrown when trying to update related links property data", ex);
}
}
return string.Empty;
}
public override void Down()
{
throw new NotImplementedException();
throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified");
}
}
}
@@ -0,0 +1,38 @@
using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenOneZero
{
//see: http://issues.umbraco.org/issue/U4-4430 - Except this one is specific to 7 because
// we've modified the tagRelationship PK already.
//We have to target this specifically however to ensure this DOES NOT execute if upgrading from a version previous to 7.0,
// this is because when the 7.0.0 migrations are executed, this primary key get's created so if this migration is also executed
// we will get exceptions because it is trying to create the PK two times.
[Migration("7.0.0", "7.1.0", 0, GlobalSettings.UmbracoMigrationName)]
public class AssignMissingPrimaryForMySqlKeys : MigrationBase
{
public override void Up()
{
if (Context.CurrentDatabaseProvider == DatabaseProviders.MySql)
{
var constraints = SqlSyntaxContext.SqlSyntaxProvider.GetConstraintsPerColumn(Context.Database).Distinct().ToArray();
//This should be 3 because this table has 3 keys
if (constraints.Count(x => x.Item1.InvariantEquals("cmsTagRelationship") && x.Item3.InvariantEquals("PRIMARY")) == 0)
{
Create.PrimaryKey("PK_cmsTagRelationship")
.OnTable("cmsTagRelationship")
.Columns(new[] { "nodeId", "propertyTypeId", "tagId" });
}
}
}
public override void Down()
{
//don't do anything, these keys should have always existed!
}
}
}
@@ -2,6 +2,7 @@
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix
{
[Migration("6.0.0", 10, GlobalSettings.UmbracoMigrationName)]
public class DeleteAppTables : MigrationBase
{
@@ -14,6 +15,8 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix
public override void Down()
{
//This cannot be rolled back!!
throw new DataLossException("Cannot rollback migration " + typeof(DeleteAppTables) + " the db tables umbracoAppTree and umbracoApp have been droppped");
}
}
}
@@ -10,15 +10,15 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix
{
Alter.Table("cmsPropertyTypeGroup").AddColumn("parentGroupId").AsInt16().Nullable();
Create.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup")
Create.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id")
.FromTable("cmsPropertyTypeGroup").ForeignColumn("parentGroupId")
.ToTable("cmsPropertyTypeGroup").PrimaryColumn("id").OnDeleteOrUpdate(Rule.None);
}
public override void Down()
{
Delete.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup").OnTable("cmsPropertyTypeGroup");
Delete.ForeignKey().FromTable("cmsPropertyTypeGroup").ForeignColumn("parentGroupId").ToTable("cmsPropertyTypeGroup").PrimaryColumn("id");
Delete.Column("parentGroupId").FromTable("cmsPropertyTypeGroup");
}
}
@@ -13,11 +13,13 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixOneZero
{
public override void Up()
{
base.Context.Database.CreateTable<ServerRegistrationDto>();
//NOTE: This isn't the correct way to do this but to manually create this table with the Create syntax is a pain in the arse
Context.Database.CreateTable<ServerRegistrationDto>();
}
public override void Down()
{
Delete.Table("umbracoServer");
}
}
}
@@ -4,7 +4,8 @@ using Umbraco.Core.Models.Rdbms;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero
{
[Migration("6.2.0", 1, GlobalSettings.UmbracoMigrationName)]
[Migration("7.1.0", 3, GlobalSettings.UmbracoMigrationName)]
[Migration("6.2.0", 3, GlobalSettings.UmbracoMigrationName)]
public class AddChangeDocumentTypePermission : MigrationBase
{
public override void Up()
@@ -1,37 +1,65 @@
using System;
using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Migrations.Initial;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero
{
[Migration("6.2.0", 0, GlobalSettings.UmbracoMigrationName)]
[Migration("7.1.0", 1, GlobalSettings.UmbracoMigrationName)]
[Migration("6.2.0", 1, GlobalSettings.UmbracoMigrationName)]
public class AdditionalIndexesAndKeys : MigrationBase
{
public override void Up()
{
Create.Index("IX_umbracoNodeTrashed").OnTable("umbracoNode").OnColumn("trashed").Ascending().WithOptions().NonClustered();
Create.Index("IX_cmsContentVersion_ContentId").OnTable("cmsContentVersion").OnColumn("ContentId").Ascending().WithOptions().NonClustered();
Create.Index("IX_cmsDocument_published").OnTable("cmsDocument").OnColumn("published").Ascending().WithOptions().NonClustered();
Create.Index("IX_cmsDocument_newest").OnTable("cmsDocument").OnColumn("newest").Ascending().WithOptions().NonClustered();
{
var dbIndexes = SqlSyntaxContext.SqlSyntaxProvider.GetDefinedIndexes(Context.Database)
.Select(x => new DbIndexDefinition()
{
TableName = x.Item1,
IndexName = x.Item2,
ColumnName = x.Item3,
IsUnique = x.Item4
}).ToArray();
//do not create any indexes if they already exist in the database
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_umbracoNodeTrashed")) == false)
{
Create.Index("IX_umbracoNodeTrashed").OnTable("umbracoNode").OnColumn("trashed").Ascending().WithOptions().NonClustered();
}
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_cmsContentVersion_ContentId")) == false)
{
Create.Index("IX_cmsContentVersion_ContentId").OnTable("cmsContentVersion").OnColumn("ContentId").Ascending().WithOptions().NonClustered();
}
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_cmsDocument_published")) == false)
{
Create.Index("IX_cmsDocument_published").OnTable("cmsDocument").OnColumn("published").Ascending().WithOptions().NonClustered();
}
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_cmsDocument_newest")) == false)
{
Create.Index("IX_cmsDocument_newest").OnTable("cmsDocument").OnColumn("newest").Ascending().WithOptions().NonClustered();
}
//we want to drop the umbracoUserLogins_Index index since it is named incorrectly and then re-create it so
// it follows the standard naming convention
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("umbracoUserLogins_Index")))
{
Delete.Index("umbracoUserLogins_Index").OnTable("umbracoUserLogins");
}
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_umbracoUserLogins_Index")) == false)
{
Create.Index("IX_umbracoUserLogins_Index").OnTable("umbracoUserLogins").OnColumn("contextID").Ascending().WithOptions().Clustered();
}
}
public override void Down()
{
throw new NotImplementedException();
}
}
[Migration("6.2.0", 2, GlobalSettings.UmbracoMigrationName)]
public class ChangePasswordColumn : MigrationBase
{
public override void Up()
{
//up to 500 chars
Alter.Table("umbracoUser").AlterColumn("userPassword").AsString(500).NotNullable();
}
public override void Down()
{
throw new NotImplementedException();
Delete.Index("IX_umbracoNodeTrashed").OnTable("umbracoNode");
Delete.Index("IX_cmsContentVersion_ContentId").OnTable("cmsContentVersion");
Delete.Index("IX_cmsDocument_published").OnTable("cmsDocument");
Delete.Index("IX_cmsDocument_newest").OnTable("cmsDocument");
}
}
}
@@ -0,0 +1,90 @@
using System.Linq;
using System.Web.UI;
using Umbraco.Core.Configuration;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero
{
//see: http://issues.umbraco.org/issue/U4-4430
[Migration("7.1.0", 0, GlobalSettings.UmbracoMigrationName)]
[Migration("6.2.0", 0, GlobalSettings.UmbracoMigrationName)]
public class AssignMissingPrimaryForMySqlKeys : MigrationBase
{
public override void Up()
{
if (Context.CurrentDatabaseProvider == DatabaseProviders.MySql)
{
var constraints = SqlSyntaxContext.SqlSyntaxProvider.GetConstraintsPerColumn(Context.Database).Distinct().ToArray();
//This should be 2 because this table has 2 keys
if (constraints.Count(x => x.Item1.InvariantEquals("cmsContentType2ContentType") && x.Item3.InvariantEquals("PRIMARY")) == 0)
{
Create.PrimaryKey("PK_cmsContentType2ContentType")
.OnTable("cmsContentType2ContentType")
.Columns(new[] {"parentContentTypeId", "childContentTypeId"});
}
//This should be 2 because this table has 2 keys
if (constraints.Count(x => x.Item1.InvariantEquals("cmsContentTypeAllowedContentType") && x.Item3.InvariantEquals("PRIMARY")) == 0)
{
Create.PrimaryKey("PK_cmsContentTypeAllowedContentType")
.OnTable("cmsContentTypeAllowedContentType")
.Columns(new[] { "Id", "AllowedId" });
}
//This should be 2 because this table has 2 keys
if (constraints.Count(x => x.Item1.InvariantEquals("cmsDocumentType") && x.Item3.InvariantEquals("PRIMARY")) == 0)
{
Create.PrimaryKey("PK_cmsDocumentType")
.OnTable("cmsDocumentType")
.Columns(new[] { "contentTypeNodeId", "templateNodeId" });
}
//This should be 2 because this table has 2 keys
if (constraints.Count(x => x.Item1.InvariantEquals("cmsMember2MemberGroup") && x.Item3.InvariantEquals("PRIMARY")) == 0)
{
Create.PrimaryKey("PK_cmsMember2MemberGroup")
.OnTable("cmsMember2MemberGroup")
.Columns(new[] { "Member", "MemberGroup" });
}
//This should be 2 because this table has 2 keys
if (constraints.Count(x => x.Item1.InvariantEquals("cmsPreviewXml") && x.Item3.InvariantEquals("PRIMARY")) == 0)
{
Create.PrimaryKey("PK_cmsContentPreviewXml")
.OnTable("cmsPreviewXml")
.Columns(new[] { "nodeId", "versionId" });
}
//This should be 2 because this table has 2 keys
if (constraints.Count(x => x.Item1.InvariantEquals("umbracoUser2app") && x.Item3.InvariantEquals("PRIMARY")) == 0)
{
Create.PrimaryKey("PK_user2app")
.OnTable("umbracoUser2app")
.Columns(new[] { "user", "app" });
}
//This should be 2 because this table has 3 keys
if (constraints.Count(x => x.Item1.InvariantEquals("umbracoUser2NodeNotify") && x.Item3.InvariantEquals("PRIMARY")) == 0)
{
Create.PrimaryKey("PK_umbracoUser2NodeNotify")
.OnTable("umbracoUser2NodeNotify")
.Columns(new[] { "userId", "nodeId", "action" });
}
//This should be 2 because this table has 3 keys
if (constraints.Count(x => x.Item1.InvariantEquals("umbracoUser2NodePermission") && x.Item3.InvariantEquals("PRIMARY")) == 0)
{
Create.PrimaryKey("PK_umbracoUser2NodePermission")
.OnTable("umbracoUser2NodePermission")
.Columns(new[] { "userId", "nodeId", "permission" });
}
}
}
public override void Down()
{
//don't do anything, these keys should have always existed!
}
}
}
@@ -0,0 +1,22 @@
using System;
using Umbraco.Core.Configuration;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero
{
[Migration("7.1.0", 2, GlobalSettings.UmbracoMigrationName)]
[Migration("6.2.0", 2, GlobalSettings.UmbracoMigrationName)]
public class ChangePasswordColumn : MigrationBase
{
public override void Up()
{
//up to 500 chars
Alter.Table("umbracoUser").AlterColumn("userPassword").AsString(500).NotNullable();
}
public override void Down()
{
//back to 125 chars
Alter.Table("umbracoUser").AlterColumn("userPassword").AsString(125).NotNullable();
}
}
}
@@ -1,20 +1,13 @@
using System;
using System.Collections.Generic;
using System.Deployment.Internal;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Xml;
using Newtonsoft.Json;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Rdbms;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenOne
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero
{
[Migration("7.1.0", 1, GlobalSettings.UmbracoMigrationName)]
[Migration("7.1.0", 4, GlobalSettings.UmbracoMigrationName)]
[Migration("6.2.0", 4, GlobalSettings.UmbracoMigrationName)]
public class UpdateToNewMemberPropertyAliases : MigrationBase
{
public override void Up()
@@ -39,13 +32,17 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenOne
{"umbracoFailedPasswordAttemptsPropertyTypeAlias", Constants.Conventions.Member.FailedPasswordAttempts}
};
//This query is structured to work with MySql, SQLCE and SqlServer:
// http://issues.umbraco.org/issue/U4-3876
const string propertyTypeUpdateSql = @"UPDATE cmsPropertyType
SET Alias = @newAlias
WHERE Alias = @oldAlias AND contentTypeId IN (
SELECT DISTINCT cmsContentType.nodeId FROM cmsPropertyType
SELECT nodeId FROM (SELECT DISTINCT cmsContentType.nodeId FROM cmsPropertyType
INNER JOIN cmsContentType ON cmsPropertyType.contentTypeId = cmsContentType.nodeId
INNER JOIN umbracoNode ON cmsContentType.nodeId = umbracoNode.id
WHERE umbracoNode.nodeObjectType = @objectType)";
WHERE umbracoNode.nodeObjectType = @objectType) x)";
const string xmlSelectSql = @"SELECT cmsContentXml.* FROM cmsContentXml
INNER JOIN umbracoNode ON cmsContentXml.nodeId = umbracoNode.id
@@ -63,7 +60,7 @@ WHERE umbracoNode.nodeObjectType = @objectType";
}
//Update all of the XML
var items = database.Fetch<ContentXmlDto>(xmlSelectSql, new {objectType = Constants.ObjectTypes.Member});
var items = database.Fetch<ContentXmlDto>(xmlSelectSql, new { objectType = Constants.ObjectTypes.Member });
foreach (var item in items)
{
foreach (var map in aliasMap)
@@ -80,10 +77,10 @@ WHERE umbracoNode.nodeObjectType = @objectType";
{
LogHelper.Error<UpdateToNewMemberPropertyAliases>("Exception was thrown when trying to upgrade old member aliases to the new ones", ex);
throw;
}
}
}
}
return string.Empty;
}
@@ -37,7 +37,8 @@ namespace Umbraco.Core.Persistence
var tableNameAttribute = type.FirstAttribute<TableNameAttribute>();
string tableName = tableNameAttribute == null ? string.Empty : tableNameAttribute.Value;
var syntax = string.Format("{0}.{1}",
//need to ensure the order by is in brackets, see: https://github.com/toptensoftware/PetaPoco/issues/177
var syntax = string.Format("({0}.{1})",
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedTableName(tableName),
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumnName(columnName));
@@ -9,6 +9,41 @@ namespace Umbraco.Core.Persistence.Querying
/// </summary>
internal class BaseExpressionHelper
{
protected string HandleStringComparison(string col, string val, string verb, TextColumnType columnType)
{
switch (verb)
{
case "SqlWildcard":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnWildcardComparison(col, RemoveQuote(val), columnType);
case "Equals":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnEqualComparison(col, RemoveQuote(val), columnType);
case "StartsWith":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnStartsWithComparison(col, RemoveQuote(val), columnType);
case "EndsWith":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnEndsWithComparison(col, RemoveQuote(val), columnType);
case "Contains":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnContainsComparison(col, RemoveQuote(val), columnType);
case "InvariantEquals":
case "SqlEquals":
//recurse
return HandleStringComparison(col, val, "Equals", columnType);
case "InvariantStartsWith":
case "SqlStartsWith":
//recurse
return HandleStringComparison(col, val, "StartsWith", columnType);
case "InvariantEndsWith":
case "SqlEndsWith":
//recurse
return HandleStringComparison(col, val, "EndsWith", columnType);
case "InvariantContains":
case "SqlContains":
//recurse
return HandleStringComparison(col, val, "Contains", columnType);
default:
throw new ArgumentOutOfRangeException("verb");
}
}
public virtual string GetQuotedValue(object value, Type fieldType, Func<object, string> escapeCallback = null, Func<Type, bool> shouldQuoteCallback = null)
{
if (value == null) return "NULL";
@@ -227,41 +227,6 @@ namespace Umbraco.Core.Persistence.Querying
}
private string HandleStringComparison(string col, string val, string verb, TextColumnType columnType)
{
switch (verb)
{
case "SqlWildcard":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnWildcardComparison(col, RemoveQuote(val), columnType);
case "Equals":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnEqualComparison(col, RemoveQuote(val), columnType);
case "StartsWith":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnStartsWithComparison(col, RemoveQuote(val), columnType);
case "EndsWith":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnEndsWithComparison(col, RemoveQuote(val), columnType);
case "Contains":
return SqlSyntaxContext.SqlSyntaxProvider.GetStringColumnContainsComparison(col, RemoveQuote(val), columnType);
case "InvariantEquals":
case "SqlEquals":
//recurse
return HandleStringComparison(col, val, "Equals", columnType);
case "InvariantStartsWith":
case "SqlStartsWith":
//recurse
return HandleStringComparison(col, val, "StartsWith", columnType);
case "InvariantEndsWith":
case "SqlEndsWith":
//recurse
return HandleStringComparison(col, val, "EndsWith", columnType);
case "InvariantContains":
case "SqlContains":
//recurse
return HandleStringComparison(col, val, "Contains", columnType);
default:
throw new ArgumentOutOfRangeException("verb");
}
}
protected virtual string VisitMethodCall(MethodCallExpression m)
{
List<Object> args = this.VisitExpressionList(m.Arguments);
@@ -253,12 +253,31 @@ namespace Umbraco.Core.Persistence.Querying
return string.Format("upper({0})", r);
case "ToLower":
return string.Format("lower({0})", r);
case "SqlWildcard":
case "StartsWith":
return string.Format("upper({0}) like '{1}%'", r, RemoveQuote(args[0].ToString().ToUpper()));
case "EndsWith":
return string.Format("upper({0}) like '%{1}'", r, RemoveQuote(args[0].ToString()).ToUpper());
case "Contains":
return string.Format("upper({0}) like '%{1}%'", r, RemoveQuote(args[0].ToString()).ToUpper());
case "Equals":
case "SqlStartsWith":
case "SqlEndsWith":
case "SqlContains":
case "SqlEquals":
case "InvariantStartsWith":
case "InvariantEndsWith":
case "InvariantContains":
case "InvariantEquals":
//default
var colType = TextColumnType.NVarchar;
//then check if this arg has been passed in
if (m.Arguments.Count > 1)
{
var colTypeArg = m.Arguments.FirstOrDefault(x => x is ConstantExpression && x.Type == typeof(TextColumnType));
if (colTypeArg != null)
{
colType = (TextColumnType)((ConstantExpression)colTypeArg).Value;
}
}
return HandleStringComparison(r.ToString(), args[0].ToString(), m.Method.Name, colType);
case "Substring":
var startIndex = Int32.Parse(args[0].ToString()) + 1;
if (args.Count == 2)
@@ -433,7 +433,7 @@ namespace Umbraco.Core.Persistence.Repositories
}
else
{
//In order to update the ContentVersion we need to retreive its primary key id
//In order to update the ContentVersion we need to retrieve its primary key id
var contentVerDto = Database.SingleOrDefault<ContentVersionDto>("WHERE VersionId = @Version", new { Version = entity.Version });
contentVersionDto.Id = contentVerDto.Id;
@@ -638,4 +638,4 @@ namespace Umbraco.Core.Persistence.Repositories
return currentName;
}
}
}
}
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
@@ -11,6 +12,7 @@ using Umbraco.Core.Persistence.Caching;
using Umbraco.Core.Persistence.Factories;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Persistence.Relators;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Persistence.UnitOfWork;
namespace Umbraco.Core.Persistence.Repositories
@@ -63,6 +65,17 @@ namespace Umbraco.Core.Persistence.Repositories
protected void PersistNewBaseContentType(ContentTypeDto dto, IContentTypeComposition entity)
{
//Cannot add a duplicate content type type
var exists = Database.ExecuteScalar<int>(@"SELECT COUNT(*) FROM cmsContentType
INNER JOIN umbracoNode ON cmsContentType.nodeId = umbracoNode.id
WHERE cmsContentType." + SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumnName("alias") + @"= @alias
AND umbracoNode.nodeObjectType = @objectType",
new { alias = entity.Alias, objectType = NodeObjectTypeId });
if (exists > 0)
{
throw new DuplicateNameException("An item with the alias " + entity.Alias + " already exists");
}
//Logic for setting Path, Level and SortOrder
var parent = Database.First<NodeDto>("WHERE id = @ParentId", new { ParentId = entity.ParentId });
int level = parent.Level + 1;
@@ -165,6 +178,19 @@ namespace Umbraco.Core.Persistence.Repositories
protected void PersistUpdatedBaseContentType(ContentTypeDto dto, IContentTypeComposition entity)
{
//Cannot update to a duplicate alias
var exists = Database.ExecuteScalar<int>(@"SELECT COUNT(*) FROM cmsContentType
INNER JOIN umbracoNode ON cmsContentType.nodeId = umbracoNode.id
WHERE cmsContentType." + SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumnName("alias") + @"= @alias
AND umbracoNode.nodeObjectType = @objectType
AND umbracoNode.id <> @id",
new { id = dto.NodeId, alias = entity.Alias, objectType = NodeObjectTypeId });
if (exists > 0)
{
throw new DuplicateNameException("An item with the alias " + entity.Alias + " already exists");
}
var propertyGroupFactory = new PropertyGroupFactory(entity.Id);
var nodeDto = dto.NodeDto;
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Linq;
using Umbraco.Core.Models;
@@ -8,6 +9,7 @@ using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.Caching;
using Umbraco.Core.Persistence.Factories;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Persistence.UnitOfWork;
namespace Umbraco.Core.Persistence.Repositories
@@ -119,6 +121,15 @@ namespace Umbraco.Core.Persistence.Repositories
{
((DataTypeDefinition)entity).AddingEntity();
//Cannot add a duplicate data type
var exists = Database.ExecuteScalar<int>(@"SELECT COUNT(*) FROM cmsDataType
INNER JOIN umbracoNode ON cmsDataType.nodeId = umbracoNode.id
WHERE umbracoNode." + SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumnName("text") + "= @name", new {name = entity.Name});
if (exists > 0)
{
throw new DuplicateNameException("A data type with the name " + entity.Name + " already exists");
}
var factory = new DataTypeDefinitionFactory(NodeObjectTypeId);
var dto = factory.BuildDto(entity);
@@ -154,6 +165,18 @@ namespace Umbraco.Core.Persistence.Repositories
protected override void PersistUpdatedItem(IDataTypeDefinition entity)
{
//Cannot change to a duplicate alias
var exists = Database.ExecuteScalar<int>(@"SELECT COUNT(*) FROM cmsDataType
INNER JOIN umbracoNode ON cmsDataType.nodeId = umbracoNode.id
WHERE umbracoNode." + SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumnName("text") + @"= @name
AND umbracoNode.id <> @id",
new { id = entity.Id, name = entity.Name });
if (exists > 0)
{
throw new DuplicateNameException("A data type with the name " + entity.Name + " already exists");
}
//Updates Modified date and Version Guid
((DataTypeDefinition)entity).UpdatingEntity();
@@ -50,6 +50,8 @@ namespace Umbraco.Core.Persistence.Repositories
foreach (var textDto in dto.LanguageTextDtos)
{
var language = _languageRepository.Get(textDto.LanguageId);
if (language == null)
continue;
var translationFactory = new DictionaryTranslationFactory(dto.UniqueId, language);
list.Add(translationFactory.BuildEntity(textDto));
}
@@ -50,5 +50,9 @@ namespace Umbraco.Core.Persistence.Repositories
/// <returns></returns>
IEnumerable<IMember> GetPagedResultsByQuery(IQuery<IMember> query, int pageIndex, int pageSize, out int totalRecords, Expression<Func<IMember, string>> orderBy);
IEnumerable<IMember> GetPagedResultsByQuery<TDto>(
Sql sql, int pageIndex, int pageSize, out int totalRecords,
Func<IEnumerable<TDto>, int[]> resolveIds);
}
}
@@ -33,7 +33,7 @@ namespace Umbraco.Core.Persistence.Repositories
var sql = GetBaseQuery(false);
sql.Where(GetBaseWhereClause(), new { Id = id });
var languageDto = Database.First<LanguageDto>(sql);
var languageDto = Database.FirstOrDefault<LanguageDto>(sql);
if (languageDto == null)
return null;
@@ -299,7 +299,7 @@ namespace Umbraco.Core.Persistence.Repositories
Database.Update(newContentDto);
}
//In order to update the ContentVersion we need to retreive its primary key id
//In order to update the ContentVersion we need to retrieve its primary key id
var contentVerDto = Database.SingleOrDefault<ContentVersionDto>("WHERE VersionId = @Version", new { Version = entity.Version });
dto.Id = contentVerDto.Id;
//Updates the current version - cmsContentVersion
@@ -403,4 +403,4 @@ namespace Umbraco.Core.Persistence.Repositories
return currentName;
}
}
}
}
@@ -121,10 +121,11 @@ namespace Umbraco.Core.Persistence.Repositories
var dto = _modelFactory.BuildDto(group);
var o = Database.IsNew(dto) ? Convert.ToInt32(Database.Insert(dto)) : Database.Update(dto);
//Update with new correct path
//Update with new correct path and id
dto.Path = string.Concat("-1,", dto.NodeId);
Database.Update(dto);
//assign to entity
group.Id = o;
group.ResetDirtyProperties();
}
@@ -310,7 +310,7 @@ namespace Umbraco.Core.Persistence.Repositories
Database.Update(newContentDto);
}
//In order to update the ContentVersion we need to retreive its primary key id
//In order to update the ContentVersion we need to retrieve its primary key id
var contentVerDto = Database.SingleOrDefault<ContentVersionDto>("WHERE VersionId = @Version", new { Version = entity.Version });
dto.ContentVersionDto.Id = contentVerDto.Id;
//Updates the current version - cmsContentVersion
@@ -318,7 +318,10 @@ namespace Umbraco.Core.Persistence.Repositories
Database.Update(dto.ContentVersionDto);
//Updates the cmsMember entry if it has changed
//NOTE: these cols are the REAL column names in the db
var changedCols = new List<string>();
if (dirtyEntity.IsPropertyDirty("Email"))
{
changedCols.Add("Email");
@@ -328,7 +331,7 @@ namespace Umbraco.Core.Persistence.Repositories
changedCols.Add("LoginName");
}
// DO NOT update the password if it is null or empty
if (dirtyEntity.IsPropertyDirty("Password") && entity.Password.IsNullOrWhiteSpace() == false)
if (dirtyEntity.IsPropertyDirty("RawPasswordValue") && entity.RawPasswordValue.IsNullOrWhiteSpace() == false)
{
changedCols.Add("Password");
}
@@ -565,7 +568,6 @@ namespace Umbraco.Core.Persistence.Repositories
resultQuery = sql;
}
//get the referenced column name
var expressionMember = ExpressionHelper.GetMemberInfo(orderBy);
//now find the mapped column name
@@ -577,8 +579,19 @@ namespace Umbraco.Core.Persistence.Repositories
}
//need to ensure the order by is in brackets, see: https://github.com/toptensoftware/PetaPoco/issues/177
resultQuery.OrderBy(string.Format("({0})", mappedField));
var result = GetPagedResultsByQuery<MemberDto>(resultQuery, pageIndex, pageSize, out totalRecords,
dtos => dtos.Select(x => x.NodeId).ToArray());
//now we need to ensure this result is also ordered by the same order by clause
return result.OrderBy(orderBy.Compile());
}
var pagedResult = Database.Page<MemberDto>(pageIndex + 1, pageSize, resultQuery);
public IEnumerable<IMember> GetPagedResultsByQuery<TDto>(
Sql sql, int pageIndex, int pageSize, out int totalRecords,
Func<IEnumerable<TDto>, int[]> resolveIds)
{
var pagedResult = Database.Page<TDto>(pageIndex + 1, pageSize, sql);
totalRecords = Convert.ToInt32(pagedResult.TotalItems);
@@ -587,10 +600,7 @@ namespace Umbraco.Core.Persistence.Repositories
{
return Enumerable.Empty<IMember>();
}
var result = GetAll(pagedResult.Items.Select(x => x.NodeId).ToArray());
//now we need to ensure this result is also ordered by the same order by clause
return result.OrderBy(orderBy.Compile());
return GetAll(resolveIds(pagedResult.Items)).ToArray();
}
private IMember BuildFromDto(List<MemberReadOnlyDto> dtos)
@@ -636,4 +646,4 @@ namespace Umbraco.Core.Persistence.Repositories
return entities;
}
}
}
}
@@ -166,8 +166,10 @@ namespace Umbraco.Core.Persistence.Repositories
protected override void PersistNewItem(IMemberType entity)
{
((MemberType)entity).AddingEntity();
ValidateAlias(entity);
((MemberType)entity).AddingEntity();
//By Convention we add 9 stnd PropertyTypes to an Umbraco MemberType
entity.AddPropertyGroup(Constants.Conventions.Member.StandardPropertiesGroupName);
var standardPropertyTypes = Constants.Conventions.Member.GetStandardPropertyTypeStubs();
@@ -223,8 +223,19 @@ namespace Umbraco.Core.Persistence.Repositories
/// <param name="entity"></param>
public virtual void PersistNewItem(IEntity entity)
{
PersistNewItem((TEntity)entity);
_cache.Save(typeof(TEntity), entity);
try
{
PersistNewItem((TEntity)entity);
_cache.Save(typeof(TEntity), entity);
}
catch (Exception)
{
//if an exception is thrown we need to remove the entry from cache, this is ONLY a work around because of the way
// that we cache entities: http://issues.umbraco.org/issue/U4-4259
_cache.Delete(typeof (TEntity), entity);
throw;
}
}
/// <summary>
@@ -233,8 +244,19 @@ namespace Umbraco.Core.Persistence.Repositories
/// <param name="entity"></param>
public virtual void PersistUpdatedItem(IEntity entity)
{
PersistUpdatedItem((TEntity)entity);
_cache.Save(typeof(TEntity), entity);
try
{
PersistUpdatedItem((TEntity)entity);
_cache.Save(typeof(TEntity), entity);
}
catch (Exception)
{
//if an exception is thrown we need to remove the entry from cache, this is ONLY a work around because of the way
// that we cache entities: http://issues.umbraco.org/issue/U4-4259
_cache.Delete(typeof (TEntity), entity);
throw;
}
}
/// <summary>
@@ -83,6 +83,27 @@ namespace Umbraco.Core.Persistence.Repositories
return nodeDto == null ? 0 : nodeDto.NodeId;
}
//This should be used later to do GetAll properly without individual selections
private IEnumerable<Tuple<int, string>> GetStylesheetIds(string[] paths)
{
var sql = new Sql()
.Select("*")
.From<NodeDto>()
.Where("nodeObjectType = @NodeObjectType AND umbracoNode.text in (@aliases)",
new
{
NodeObjectType = UmbracoObjectTypes.Stylesheet.GetGuid(),
aliases = paths.Select(x => x.TrimEnd(".css").Replace("\\", "/")).ToArray()
});
var dtos = _dbwork.Database.Fetch<NodeDto>(sql);
return dtos.Select(x => new Tuple<int, string>(
//the id
x.NodeId,
//the original path requested for the id
paths.First(p => p.TrimEnd(".css").Replace("\\", "/") == x.Text)));
}
public override IEnumerable<Stylesheet> GetAll(params string[] ids)
{
if (ids.Any())

Some files were not shown because too many files have changed in this diff Show More