Compare commits

...

726 Commits

Author SHA1 Message Date
swcs 2410d2c86c overlay "target"-positioning updates correctly on content changes and container resize 2019-09-02 20:33:44 +02:00
Poornima Nayar 157c0a2479 Added Review process file 2019-09-02 10:27:29 +02:00
Poornima Nayar 3d3a836c52 fix to the documentation link in create packages opening in same window 2019-09-02 10:17:19 +02:00
Kasper Christensen 24efa54481 Loginpage: Added an id to input fields and a for attr on the la… (#6247) 2019-09-02 10:00:44 +02:00
Mads Krohn 1bf85ab1db Correctly html encode text (#6235) 2019-09-02 08:46:33 +02:00
christophnz 1d94c4b9bb Fixed returntype of IPublishedContent.Siblings<T> to be IEnumerable<T> rather than IEnumerable<IPublishedContent> 2019-08-30 14:27:13 +02:00
Poornima Nayar 13e704e36c Fix- Unable to create members in the members section using the create option in the overlay 2019-08-30 08:50:15 +02:00
Bjarne Fyrstenborg 413b266335 v8: Replace tree loader with umbLoader component (#6169) 2019-08-29 14:36:51 +02:00
Kenn Jacobsen 7cb0886b35 Prevent markdown editor from stealing input focus on enter 2019-08-29 14:32:40 +02:00
Kenn Jacobsen d0e7344e2d Prevent double click errors when editing compositions 2019-08-29 14:30:10 +02:00
Andy Butland 8fdc14f360 Added metadata indicating if document published for content picker display 2019-08-29 14:27:31 +02:00
Sean McLemon 915b24e4e4 When deciding whether to use SSL, ApplicationUrlHelper.GetApplicationUrlFromCurrentRequest() has an expression port == "443" which is always false. The variable port is set to to either "" or ":" + request.ServerVariables["SERVER_PORT"], so it might sometimes be ":443" but it will never be just "443". This code has been this way for at least a year, and I don't know if the situation it tried to handle makes any sense (using port 443 over plain HTTP, for some reason??) so I've just removed it. 2019-08-29 14:26:16 +02:00
Callum Whyte a24e5bd10c Correcting ASCII art in README (#6156) 2019-08-29 14:22:21 +02:00
Kenn Jacobsen 3457018fb4 Don't use a hardcoded "image" type in media picker value conversion 2019-08-29 14:20:03 +02:00
Kenn Jacobsen bfc87922cb Make sure the empty search result is visible for list views 2019-08-29 14:13:43 +02:00
Steve Megson 09def9f352 Migration of MarkdownEditor prevalues 2019-08-29 14:12:32 +02:00
Steve Megson 934e2066a0 #6158 - missing media folders after migration 2019-08-29 14:09:19 +02:00
stevemegson b254b4fcda V8: Indexing of grid values containing JSON (#6201) 2019-08-29 14:06:59 +02:00
jmayntzhusen 4dad427a64 Improve error messages (#6154) 2019-08-29 14:01:30 +02:00
Steve Megson 9e1424fb24 RefactorMacroColumns 2019-08-29 13:58:43 +02:00
Kenn Jacobsen ad978c60df V8: Use a standard confirm dialog when removing content type compositions (#6213) 2019-08-29 13:51:55 +02:00
Kenn Jacobsen dfe96dccde Use a pointer cursor for selectable items in mini listviews 2019-08-29 13:50:37 +02:00
Poornima Nayar 981519eac0 Added contribution guidelines file
which was otherwise leading to a 404 from the Contributing.md file (#6197)
2019-08-29 13:49:26 +02:00
Kenn Jacobsen 16ab7b70cf V8: Add confirmation when deleting content and media (#6005) 2019-08-29 13:44:38 +02:00
Sebastiaan Janssen b2093e6dfa Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/itempicker/itempicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/itempicker/itempicker.html
#	src/Umbraco.Web.UI.Client/src/views/content/content.delete.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/delete.html
#	src/Umbraco.Web.UI.Client/src/views/media/delete.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js
#	src/Umbraco.Web.UI/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
2019-08-29 13:44:09 +02:00
Kenn Jacobsen 3f8dffee3f V7: Add confirmation when deleting content and media (#6004) 2019-08-29 13:41:34 +02:00
Kenn Jacobsen 204a9c9d53 Make sure Nested Content blueprints are listed in defined sort order 2019-08-29 13:37:45 +02:00
Kenn Jacobsen 531dee1e75 Ensure correct icon for file types in search results 2019-08-29 13:34:01 +02:00
Sebastiaan Janssen 297e054381 Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
#	src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
2019-08-29 13:33:42 +02:00
Kenn Jacobsen e9eecb2031 Ensure correct icon for file types in search results 2019-08-29 13:31:18 +02:00
Sebastiaan Janssen 4f289a222f Merge remote-tracking branch 'origin/v7/7.15' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
2019-08-29 13:30:14 +02:00
Matt Brailsford e92631c623 Fixed #5907 by reloading content on bulk publish / unpublish
Fixes #5907

(cherry picked from commit 93bb75511b)
2019-08-29 13:26:41 +02:00
Matt Brailsford 93bb75511b Fixed #5907 by reloading content on bulk publish / unpublish
Fixes #5907
2019-08-29 13:25:56 +02:00
Sebastiaan Janssen 5d9e1087f4 Cherry pick 851a2a3de8 2019-08-29 13:03:48 +02:00
Sebastiaan Janssen 0308c8096e Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html
2019-08-29 12:59:56 +02:00
Sebastiaan Janssen 02469f110f Merge branch 'v7/7.15' into v7/dev 2019-08-29 12:58:36 +02:00
Warren Buckley 851a2a3de8 Simplify svg check and make it a proper a href again. 2019-08-29 12:56:53 +02:00
Sebastiaan Janssen 74ccc34124 Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Core/Persistence/Factories/MediaFactory.cs
2019-08-29 12:38:35 +02:00
Cody Boucher f5a445101d use SystemDirectories.Media instead of hardcoded string media
(cherry picked from commit 2cdeb38521)
2019-08-29 12:34:21 +02:00
Cody Boucher 2cdeb38521 use SystemDirectories.Media instead of hardcoded string media 2019-08-29 12:33:31 +02:00
Sebastiaan Janssen b3834c296b Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js
2019-08-29 11:57:50 +02:00
Sebastiaan Janssen 198b74f4de Merge branch 'v7/7.15' into v7/dev 2019-08-29 11:57:00 +02:00
Sebastiaan Janssen 3c7580ff7b Default for ignoreUserStartNodes should be false 2019-08-29 11:55:43 +02:00
Sebastiaan Janssen c0ad292ebb Merge branch 'v7/7.15' into v7/dev 2019-08-29 11:48:52 +02:00
Steve Megson 4ef55aa7d0 Multi Url Picker fix
(cherry picked from commit 3dc0bbeff3)
2019-08-29 11:48:04 +02:00
Steve Megson 3dc0bbeff3 Multi Url Picker fix 2019-08-29 09:34:35 +02:00
Warren Buckley b205f19f40 Merge pull request #6130 from stevemegson/v8/temp-6060
V8: Handle missing grid values in migration from 7.15
2019-08-27 14:31:52 +00:00
Warren Buckley 727c32843c Merge branch 'v8/8.1' into v8/dev
# Conflicts:
#	src/SolutionInfo.cs
2019-08-27 11:53:52 +01:00
Warren Buckley 78a63b20c7 Merge pull request #6120 from umbraco/v8/bugfix/6099-member-password-reset
Fixes: Member password reset checkbox doesn't hide "new" and "confirm" password fields. #6099
2019-08-27 10:48:27 +00:00
Claus c3e99205de fixed typo. 2019-08-26 13:29:54 +02:00
Claus 66ba6f51da Merge pull request #6147 from umbraco/v8/feature/2196-improve-tiny-load
Improve JS Asset load of TinyMCE Editor
2019-08-26 13:25:34 +02:00
elitsa 8625c8da43 Add special checks and preview for svg files media files for v8
(cherry picked from commit ac4128d89e)
2019-08-23 12:08:03 +01:00
Warren Buckley d86db3fc11 Merge pull request #6182 from umbraco/v8/bugfix/2180-secure-svg-preview
Secure svg media files preview - v8
2019-08-23 11:06:20 +00:00
elitsa ac4128d89e Add special checks and preview for svg files media files for v8 2019-08-23 10:42:00 +02:00
Steve Megson 11f2855442 Move CreateRoutes from WebFinalComponent to WebInitialComponent 2019-08-23 09:11:41 +02:00
Kenn Jacobsen d09be604d9 Allow plugin "Lang" folders to reside in nested directories 2019-08-23 08:56:42 +02:00
Sebastiaan Janssen d8355c368f Too many weird versions 2019-08-22 23:40:24 +02:00
stevemegson 703092c12c V8: Fix caching of macro results in RTE (#6010)
(cherry picked from commit 9b212121e3)
2019-08-22 23:37:06 +02:00
stevemegson 9b212121e3 V8: Fix caching of macro results in RTE (#6010) 2019-08-22 23:34:33 +02:00
Sebastiaan Janssen 88145d70fc Update nestedcontent.editor.html
forgot the "property-" prefix.

(cherry picked from commit 0aaf284f7f)
(cherry picked from commit d2649e9354)

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.editor.html
(cherry picked from commit ac6e399847)
2019-08-22 22:46:11 +02:00
Sebastiaan Janssen 320cc48132 Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.editor.html
2019-08-22 22:44:05 +02:00
Sebastiaan Janssen ac6e399847 Update nestedcontent.editor.html
forgot the "property-" prefix.

(cherry picked from commit 0aaf284f7f)
(cherry picked from commit d2649e9354)

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.editor.html
2019-08-22 22:43:17 +02:00
Sebastiaan Janssen d2649e9354 Update nestedcontent.editor.html
forgot the "property-" prefix.

(cherry picked from commit 0aaf284f7f)
2019-08-22 22:31:36 +02:00
B. Gunnarsson 0aaf284f7f Update nestedcontent.editor.html
forgot the "property-" prefix.
2019-08-22 22:21:43 +02:00
Brynjólfur Gunnarsson a21c9420b1 added data element to nestedcontent.editor.html, tested it and it works" 2019-08-22 22:21:43 +02:00
Sebastiaan Janssen b396cc340c Cherry pick - Added trck by $index to handle duplicate names in blueprints 2019-08-22 22:06:57 +02:00
Sebastiaan Janssen 4b9ce6bb10 Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Core/DateTimeExtensions.cs
#	src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js
#	src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html
#	src/Umbraco.Web.UI.Client/src/views/content/create.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html
#	src/Umbraco.Web/Profiling/WebProfilerProvider.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs
2019-08-22 22:05:14 +02:00
Nik 55d0ca2557 Added trck by $index to handle duplicate names in blueprints
(cherry picked from commit d57ebf021c)
2019-08-22 21:51:58 +02:00
Nik d57ebf021c Added trck by $index to handle duplicate names in blueprints 2019-08-22 21:46:38 +02:00
Kenn Jacobsen a2899b21b6 Don't crash the linkpicker if only an anchor has been entered
(cherry picked from commit 1089b4b9bb)
2019-08-22 21:35:17 +02:00
Kenn Jacobsen 1089b4b9bb Don't crash the linkpicker if only an anchor has been entered 2019-08-22 21:04:12 +02:00
swcs 2428af3c40 Ability to distinguish document types with same name in Nested Content config (#6092) 2019-08-22 10:46:28 +02:00
Sebastiaan Janssen ffd5d61f9f Merge branch 'v7/7.15' into v7/dev 2019-08-21 15:25:54 +02:00
Lars-Erik Aabech 5b1f2ef95d V7: Fixes #6132, dates being blanked out on save/publish when user locale (momen… (#6138) 2019-08-21 15:21:31 +02:00
Sebastiaan Janssen 08c3b6bff5 Fix unit tests
(cherry picked from commit 82e11d7e0a)
2019-08-21 13:02:57 +01:00
Sebastiaan Janssen ccc2a0e811 Fix #5335 - Multiple Media Picker not available as macro parameter
(cherry picked from commit 1f2c4e38ac)
2019-08-21 13:02:36 +01:00
Warren Buckley 445e6d41b7 Merge pull request #6149 from umbraco/v8/feature/5335-multi-media-picker-parameter-editor
Fix #5335 - Multiple Media Picker not available as macro parameter
2019-08-21 11:15:41 +00:00
Sebastiaan Janssen 82e11d7e0a Fix unit tests 2019-08-21 12:45:06 +02:00
Elitsa Marinovska 2cc5256c00 Fixed typo in "ng-container"
(cherry picked from commit 7a7adfb61f)
2019-08-21 11:09:41 +01:00
elitsa 6f83d3c865 Add special checks and preview for svg files media files.
(cherry picked from commit defcb727f9)
2019-08-21 11:09:19 +01:00
Warren Buckley 3325627fd2 Merge pull request #6137 from umbraco/v7/bugfix/2180-secure-svg-preview
Secure svg media files preview
2019-08-21 10:07:08 +00:00
Warren Buckley bec54a0467 Remove unecessary change 2019-08-20 11:28:29 +01:00
Warren Buckley 4fc265275b Fix up unit test for RTE, it was failing as I added the Angular app.value for tinyMceAssets - this ensures we add an empty array of tinymce assets 2019-08-20 11:28:02 +01:00
Warren Buckley a95360036d Pre-loading this lang JS file does not seem to help Tiny as it does not check its already loaded & it reloads itself anyway (But the plugins work all fine & are checked by Tiny to see if they have been loaded) 2019-08-20 11:12:20 +01:00
Warren Buckley 6873c12f04 Update to main controller to load in the TinyMCE assets - assetsService deals with de-duping already loaded assets 2019-08-20 11:11:29 +01:00
Warren Buckley 0daa80efa4 Undo some of the changes as we will load it via assetService in the angular main controller & fixes the double load issue 2019-08-20 11:01:45 +01:00
Sebastiaan Janssen 1f2c4e38ac Fix #5335 - Multiple Media Picker not available as macro parameter 2019-08-19 16:01:03 +02:00
Warren Buckley b9b4721295 * Adds TinyMCE JS assets into init page load via script in default.cshtml view for Umbraco backoffice ng-app
* Add TinyMCE JS assets array via NG app.value & uses assetsService to load (if not loaded in time by main init script above)
2019-08-19 14:36:56 +01:00
Elitsa Marinovska 7a7adfb61f Fixed typo in "ng-container" 2019-08-17 23:54:49 +02:00
elitsa defcb727f9 Add special checks and preview for svg files media files. 2019-08-16 13:34:25 +02:00
Bjarne Fyrstenborg e4f19f7192 v8: Add umbLoader directive (#4987) 2019-08-16 11:52:34 +02:00
Kenn Jacobsen 0e565ddbf8 Make sure treepicker URLs are displayed for the current editor culture
(cherry picked from commit 438133ae1f)
2019-08-16 08:44:54 +02:00
Kenn Jacobsen 438133ae1f Make sure treepicker URLs are displayed for the current editor culture 2019-08-16 08:43:31 +02:00
Shannon Deminick 7ef7b23e93 Merge pull request #6121 from umbraco/v8/bugfix/5804-migration-fix
Fixes: v8.1 migration from v7 results in an error due to a unique index on cmsContent #5804
2019-08-16 16:20:24 +10:00
Shannon 6e1314ae30 Removing legacy service 2019-08-16 15:58:13 +10:00
Shannon Deminick 75ff3b26c1 Merge pull request #6125 from umbraco/v7/bugfix/2179-remove-legacy-web-service
Removing legacy service
2019-08-16 15:49:50 +10:00
Shannon 505b541040 Removing the MiniProfiler routes if solution is not in debug mode. 2019-08-16 15:39:46 +10:00
Shannon fbc12b607d Merge branch 'v7/7.15' into v7/dev 2019-08-16 15:38:19 +10:00
Shannon Deminick cb7440bbbf Merge pull request #6114 from umbraco/v7/bug/2178-disable-mini-profiler
Disable Mini Profiler
2019-08-16 15:37:05 +10:00
Shannon cd355910b3 strangely i need the fully qualified name here else i get an error, otherwise works great. 2019-08-16 15:34:49 +10:00
Andy Butland 5452ebaf6d Import and export of document type and property variations setting in packages 2019-08-15 21:57:09 +02:00
Marc Goodson cec4376d19 Update GetPagedResultsByQuery to return id of the node the audit item relates to instead of table PK
This was fixed previously in v7 - see https://github.com/umbraco/Umbraco-CMS/pull/3759

(cherry picked from commit 53c52abde5)
2019-08-15 21:19:38 +02:00
Marc Goodson 53c52abde5 Update GetPagedResultsByQuery to return id of the node the audit item relates to instead of table PK
This was fixed previously in v7 - see https://github.com/umbraco/Umbraco-CMS/pull/3759
2019-08-15 21:18:41 +02:00
skttl 0d63b13bf0 Changes mode of styleselect to All 2019-08-15 21:17:14 +02:00
Kenn Jacobsen 65b2d08997 Set media picker dirty when the value changes
(cherry picked from commit 2b7154622e)
2019-08-15 21:12:57 +02:00
Kenn Jacobsen 2b7154622e Set media picker dirty when the value changes 2019-08-15 21:12:12 +02:00
Bjarne Fyrstenborg 0baf5eab0a v8: Rename datetime picker component (#6110) 2019-08-15 21:09:58 +02:00
Kenn Jacobsen 16ac2c5589 Don't change parent protection when editing child protection
(cherry picked from commit 4743fc0e1d)
2019-08-15 21:07:19 +02:00
Kenn Jacobsen 4743fc0e1d Don't change parent protection when editing child protection 2019-08-15 21:06:21 +02:00
Kenn Jacobsen f8409be506 Use an Umbraco confirm dialog when deleting groups
(cherry picked from commit f1f9e1742e)
2019-08-15 21:05:04 +02:00
Kenn Jacobsen f1f9e1742e Use an Umbraco confirm dialog when deleting groups 2019-08-15 21:04:33 +02:00
Kenn Jacobsen 455395154a Don't reuse previously used content templates
(cherry picked from commit 3087eff147)
2019-08-15 21:01:45 +02:00
Kenn Jacobsen 3087eff147 Don't reuse previously used content templates 2019-08-15 21:00:22 +02:00
Sebastiaan Janssen 8e2eccb392 Bump version to 7.15.2 2019-08-15 13:32:09 +02:00
Sebastiaan Janssen a0af474c75 Bump version to 8.1.3 2019-08-15 13:29:14 +02:00
Kenn Jacobsen 7e8364eae4 V8: Support mixed element variance in Nested Content (#5952)
(cherry picked from commit e7a9ee8142)
2019-08-15 13:27:50 +02:00
Kenn Jacobsen e7a9ee8142 V8: Support mixed element variance in Nested Content (#5952) 2019-08-15 13:10:17 +02:00
Steve Megson 806d835a90 Handle null and missing grid values in migration 2019-08-14 21:14:48 +01:00
Jan Skovgaard 617fd9ab17 Accessibility: Open Package - Identifies back button as "Left h… (#5930) 2019-08-14 17:47:13 +02:00
Jan Skovgaard fe6df58e66 Accessibility: Media uploader widget can't be accessed via keyb… (#5944) 2019-08-14 17:40:52 +02:00
Jan Skovgaard 6bd647f8c6 Accessibility: Unable to navigate to close 'X' icon with keyboa… (#5964) 2019-08-14 17:29:26 +02:00
Jan Skovgaard 8d0df6cec3 Accessibility: Open User Details - Back icon arrow is identifie… (#5970) 2019-08-14 17:21:56 +02:00
Jan Skovgaard 5997e0ce8c Accessibility: Ensure "cancel" is clickable from move/restore d… (#5942) 2019-08-14 17:11:02 +02:00
Kenn Jacobsen 8bdd694a12 V8: Make sure to mark the current form as dirty when altering content types (#6108) 2019-08-14 16:55:32 +02:00
elitsa ee2068de56 Removing legacy service 2019-08-14 14:03:32 +02:00
Shannon dfed93a4ab Fixes dropping unique constraint indexes and oddly named FKs 2019-08-14 14:49:05 +10:00
Shannon 4e17463eb8 Merge branch 'v8/8.1' into v8/dev 2019-08-14 12:52:07 +10:00
Shannon df391c86f3 Fixes re-syncing member and media data after saving 2019-08-14 12:45:39 +10:00
Shannon 67f0a65811 Merge branch 'v8/8.1' into v8/bugfix/6099-member-password-reset 2019-08-14 12:30:02 +10:00
Shannon 9d77114d50 fixes gulp build for dev purposes - no fastdev since there's no need for it, removes inlining templates when not in prod 2019-08-14 12:28:28 +10:00
Shannon d2be30a228 converting to component 2019-08-14 12:26:49 +10:00
Shannon 9ed1101f27 whitespace changes 2019-08-14 11:16:24 +10:00
Shannon f60b91110f Fixes merge 2019-08-14 10:56:08 +10:00
Shannon db6714d3b8 Merge remote-tracking branch 'origin/v8/8.1' into v8/dev
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Web/Search/ExamineComponent.cs
2019-08-14 10:39:15 +10:00
Sebastiaan Janssen 47c8de4ca1 Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
2019-08-13 23:29:58 +02:00
Matt Brailsford 802e6d7979 Fixes #5931, show breadcrumb for new content
Could probably do with adding "Untitled" to translation file

(cherry picked from commit 249126a2b5)
2019-08-13 23:17:06 +02:00
Matt Brailsford 249126a2b5 Fixes #5931, show breadcrumb for new content
Could probably do with adding "Untitled" to translation file
2019-08-13 23:16:33 +02:00
Matt Brailsford ea591c87a2 Fixes #5932, showing "Return to ListView" for new content
(cherry picked from commit f3fc83fae6)
2019-08-13 23:11:01 +02:00
Matt Brailsford f3fc83fae6 Fixes #5932, showing "Return to ListView" for new content 2019-08-13 23:09:17 +02:00
BatJan d005af2b11 Remove unused visuallyhidden class 2019-08-13 22:59:49 +02:00
Kenn Jacobsen 3b60815e53 Fix user group deletion (#5912)
(cherry picked from commit b0b05cf785)
2019-08-13 22:55:12 +02:00
Kenn Jacobsen b0b05cf785 Fix user group deletion (#5912) 2019-08-13 22:54:19 +02:00
Bjarne Fyrstenborg d5d213cd44 Allow tree item label to shrink
(cherry picked from commit 2d56879d92)
2019-08-13 22:46:31 +02:00
Bjarne Fyrstenborg 2d56879d92 Allow tree item label to shrink 2019-08-13 22:45:09 +02:00
Sebastiaan Janssen 13d07c7ba3 Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web/Editors/MediaTypeController.cs
2019-08-13 22:43:30 +02:00
Tom Pipe ece7178ef5 Ensure a media type correctly inherits it's selected parent
(cherry picked from commit ab63d2664c)
2019-08-13 22:41:01 +02:00
Tom Pipe ab63d2664c Ensure a media type correctly inherits it's selected parent 2019-08-13 22:40:33 +02:00
Tom Pipe f829ac4e6c Ensure a media type correctly inherits it's selected parent
(cherry picked from commit 28dd9aa081)
2019-08-13 22:38:39 +02:00
Tom Pipe 28dd9aa081 Ensure a media type correctly inherits it's selected parent 2019-08-13 22:37:59 +02:00
Sebastiaan Janssen eb8556c792 Merge branch 'v7/dev' into v8/dev 2019-08-13 22:26:16 +02:00
Sebastiaan Janssen 84e4c78bb9 Merge branch 'v7/7.15' into v7/dev 2019-08-13 22:24:21 +02:00
arkadiuszbiel 6123c0d475 Change z-index
(cherry picked from commit 3fa77dbf3d)
(cherry picked from commit 12ad9dd36b)

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less
2019-08-13 22:20:52 +02:00
arkadiuszbiel 12ad9dd36b Change z-index
(cherry picked from commit 3fa77dbf3d)
2019-08-13 22:16:42 +02:00
Sebastiaan Janssen ba040674cb Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/components/notifications/umb-notifications.less
2019-08-13 22:15:57 +02:00
arkadiuszbiel 3fa77dbf3d Change z-index 2019-08-13 22:14:53 +02:00
Sebastiaan Janssen 9fa435dbb2 Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Core/Services/NotificationService.cs
#	src/Umbraco.Web.UI.Client/src/less/tree.less
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/mediaPicker/mediapicker.controller.js
#	src/Umbraco.Web/Properties/Settings.settings
#	src/Umbraco.Web/Properties/Settings1.Designer.cs
2019-08-13 22:11:34 +02:00
Nathan Woulfe 02c1e88da2 V8: Display current log level in log viewer sidebar (#6059) 2019-08-13 22:07:05 +02:00
Kenn Jacobsen 87e60ef26b V8: Support hexa in hexBgColor (#6091) 2019-08-13 21:56:11 +02:00
Kenn Jacobsen 87845ee907 V8: Allow localization of the backoffice using parent cultures… (#6090)
(cherry picked from commit 405538544f)
2019-08-13 20:28:48 +02:00
Kenn Jacobsen 405538544f V8: Allow localization of the backoffice using parent cultures… (#6090) 2019-08-13 20:26:22 +02:00
elitsa afca2e70bd Removing the MiniProfiler routes if solution is not in debug mode. 2019-08-13 14:17:14 +02:00
Peter Gregory 31d67161ab V8: Implementation of Create method for infinite editing edtior… (#6031) 2019-08-13 08:07:53 +02:00
Claus 66e3869b06 Merge pull request #6080 from umbraco/v8/feature/2190-improve-jarring-tiny-loading
AB#2190 - Improve jarring TinyMCE editor loading experience
2019-08-12 11:54:27 +02:00
swcs 600be987a7 use modifiable media path in file system composition
(cherry picked from commit fdcfc48e06)
2019-08-12 09:05:45 +02:00
swcs fdcfc48e06 use modifiable media path in file system composition 2019-08-12 09:04:32 +02:00
Shannon eb46b16800 subtle mistake in gulp change 2019-08-12 16:18:49 +10:00
Shannon Deminick 392445b53a Merge pull request #6086 from umbraco/v8/feature/more-flexi-angular-sln
Fix the gulp build to allow directives/components to exist where they need to be allowed
2019-08-12 09:36:25 +10:00
Kenn Jacobsen 7c93b8f157 Use mculture in content editor for multilingual content
(cherry picked from commit 2f84e76952)
2019-08-09 16:59:33 +02:00
Kenn Jacobsen 2f84e76952 Use mculture in content editor for multilingual content 2019-08-09 16:58:35 +02:00
Kenn Jacobsen 12a30d3ffd Always open the selected content template in infinite editing 2019-08-09 16:56:04 +02:00
Kenn Jacobsen 7e1f90fb3b Clear the content type "common" cache when deleting templates 2019-08-09 16:54:52 +02:00
Kenn Jacobsen 9865596dcc V7: Change the priority of the tree node annotations for contai… (#6083)
(cherry picked from commit 7393d9c372)
2019-08-09 16:47:14 +02:00
Kenn Jacobsen 7393d9c372 V7: Change the priority of the tree node annotations for contai… (#6083) 2019-08-09 16:44:43 +02:00
Kenn Jacobsen c87a22f347 Fix the disabled upload button in media picker (#6082)
(cherry picked from commit feb5567621)
2019-08-09 16:42:57 +02:00
Kenn Jacobsen dc44a7a3a7 Fix the disabled upload button in media picker
(cherry picked from commit 79c4d7797c)
2019-08-09 16:41:13 +02:00
Kenn Jacobsen 79c4d7797c Fix the disabled upload button in media picker 2019-08-09 16:40:08 +02:00
Kenn Jacobsen feb5567621 Fix the disabled upload button in media picker (#6082) 2019-08-09 16:36:38 +02:00
Rachel Breeze 9cab789425 V8: Accessibility improvements for page name entry (#5760)
(cherry picked from commit ab3202b560)
2019-08-09 16:27:02 +02:00
Rachel Breeze ab3202b560 V8: Accessibility improvements for page name entry (#5760) 2019-08-09 16:25:51 +02:00
Kenn Jacobsen a0cd542ba3 Fix "infinityMode" typo
(cherry picked from commit e10ce234db)
2019-08-09 16:00:54 +02:00
Kenn Jacobsen e10ce234db Fix "infinityMode" typo 2019-08-09 15:59:37 +02:00
Shannon 7f02bc7d1d fix controller glob 2019-08-09 16:55:58 +10:00
Shannon 44b6738b0d Moves main/navigation controllers to root - no more 'controller' folder 2019-08-09 16:36:10 +10:00
Shannon fbb19cba0b Updates the build so we can be more flexible with where we put angular file types in the solution 2019-08-09 16:02:05 +10:00
Shannon 84554101f2 Merge branch 'v8/dev' of https://github.com/umbraco/Umbraco-CMS into v8/dev 2019-08-09 15:54:38 +10:00
Shannon 8a3b2e038c adds note 2019-08-09 15:54:21 +10:00
Peter Keating ff595df7ca Fix notifications not sending when user has multiple of same type
When a user has multiple notifications of the same type, the user may
not receive the notification depending on the order which the
notification was setup. To fix this the notification logic has changed
from looping over users to looping over notifications.

Fixes #4713.

(cherry picked from commit 01a895bbf7)
2019-08-08 19:49:59 +02:00
Peter Keating 01a895bbf7 Fix notifications not sending when user has multiple of same type
When a user has multiple notifications of the same type, the user may
not receive the notification depending on the order which the
notification was setup. To fix this the notification logic has changed
from looping over users to looping over notifications.

Fixes #4713.
2019-08-08 19:48:39 +02:00
amitch17 296d7964ae Corrected comments to change usage examples
Corrected usage examples for entityResource.js

My first Umbraco commit! yay!
2019-08-08 18:55:38 +02:00
Steve Megson 88349c6b66 Sorting of images in multiple media picker
(cherry picked from commit ed5effd190)
2019-08-08 16:02:35 +02:00
Steve Megson ed5effd190 Sorting of images in multiple media picker 2019-08-08 16:00:21 +02:00
Warren Buckley c6671f7f8e Apply same loading bar UI to Grid RTE & use editor INIT to hide/remove it 2019-08-08 12:35:39 +01:00
Warren Buckley 44c966bd44 Moves our Umbraco angular loader component to only hide itself once the tinymce editor has initialized 2019-08-08 11:37:18 +01:00
Sebastiaan Janssen 046ed8ec85 Bump version to 8.1.2 2019-08-08 12:23:57 +02:00
Steve Megson aabe6defb2 Fixes #5864 - migrate prevalues for Umbraco.DropDown.Flexible
(cherry picked from commit 4e0dd728a8)
2019-08-08 10:56:02 +02:00
Bjarke Berg 3245c82ea6 Missing file in project file
(cherry picked from commit 3062f40ef5)
2019-08-08 10:45:34 +02:00
Kenn Jacobsen beacc5bba8 Fix broken button to open content type from create dialog
(cherry picked from commit 57e58c6cf7)
2019-08-08 10:05:33 +02:00
Kenn Jacobsen 57e58c6cf7 Fix broken button to open content type from create dialog 2019-08-08 10:03:47 +02:00
leekelleher 34e45abcc7 Added constants for Property Editor Groups 2019-08-07 20:59:03 +02:00
leekelleher 7ffe0398f9 DocType Editor sorting - vertical direction
In the DocType Editor, when sorting the groups and properties,
the draggable direction is freeform (horizontal, vertical or even
diagonal).

We can restrict the direction, by setting the `axis` property in
the sort options.
2019-08-07 20:55:35 +02:00
Kenn Jacobsen ce5b3531e0 Make content types with description look ok in the create dialog (#5752)
(cherry picked from commit b3497011e8)
2019-08-07 20:50:08 +02:00
Kenn Jacobsen b3497011e8 Make content types with description look ok in the create dialog (#5752) 2019-08-07 20:49:14 +02:00
Søren Gregersen a398881fa1 fix: spelling error in comment :)
infinie error(s) fixed
2019-08-07 20:38:37 +02:00
Sebastiaan Janssen a9a5d00916 Merge pull request #5999 from kjac/v8-fix-allow-remove-user-start-nodes
V8: Allow removing user start nodes
(cherry picked from commit 2cf3a7831c)
2019-08-07 20:25:44 +02:00
Sebastiaan Janssen 2cf3a7831c Merge pull request #5999 from kjac/v8-fix-allow-remove-user-start-nodes
V8: Allow removing user start nodes
2019-08-07 20:19:48 +02:00
Gopakumar R 62a71f8052 Fix for issue #5816 (#5836)
(cherry picked from commit 0138091a6c)
2019-08-07 20:16:50 +02:00
Gopakumar R 0138091a6c Fix for issue #5816 (#5836) 2019-08-07 20:16:18 +02:00
Kenn Jacobsen 36eccb472c Fix the create context menu overflows introduced with 405e9a79 (#5754)
(cherry picked from commit 6c0fb2f849)
2019-08-07 19:58:13 +02:00
Kenn Jacobsen 6c0fb2f849 Fix the create context menu overflows introduced with 405e9a79 (#5754) 2019-08-07 19:56:30 +02:00
Benjamin Carleski 289d50d170 Fix FIPS compliance, add FIPS tests (#5978)
(cherry picked from commit e495faf83c)
2019-08-07 19:34:13 +02:00
Benjamin Carleski e495faf83c Fix FIPS compliance, add FIPS tests (#5978) 2019-08-07 19:31:08 +02:00
Linus Elander 0517f29134 Adjusts conditions for which indexes should be affected when a node is unpublished
(cherry picked from commit 7557c584d8)
2019-08-07 16:38:13 +02:00
Shannon 467cf8d762 Adds comments/notes 2019-08-07 15:40:27 +10:00
Bjarke Berg 2cdb6d86ad Merge pull request #6019 from umbraco/v8/bugfix/pending-changes-issue
v8 Changing a property type from invariant to variant and back again causes issues with reporting that a document is edited or not
2019-08-06 09:09:12 +02:00
Bjarke Berg d474f60465 Merge pull request #5992 from umbraco/v8/bugfix/5554-unpublish-state
V8/bugfix/5554 unpublish state
2019-08-05 11:54:49 +02:00
Bjarke Berg caf4d1fe34 Merge pull request #6038 from umbraco/v8/bugfix/examine-startup
Fixes how examine starts up to make it easier for custom index developers
2019-08-05 10:39:29 +02:00
Bjarke Berg e4f346620e Added runtime level to ExamineFinalComposer 2019-08-05 10:38:35 +02:00
Shannon be4536cf16 Refactors ugly statics and nested classes 2019-08-05 17:14:29 +10:00
Shannon 89429bd65a fixes ctor 2019-08-05 16:28:23 +10:00
Shannon 6d3faf91d8 fixes spacing with ext login providers 2019-08-05 13:50:50 +10:00
Shannon 345e6091d2 fixes null check, was on the wrong element 2019-08-02 13:01:02 +10:00
Shannon 86a97c30d1 fixes up LuceneIndexDiagnostics 2019-08-02 12:40:45 +10:00
Shannon 14915e9da7 oops 2019-08-02 01:16:37 +10:00
Shannon 366058581a Adds LuceneIndexDiagnostics to make it easier for devs and custom indexes 2019-08-02 01:15:08 +10:00
Shannon 9f6a7dec2e Fixes how examine starts up to make it easier for custom index developers 2019-08-02 00:28:48 +10:00
Shannon be30bb0ad0 adds test 2019-08-01 21:41:43 +10:00
Shannon 600a29514f more asserts 2019-08-01 21:27:31 +10:00
Shannon 9efec9244b removes commented out code 2019-08-01 19:09:19 +10:00
Shannon ded1a22e45 fixes validation check 2019-08-01 19:01:41 +10:00
Shannon 2e83ac9282 Cleans up some tests 2019-08-01 18:54:19 +10:00
Shannon 9538981730 Adds more assertions and tests and validates variations 2019-08-01 18:49:05 +10:00
Shannon 791222c3ce Merge remote-tracking branch 'origin/v8/8.1' into v8/bugfix/5554-unpublish-state 2019-08-01 16:11:16 +10:00
Shannon 1095815878 removes notes 2019-08-01 16:09:52 +10:00
Shannon a8bdab8f5c Merge remote-tracking branch 'origin/v8/8.1' into v8/bugfix/pending-changes-issue 2019-08-01 15:56:24 +10:00
Shannon ff952a6df1 Passes test! Now to add more tests/assertions and then the logic to renormalize based on name changes. 2019-08-01 15:54:44 +10:00
Shannon 87e7cec02e WIP - commiting what i have. Solved part of the problem but there are others. 2019-07-31 18:30:34 +10:00
Shannon 5c8cd60275 Writes up a test to show the issue with edited culture flags, this shows that the current fix works but there's still an issue 2019-07-31 00:13:40 +10:00
Bjarke Berg e2483dc874 Merge pull request #6020 from umbraco/v8/bugfix/panic-exception
Adds PanicException with details instead of throwing "panic" strings
2019-07-30 15:22:05 +02:00
Shannon 6482d849e3 Moves test to different fixture 2019-07-30 22:59:33 +10:00
Shannon 34f137c8cf Merge branch 'v8/bugfix/panic-exception' into v8/bugfix/5554-unpublish-state 2019-07-30 22:50:06 +10:00
Shannon 16d8f8846e Adds PanicException with details instead of throwing "panic" strings 2019-07-30 22:40:15 +10:00
Shannon 108416638c removes commented out code 2019-07-30 22:28:06 +10:00
Shannon 20d28ea215 removes commented out code 2019-07-30 22:20:28 +10:00
Shannon 27bc309c55 Removes unused code 2019-07-30 22:20:28 +10:00
Shannon b5b4ee79b4 Adds notes, fixes logic with a double save 2019-07-30 22:20:28 +10:00
Shannon 45227357fd adds notes on why this is failing 2019-07-30 22:20:28 +10:00
Shannon a2ba0f6a4c more tests - failing that need fixing 2019-07-30 22:20:27 +10:00
Shannon 415916c527 Fixes an issue with the content service + test 2019-07-30 22:20:27 +10:00
Shannon 40a55cb9df Fixes issue/tests 2019-07-30 22:20:27 +10:00
Shannon 5a9ca8d09f wip added more tests and notes 2019-07-30 22:20:27 +10:00
Shannon 1bfcc9053e Fixes issues: we never properly used SuccessUnpublishMandatoryCulture, fixed issue of unpublishing last culture with a new status 2019-07-30 22:20:27 +10:00
Shannon 3930ae244c Created unit test to show the problem. 2019-07-30 22:20:27 +10:00
Shannon 365ad2981d Fixing issue when changing a property type from invariant to variant and back again and the document always reporting pending changes. 2019-07-30 19:02:03 +10:00
Rasmus John Pedersen ca56655d07 Fix exception when stored media url is already absolute
(cherry picked from commit 49b3351c72)
2019-07-29 14:31:04 +02:00
Sebastiaan Janssen 8721423f40 Merge pull request #6016 from umbraco/v8/fix/5906-support-stored-absolute-media-url
Fix exception when stored media url is already absolute
2019-07-29 14:30:03 +02:00
Rasmus John Pedersen 49b3351c72 Fix exception when stored media url is already absolute 2019-07-29 12:59:29 +02:00
Shannon 4612c03657 Fixes #5789 - PublishedContentQuery Search always searches on culture 2019-07-29 15:43:03 +10:00
Shannon 41093e5b8b Value Set builder shouldn't stop indexing when one field is empty in value sets 2019-07-29 15:38:08 +10:00
Shannon Deminick faef449750 Merge pull request #6009 from bielu/v8/dev
V8: Value Set builder shouldn't stop indexing when one field is empty in …
2019-07-29 11:36:01 +10:00
arkadiuszbiel 4a24064783 Value Set builder shouldn't stop indexing when one field is empty in value sets 2019-07-27 20:41:15 +01:00
Kenn Jacobsen 0ab84fc443 Allow removing user start nodes 2019-07-25 10:28:16 +02:00
Bjarke Berg fca74ad8d7 Merge pull request #5862 from umbraco/v8/bugfix/5789-PublishedContentQuery-Search
Fixes #5789 - PublishedContentQuery Search always searches on culture
2019-07-24 14:16:32 +02:00
Shannon 7bc7dba86d fixes timing issue 2019-07-24 21:46:19 +10:00
Shannon efd6bd82bd Revert "V8: Don't show multiple open menus (take two) (#5609)"
This reverts commit 9ce996cbba.

(cherry picked from commit 1d49c8626e)
2019-07-24 12:02:41 +02:00
Sebastiaan Janssen 17527c99eb Makes checks a little more robust
(cherry picked from commit ca75a25802)
2019-07-24 11:37:29 +02:00
Steve Megson 361557dc39 Handle CSV values in TagsPropertyEditor
(cherry picked from commit a97604d6c4)
2019-07-24 11:37:17 +02:00
Sebastiaan Janssen ca75a25802 Makes checks a little more robust 2019-07-24 11:33:12 +02:00
Shannon ece31733a9 Merge branch 'v8/dev' of https://github.com/umbraco/Umbraco-CMS into v8/dev 2019-07-24 19:25:48 +10:00
Shannon 28a8027179 removes reference to old packages.umbraco.org 2019-07-24 19:25:32 +10:00
Shannon 4fa523db43 Merge branch 'v7/7.15' into v7/dev 2019-07-24 19:23:58 +10:00
Shannon 186460ac08 removes refs from old packages.umbraco.org 2019-07-24 19:23:05 +10:00
Steve Megson a97604d6c4 Handle CSV values in TagsPropertyEditor 2019-07-24 11:14:00 +02:00
Bjarke Berg 308f929f7b Refactored tests to avoid duplicate code 2019-07-24 11:13:21 +02:00
Kenn Jacobsen 342b2087e9 Make sure save options are up to date with the content state
(cherry picked from commit 8a43e3a87e)
2019-07-24 10:59:01 +02:00
Shannon c8d7df1515 Merge branch 'v8/bugfix/5789-PublishedContentQuery-Search' of https://github.com/umbraco/Umbraco-CMS into v8/bugfix/5789-PublishedContentQuery-Search 2019-07-24 18:46:48 +10:00
Shannon 2c795662d2 Adds tests for PublishedContentQuery search 2019-07-24 18:46:14 +10:00
Kenn Jacobsen 8a43e3a87e Make sure save options are up to date with the content state 2019-07-24 10:46:00 +02:00
Bjarke Berg 210e43fcb0 Fix for build 2019-07-24 09:53:51 +02:00
Shannon Deminick beb8c7ac7c Update src/Umbraco.Web/PublishedContentQuery.cs
Co-Authored-By: Bjarke Berg <mail@bergmania.dk>
2019-07-24 17:30:29 +10:00
Shannon Deminick 2f8979bbc3 Update src/Umbraco.Web/PublishedContentQuery.cs
Co-Authored-By: Bjarke Berg <mail@bergmania.dk>
2019-07-24 17:29:00 +10:00
Shannon a8ed7f2c17 adds new method 2019-07-23 22:11:02 +10:00
Frans de Jong 1c6bf55e5d GetCurrentLoginStatus()
In the summary of MembershipHelper.GetCurrentLoginStatus() it states that null will be returned when no member is logged in but that isn't the case (anymore?).
2019-07-23 13:02:11 +02:00
Steve Megson dc371c1979 Include CheckBoxList in ValueListPreValueMigrator 2019-07-23 12:48:48 +02:00
Bjarke Berg c246044ac7 Merge pull request #5972 from stevemegson/v8/temp-checkboxlist
Content migration - Include CheckBoxList in ValueListPreValueMigrator
2019-07-23 12:47:13 +02:00
Shannon 5126521d37 Fixes #5789 2019-07-23 19:09:15 +10:00
Shannon 27223738c6 Merge branch 'v8/8.1' into v8/dev
# Conflicts:
#	src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
2019-07-23 19:05:06 +10:00
Shannon 2faa4defd8 Merge remote-tracking branch 'origin/v7/7.15' into v8/8.1
# Conflicts:
#	src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
2019-07-23 19:03:14 +10:00
Warren Buckley bb8356d7db Merge pull request #5924 from umbraco/v/bugfix/5035-slot-swap2
Fixes race condition in PublishedSnapshotService and more...
2019-07-23 09:18:44 +01:00
Shannon Deminick 686f6752f3 Merge pull request #5951 from umbraco/v7/hotfix/5921-preview-failing
https://github.com/umbraco/Umbraco-CMS/issues/5921 - AB#1794 - Remove…
2019-07-23 16:58:13 +10:00
Warren Buckley 66ff4d191a Merge pull request #5946 from umbraco/v8/bugfix/5886-fixes-Children
Fixes issue with Children(culture) method
2019-07-22 14:54:49 +01:00
Shannon 21218b0332 Merge remote-tracking branch 'origin/v7/7.15' into v8/8.1
# Conflicts:
#	src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js
2019-07-22 13:59:14 +10:00
Shannon Deminick 23ccdeb2cf Merge pull request #5868 from umbraco/v7/hotfix/5835-AB#1693-add-null-checks-when-using-dataTypeId
Added null checks when *.dataTypeId is used
2019-07-22 13:44:05 +10:00
Shannon 6148ce4e52 oops no es6 support in 7.x 2019-07-22 13:41:26 +10:00
Shannon 06850ed25c Merge branch 'v7/7.15' into v7/hotfix/5835-AB#1693-add-null-checks-when-using-dataTypeId 2019-07-22 13:40:35 +10:00
Shannon 0320a56cb5 Fixes up dataTypeId var declarations 2019-07-22 13:27:51 +10:00
Steve Megson 968463912a Include CheckBoxList in ValueListPreValueMigrator 2019-07-21 14:47:37 +01:00
Warren Buckley b9e44f381b Merge pull request #5923 from umbraco/v8/hotfix/5902-migration-should-not-warn-about-build-in-renamed-data-types
V8: Migration should not warn about build in data types that is handled correct but renamed
2019-07-19 10:56:38 +01:00
Bjarke Berg cd27bb210f https://github.com/umbraco/Umbraco-CMS/issues/5921 - AB#1794 - Remove trashed nodes from sql when building xml for previews 2019-07-19 11:25:33 +02:00
Bjarke Berg 67f680a675 Revert "https://github.com/umbraco/Umbraco-CMS/issues/5921 - AB#1794 - Remove trashed nodes from sql when building xml for previews"
This reverts commit 47c3e3a7
2019-07-19 11:24:01 +02:00
Bjarke Berg 47c3e3a79f https://github.com/umbraco/Umbraco-CMS/issues/5921 - AB#1794 - Remove trashed nodes from sql when building xml for previews 2019-07-19 11:20:31 +02:00
Shannon 02f49a0039 Cherry picks fix for 5894 and makes adjustments 2019-07-19 16:00:42 +10:00
Shannon Deminick 05c6b856f9 Merge pull request #5897 from kjac/v8-fix-media-type-add-property
V8: Fix YSOD when editing media types
2019-07-19 15:57:01 +10:00
Shannon b07df63422 Adds some better notes to the api docs 2019-07-19 15:49:39 +10:00
Shannon 487e45b45b updates note 2019-07-19 15:26:31 +10:00
Shannon 929c84822a Fixes the Children ext method and adds unit tests 2019-07-19 15:18:00 +10:00
Warren Buckley 993f11cd2c Merge pull request #5898 from umbraco/v8/hotfix/5846-AB#1695-Fix-for-migration-of-corrupt-data
V8: Give better exception if a json exception happens doing migration
2019-07-18 13:36:35 +01:00
Warren Buckley 6544b5c272 Update src/Umbraco.Core/Migrations/Upgrade/V_8_1_0/ConvertTinyMceAndGridMediaUrlsToLocalLink.cs
Co-Authored-By: Bjarke Berg <mail@bergmania.dk>
2019-07-18 13:03:14 +01:00
Shannon 817a458334 Merge remote-tracking branch 'origin/v7/7.15' into v8/8.1
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Web.UI/packages.config
2019-07-18 16:22:38 +10:00
Shannon f3bfc1ffb2 Puts back UmbracoAntiForgeryAdditionalDataProvider for backwards compat reasons but it is not used 2019-07-18 16:18:11 +10:00
Shannon 3603090421 Fixes race condition in PublishedSnapshotService and more... 2019-07-17 22:51:14 +10:00
Shannon 6fe3089207 Merge branch 'v8/8.1' into v8/dev
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Web/HtmlHelperRenderExtensions.cs
#	src/Umbraco.Web/Mvc/HttpUmbracoFormRouteStringException.cs
#	src/Umbraco.Web/Mvc/ValidateUmbracoFormRouteStringAttribute.cs
2019-07-17 22:31:54 +10:00
Bjarke Berg 79159b684d https://github.com/umbraco/Umbraco-CMS/issues/5902
- Fixed issue with migration of Umbraco.Date if it was never saved in v7, the default format was added the time-part.
- Fixed issue with warnings of migrations of build in types, that was renamed between v7 and v8. These are handled correct.
- Added constants for some of the legacy property editor aliases.
2019-07-17 14:30:02 +02:00
Shannon 26d4d056be bumps version 2019-07-17 22:28:06 +10:00
Shannon 6ad28f1103 Merge remote-tracking branch 'origin/v7/7.15' into v8/8.1
# Conflicts:
#	build/NuSpecs/tools/Web.config.install.xdt
#	src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs
#	src/Umbraco.Core/Services/EntityService.cs
#	src/Umbraco.Core/Services/IEntityService.cs
#	src/Umbraco.Tests/Web/Mvc/HtmlHelperExtensionMethodsTests.cs
#	src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js
#	src/Umbraco.Web/Controllers/UmbLoginController.cs
#	src/Umbraco.Web/Controllers/UmbLoginStatusController.cs
#	src/Umbraco.Web/Controllers/UmbProfileController.cs
#	src/Umbraco.Web/Controllers/UmbRegisterController.cs
#	src/Umbraco.Web/HtmlHelperRenderExtensions.cs
#	src/Umbraco.Web/Mvc/HttpUmbracoFormRouteStringException.cs
#	src/Umbraco.Web/Mvc/ValidateUmbracoFormRouteStringAttribute.cs
#	src/Umbraco.Web/UmbracoHelper.cs
#	src/Umbraco.Web/WebBootManager.cs
2019-07-17 21:58:33 +10:00
Shannon 89cd655df2 Merge remote-tracking branch 'origin/v7/bugfix/build-without-vs2017' into v7/7.15 2019-07-17 21:48:21 +10:00
Shannon 14c4c4815d bumps version 2019-07-17 21:35:43 +10:00
Shannon bfb69a34ef re-adds back in the serialization overloads for the custom exception, re-adds detailed error messages, adds more documentation. Adds unit tests. 2019-07-17 21:15:18 +10:00
Shannon b675f6252c removes files (should have been part of cherry pick?), fixes logic 2019-07-16 23:07:31 +10:00
Shannon d52420183e Cherry picks ValidateUmbracoFormRouteStringAttribute implementation and fixes up some logic 2019-07-16 23:03:26 +10:00
Shannon 0cbe0b4796 Cherry picks ValidateUmbracoFormRouteStringAttribute implementation 2019-07-16 22:34:34 +10:00
Shannon Deminick 06b136fdf6 Merge pull request #5895 from ronaldbarendse/v8/feature/validate-umbracoformroutestring
Added attribute to validate Umbraco form route strings (ufprt)
2019-07-16 22:01:32 +10:00
Bjarke Berg c6246b5404 Merge remote-tracking branch 'origin/v8/dev' into v8/dev 2019-07-16 13:46:07 +02:00
Bjarke Berg 3062f40ef5 Missing file in project file 2019-07-16 13:43:10 +02:00
Bjarke Berg dcd0d38419 Merge remote-tracking branch 'origin/v8/8.1' into v8/dev 2019-07-16 13:41:30 +02:00
Steve Megson 0feb053e51 Fixes #5852 - TablesForScheduledPublishing 2019-07-16 13:39:09 +02:00
Bjarke Berg c01a8f8f13 Merge pull request #5887 from stevemegson/temp-content-migration
PR fixes 7 -> 8 migration bugs for #5852 and #5864
2019-07-16 13:37:08 +02:00
Bjarke Berg 09c8ae4e7e Fixed null ref exception in related links migrations 2019-07-16 13:36:16 +02:00
Kenn Jacobsen da71a94c39 Use IsCollectionEmpty() as per review 2019-07-16 12:45:27 +02:00
Shannon Deminick f6413af3f4 Merge pull request #5885 from hifi-phil/v8/dev
Change PropertyType.Alias to virtual
2019-07-16 20:31:58 +10:00
skttl 2aaca865e7 changes innerjoin to left join, to allow folders in sql query 2019-07-16 07:26:26 +02:00
Bjarke Berg 2ec8281163 Merge pull request #5865 from skttl/5848-media-folders-not-showing
5848: changes innerjoin to left join, to allow folders in sql query
2019-07-16 07:24:46 +02:00
Shannon 77dda5a70f Fixes issue during upgrade where umbraco can't clear cdf log files 2019-07-15 14:34:32 +02:00
Bjarke Berg 440e649d6d Merge pull request #5861 from umbraco/v8/bugfix/cdf-upgrade-bug
Fixes issue during upgrade where umbraco can't clear cdf log files
2019-07-15 14:32:19 +02:00
Bjarke Berg f6a8d487cc AB#1695 - https://github.com/umbraco/Umbraco-CMS/issues/5846
Give better exception, if a json exception happens doing migration of grid properties in ConvertTinyMceAndGridMediaUrlsToLocalLink
2019-07-15 13:06:47 +02:00
Warren Buckley 47dcd37d1d Merge pull request #5784 from nathanwoulfe/5768-log-viewer-chart-naming
V8: Make log naming and colors consistent between Log Search and Log Overview
2019-07-15 11:47:20 +01:00
Kenn Jacobsen d60fc63e78 Fix YSOD when editing media types 2019-07-15 12:23:09 +02:00
Ronald Barendse b0c4042e87 Removed UmbracoAntiForgeryAdditionalDataProvider 2019-07-15 10:16:09 +02:00
Shannon da525513a3 Merge remote-tracking branch 'origin/v7/dev' into v8/dev
# Conflicts:
#	build/NuSpecs/tools/Web.config.install.xdt
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js
#	src/Umbraco.Web/Editors/EntityController.cs
#	src/Umbraco.Web/UmbracoHelper.cs
2019-07-15 16:18:04 +10:00
Shannon Deminick 2ac5e61e44 Merge pull request #5881 from bjarnef/dev-v7-link-picker-url-anchors
v7: Fix link picker url and anchors
2019-07-15 13:02:47 +10:00
Ronald Barendse 101a8b6c78 Added ValidateUmbracoFormRouteStringAttribute to public controllers 2019-07-14 23:18:21 +02:00
Ronald Barendse f7a10e3a15 Added attribute to validate Umbraco form route strings (ufprt) 2019-07-14 23:18:06 +02:00
Steve Megson 4e0dd728a8 Fixes #5864 - migrate prevalues for Umbraco.DropDown.Flexible 2019-07-14 16:48:33 +01:00
Steve Megson 320ccf8105 Fixes #5852 - TablesForScheduledPublishing 2019-07-14 16:46:01 +01:00
hifi-phil 62f924a757 Change PropertyType.Alias to virtual
When unit testing PropertyType.Alias needs to be virtual to make it mockable. The underlying code on the set triggers IOC logic and makes it hard to test anything that uses Property Types.
2019-07-14 09:45:12 +01:00
Bjarne Fyrstenborg c47a08b553 Add overload for NiceUrl 2019-07-13 16:40:01 +02:00
Bjarne Fyrstenborg de9241bcf5 Add UmbracoHelper overload methods to get url by guid 2019-07-13 14:50:25 +02:00
Bjarne Fyrstenborg 7c03fe3c1f Adjust parameter 2019-07-13 14:49:35 +02:00
Bjarne Fyrstenborg 82eb241119 Add overload method for Udi 2019-07-13 14:49:05 +02:00
Bjarne Fyrstenborg 1073e6257c Adjust comments 2019-07-13 14:48:35 +02:00
Nathan Woulfe bc3e4847fe Merge branch '5768-log-viewer-chart-naming' of https://github.com/nathanwoulfe/umbraco-cms into 5768-log-viewer-chart-naming 2019-07-13 13:50:21 +10:00
Nathan Woulfe 1a7251909c fix empty array - was checking index against empty array, so condition was never met 2019-07-13 13:45:13 +10:00
Warren Buckley 61a18297d9 Make v8/dev now 8.2.0 2019-07-12 13:03:20 +01:00
Warren Buckley bdd413f9ee Merge branch 'v8/dev' into 5768-log-viewer-chart-naming 2019-07-12 12:30:32 +01:00
Bjarke Berg fd8ca35e63 Merge pull request #5869 from umbraco/v8/bugfix/logviewer-error-count
V8: Fixes LogViewer Error Count search result click
2019-07-12 12:56:08 +02:00
Warren Buckley fdd9aee773 Fixes LogViewer Error Count search result clickthrough to include errors & fatal without exception as well 2019-07-12 11:07:15 +01:00
Bjarke Berg 59bf24c461 Added null checks when *.dataTypeId is used 2019-07-12 11:22:31 +02:00
Bjarke Berg 2748c3635d Merge pull request #5863 from umbraco/v7/bugfix/5822-entityservice-overloads
Fixes Change to Entity Service GetByKey isn't breaking in 7.15 #5822
2019-07-12 09:29:45 +02:00
skttl d31e71a838 changes innerjoin to left join, to allow folders in sql query 2019-07-12 07:33:17 +02:00
Nathan Woulfe 3c2a92d3b6 map log values into logtypedata array - removes need to add these in the correct order. 2019-07-12 14:21:28 +10:00
Nathan Woulfe cf49e6160a critical => fatal 2019-07-12 14:20:28 +10:00
Shannon 2252db0d55 Fixes 5822 by reinstating optional method overloads of loadBaseType 2019-07-12 13:40:21 +10:00
Shannon ec93030e21 Merge branch 'v8/dev' of https://github.com/umbraco/Umbraco-CMS into v8/dev 2019-07-12 11:23:51 +10:00
Shannon 1d49c8626e Revert "V8: Don't show multiple open menus (take two) (#5609)"
This reverts commit 9ce996cbba.
2019-07-12 11:23:36 +10:00
Shannon 89bb94aa1a Fixes issue during upgrade where umbraco can't clear cdf log files 2019-07-12 10:57:26 +10:00
Warren Buckley 03a4b75176 Ran .\build SetUmbracoVersion 8.1.1 to bump version 2019-07-11 15:11:37 +01:00
Sebastiaan Janssen 943b54dcf7 Update 1_Bug.md 2019-07-11 11:55:01 +02:00
Warren Buckley 39bd18ec1a At some point we have upgraded Serilog.Filters.Expressions package & the signature/method name got changed to ByIncludingOnly() 2019-07-11 10:45:41 +01:00
Claus df896af476 adding build targets package. 2019-07-10 12:58:15 +02:00
Shannon e93ddff46b Merge branch 'nathanwoulfe-temp-5147-grid-reorder' into v8/dev 2019-07-09 11:01:11 +10:00
Nathan Woulfe 3144b51c91 fix behaviour on page load - don't add active class if sticky-bar is in viewport 2019-07-09 10:49:34 +10:00
Nathan Woulfe e92f68d040 improve variable naming 2019-07-09 10:46:29 +10:00
Nathan Woulfe 469054e9b3 No longer need scrollable-container attribute 2019-07-09 10:46:29 +10:00
Nathan Woulfe d17022d87d make it look pretty 2019-07-09 10:46:29 +10:00
Nathan Woulfe 6865629090 use position:sticky and IntersectionObserver instead of element cloning and position:fixed - much simpler. 2019-07-09 10:46:29 +10:00
Shannon a4749f201d Ensures luceneIndexer.WaitForIndexQueueOnShutdown is called even when not in MainDom 2019-07-08 23:03:20 +10:00
Shannon Deminick ad90264ef1 Merge pull request #5695 from linuselander/issue/5218
Enable removal of unpublished content from ExternalIndex
2019-07-08 19:34:25 +10:00
Shannon Deminick 9ba7e7742a Merge pull request #5801 from bielu/v8/dev
Remove last casting to LuceneIndex
2019-07-08 18:39:40 +10:00
arkadiuszbiel 6473f600c7 Remove last casting to LucenIndex 2019-07-08 08:48:49 +01:00
Claus 78735ff349 Merge pull request #5798 from kjac/v8-fix-save-member
V8: Can't save members without resetting their password
2019-07-08 09:29:37 +02:00
Claus 4b605b2580 Merge pull request #5799 from kjac/v7-fix-save-member
V7: Can't save members without resetting their password
2019-07-08 09:28:46 +02:00
Kenn Jacobsen 80d7f1b2c9 Make it possible to save a member without resetting the password 2019-07-07 11:36:26 +02:00
Kenn Jacobsen 1af43498d9 Make it possible to save a member without resetting the password 2019-07-07 11:16:02 +02:00
Nathan Woulfe 6329dfa629 Merge Andy's changes 2019-07-06 07:28:32 +10:00
Sebastiaan Janssen 5ada85df29 Provide the correct assembly redirects 2019-07-05 12:11:03 +02:00
Shannon 015ad64e30 Updates the exception thrown during upgrade to provide some meaningful feedback to the user. 2019-07-05 14:36:33 +10:00
Andy Butland 2cd0173534 Fixed incorrect label for "Fatal" errors on the log viewer pie chart.
Made the log viewer title variable so it either says "Log Overview For Today" or "Log Overview For Selected Time Period" (previously it said the former even if you'd adjusted the dates you were looking at.
Fixed up the selected date period display so the conjunction "to" is used between the dates when the selected time period is changed and querystring is updated.
Minor code tidy-up.
2019-07-04 14:35:06 +02:00
Bjarke Berg 6dbb988903 Refactor to limit to only v7.14.0 - V7.15.* 2019-07-04 11:44:05 +02:00
Bjarke Berg 926acb910e Forces the initial migration state of V7 sites that are allowed to be migrated into v7.14 state. 2019-07-04 11:44:05 +02:00
Nathan Woulfe a0bcfeddcc fix date range formatting on flatpickr - 'to' wasnt displayed after choosing a range 2019-07-04 11:48:02 +10:00
Nathan Woulfe c4b5483d8c make log naming and colors consistent between views 2019-07-04 11:19:10 +10:00
Sebastiaan Janssen 57e3187e3a For some reason this file was not part of the project any more :-( 2019-07-03 22:10:01 +02:00
Bjarke Berg 988d51c4c8 Merge pull request #5767 from umbraco/v8/bugfix/5671-fix-for-different-version-number-in-modelbuilder-models-in-live-mode
V8: Bugfix for Modelsbuilder models with different versions error
2019-07-03 13:43:00 +02:00
Bjarke Berg 4733256ca1 Merge pull request #5772 from umbraco/v8/bugfix/fix-n1-issue
Fixes N+1 Issues caused by the new bypass start nodes changes
2019-07-03 13:15:55 +02:00
Bjarke Berg 4133a1fe76 Refactored the ModelBindingExceptionFilter to also handle InvalidCastException, and also ensure the models are the same type.
Otherwise a infinite loop was introduced, when requesting a wrong model in the view.
Also refactored the why we do the retry from Html to Http headers
2019-07-03 13:14:35 +02:00
Shannon 37bf6fe938 Automatically refresh the page if we encounter a ModelBindingException 2019-07-03 19:15:54 +10:00
Shannon Deminick 31716e574c Update src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs
good catch!

Co-Authored-By: Bjarke Berg <mail@bergmania.dk>
2019-07-03 18:34:11 +10:00
Shannon 126c4cbd46 ensures media is rebuild and adds more notes 2019-07-03 18:25:19 +10:00
Shannon 7cc91f71c2 Fixes pure live mode when changing doc types 2019-07-03 18:11:00 +10:00
Shannon 7c52b9602c Reduce some allocations and in advertent SQL calls along with inadvertent enumeration of the entire cache, adds some notes 2019-07-03 17:43:30 +10:00
Bjarke Berg c5f1cc15fd Refactored dataTypeId when a guid into dataTypeKey 2019-07-03 08:33:30 +02:00
Shannon d089518681 Fixes SQL generation to populate the nodedto object of the datatypedto 2019-07-03 15:40:18 +10:00
Shannon cd6ef35bf9 comments out the fix during investigation - adds some notes 2019-07-03 15:17:51 +10:00
Shannon 47cdc79fcb Merge branch 'v8/dev' into v8/bugfix/5671-fix-for-different-version-number-in-modelbuilder-models-in-live-mode 2019-07-03 13:50:38 +10:00
Shannon f7382255c2 Fixes N+1 Issues caused by the new bypass start nodes changes 2019-07-03 13:16:40 +10:00
Shannon Deminick 2167eada0c Merge pull request #5764 from umbraco/v8/bugfix/fixes-for-bypass-securtiy-after-merge
V8: Bugfixes regarding the Bypass Security feature after merge from v7
2019-07-03 11:27:55 +10:00
Shannon df11935598 Revert and adjusts "Fixes issue when creating DateTypes of type Umbraco.MultiNodeTreePicker with type member, because -1 can't be casted to Udi" 2019-07-03 11:23:25 +10:00
Shannon d3b4b9fe64 fix merge 2019-07-03 11:10:34 +10:00
Shannon 33aff7ff61 Merge branch 'v8/dev' into v8/bugfix/fixes-for-bypass-securtiy-after-merge
# Conflicts:
#	src/Umbraco.Web/Editors/EntityController.cs
2019-07-03 11:04:34 +10:00
Sebastiaan Janssen 4d2c551b79 Merge branch 'v7/dev' into v8/dev 2019-07-02 22:01:34 +02:00
Sebastiaan Janssen 5b7ae7150f Fix weird merge 2019-07-02 21:55:54 +02:00
Sebastiaan Janssen 5bf29a907a Fixes #5206 2019-07-02 21:47:14 +02:00
Bjarke Berg 96d5bdd7b2 https://github.com/umbraco/Umbraco-CMS/issues/5671 - If modelsbuilder is in live mode, we need to clear cache for all document types when at least one is cleared. This is due to modelsbuilder updating all the models to different versions. 2019-07-02 15:26:54 +02:00
Bjarke Berg 7b4023fd5a Fixes issue when creating DateTypes of type Umbraco.MultiNodeTreePicker with type member, because -1 can't be casted to Udi 2019-07-02 13:17:47 +02:00
Bjarke Berg af72729905 Merge remote-tracking branch 'origin/v8/dev' into v8/dev 2019-07-02 13:03:29 +02:00
Claus d5bc54cf6c refixing #4708 - old merge error. 2019-07-02 13:00:50 +02:00
Claus 5625102e2c making EditorValidatorOfT public instead of internal. 2019-07-02 12:42:18 +02:00
Bjarke Berg 66abd7b50c Merge remote-tracking branch 'origin/v8/dev' into v8/dev 2019-07-02 11:31:14 +02:00
Bjarke Berg 2a9bcf0e98 Merge pull request #5763 from umbraco/v7/bugfix/fix-for-null-ref-exception-when-using-member-pickers
V7: Bugfix for Null ref-exception when using member pickers.
2019-07-02 11:20:53 +02:00
Bjarke Berg e6484687e5 Small fixes after v7 to v8 merge regarding the bypass security feature 2019-07-02 11:17:23 +02:00
Shannon 5da1e64bbc Merge branch 'v8/dev' of https://github.com/umbraco/Umbraco-CMS into v8/dev 2019-07-02 19:15:20 +10:00
Shannon 7b0979f9fd Fixes install.ps1 and updates sln to remove old ps1 file 2019-07-02 19:15:04 +10:00
Dave Woestenborghs 1a437c1c6a #5750 - fix outside click directive so it doesn't close dialogues from create action 2019-07-02 11:11:03 +02:00
Bjarke Berg 3c0565e516 Bugfix: Null ref-exception when using member pickers. 2019-07-02 10:56:44 +02:00
Claus 178b1ccf40 Merge pull request #5743 from umbraco/v8/feature/sourcelink-update
V8: Adds in SourceLink Debugging Feature
2019-07-02 10:49:11 +02:00
Shannon Deminick c03cd81c23 Merge pull request #5748 from umbraco/v8/feature/mb-embed-prepare
Prepare MB future
2019-07-02 18:18:07 +10:00
Stephan 3d3647b476 Fix tests 2019-07-02 10:11:51 +02:00
Stephan a4cac670df Merge branch 'v8/dev' into v8/feature/mb-embed-prepare 2019-07-02 09:12:00 +02:00
Shannon c414dd06cc updates package lock 2019-07-02 15:38:17 +10:00
Shannon 4ed746e4ef Fixes tree refreshing when changing users, fixes memory/event leak 2019-07-02 13:37:40 +10:00
Shannon c270d8ecac Merge remote-tracking branch 'origin/v7/dev' into v8/dev
# Conflicts:
#	build/NuSpecs/tools/Web.config.install.xdt
#	src/Umbraco.Core/Constants-DataTypes.cs
#	src/Umbraco.Core/Models/DataTypeDefinition.cs
#	src/Umbraco.Core/Models/DataTypeExtensions.cs
#	src/Umbraco.Core/Models/IDataTypeDefinition.cs
#	src/Umbraco.Core/Models/UmbracoEntity.cs
#	src/Umbraco.Core/Models/UserExtensions.cs
#	src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs
#	src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs
#	src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs
#	src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Core/Services/DataTypeService.cs
#	src/Umbraco.Core/Services/DateTypeServiceExtensions.cs
#	src/Umbraco.Core/Services/EntityService.cs
#	src/Umbraco.Core/Services/IContentService.cs
#	src/Umbraco.Core/Services/IDataTypeService.cs
#	src/Umbraco.Core/Services/IEntityService.cs
#	src/Umbraco.Core/Services/IRelationService.cs
#	src/Umbraco.Core/Services/Implement/RelationService.cs
#	src/Umbraco.Tests/Models/UmbracoEntityTests.cs
#	src/Umbraco.Tests/Plugins/PluginManagerTests.cs
#	src/Umbraco.Tests/Services/EntityServiceTests.cs
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
#	src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/search.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html
#	src/Umbraco.Web.UI/config/EmbeddedMedia.Release.config
#	src/Umbraco.Web.UI/config/EmbeddedMedia.config
#	src/Umbraco.Web.UI/packages.config
#	src/Umbraco.Web.UI/web.Template.config
#	src/Umbraco.Web/Editors/ContentController.cs
#	src/Umbraco.Web/Editors/EntityController.cs
#	src/Umbraco.Web/Editors/MediaController.cs
#	src/Umbraco.Web/HtmlHelperRenderExtensions.cs
#	src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs
#	src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs
#	src/Umbraco.Web/Mvc/RenderRouteHandler.cs
#	src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs
#	src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
#	src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs
#	src/Umbraco.Web/Trees/ContentTreeController.cs
#	src/Umbraco.Web/Trees/ContentTreeControllerBase.cs
#	src/Umbraco.Web/Trees/MediaTreeController.cs
#	src/Umbraco.Web/Trees/TreeControllerBase.cs
#	src/Umbraco.Web/Trees/TreeQueryStringParameters.cs
#	src/Umbraco.Web/UmbracoHelper.cs
#	src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs
#	src/Umbraco.Web/WebBootManager.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs
#	src/umbraco.cms/businesslogic/web/Access.cs
2019-07-02 12:24:05 +10:00
Shannon Deminick ade9bb7324 Merge pull request #5741 from umbraco/v8/merge/v715
Merging 7.15 - 8.1
2019-07-02 12:10:03 +10:00
Shannon 4134dd16df adds fixme note 2019-07-02 12:04:58 +10:00
Shannon f81588bb13 fixes search for content picker with ignore start nodes 2019-07-02 11:48:09 +10:00
Shannon 09793a1744 Fixes tests 2019-07-02 11:07:59 +10:00
Shannon ba7cd48b8f Merge remote-tracking branch 'origin/v8/dev' into v8/merge/v715
# Conflicts:
#	src/Umbraco.Core/Constants-DataTypes.cs
#	src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js
2019-07-02 10:49:20 +10:00
Shannon 640d2cedb9 Gets the link and media pickers working in the grid in the rte with ignore start nodes 2019-07-01 21:48:45 +10:00
Shannon 0a6237af04 Gets the multi url picker working with ignore start nodes 2019-07-01 21:13:11 +10:00
Shannon 503183331f gets media picker with ignore start nodes working in rte 2019-07-01 20:59:41 +10:00
Warren Buckley 3effc66b2c Need to update NuSpec to ensure the PDB are getting coppied into the bin when Nuget pacakeg installed into a project 2019-07-01 11:53:22 +01:00
Warren Buckley b64f303537 Mark the release PDB as portable too - the Powershell build uses Release not Debug 2019-07-01 11:20:07 +01:00
Warren Buckley 760f6a1647 Umbraco.Web.UI revert change as no real CS code to F11 into this project 2019-07-01 10:54:29 +01:00
Warren Buckley 0b64e34f05 Add in SourceLink Nuget to Umbraco.ModelsBuilder csproj 2019-07-01 10:19:09 +01:00
Warren Buckley f01be09075 Update sourcelink & set from full to portable 2019-07-01 10:13:31 +01:00
Shannon 1c5ed58074 gets media picker working with ignore user start nodes 2019-07-01 18:54:39 +10:00
Shannon 42d86f147f gets content picker ignore start nodes working, fixes descriptions 2019-07-01 18:23:36 +10:00
Shannon fa4acb255b fixes missing 'var' 2019-07-01 17:09:11 +10:00
Shannon 1885767ef1 Internalizes the new Anchor logic and removes it from the IContentService interface into extensions. 2019-07-01 16:33:09 +10:00
Shannon 80e6880bb7 more manual merging - getting anchors back in tinymce 2019-07-01 16:22:54 +10:00
Adam Nelson fabacd1689 V8: Fixes case issue on metaData.hasChildren in mini list view as well as .toLowerCase() issue on undefined scope.entityTypeFilter.filter (#5744) 2019-07-01 07:48:57 +02:00
Warren Buckley 23a7654cea Merge branch 'v8/dev' into v8/feature/sourcelink-update 2019-06-28 12:37:20 +01:00
Sebastiaan Janssen b2d019bfe1 Merge pull request #5270 from umbraco/v8/bugfix/5268-audit-repository
Bugfix Audit service
2019-06-28 10:53:42 +02:00
Sebastiaan Janssen 9f817bf032 Merge pull request #5742 from umbraco/v8/fix/typeloader-static-fields
Typeloader change fields set by constructor to non static
2019-06-28 10:51:45 +02:00
Rasmus John Pedersen 01c89bd338 Make fields set by constructor non static 2019-06-28 10:11:20 +02:00
Kenn Jacobsen e5956e4955 V8: Don't cast IContent to Content in DocumentRepository (#4611) 2019-06-28 09:19:11 +02:00
Shannon 958c3b147b more manual merging 2019-06-28 15:42:23 +10:00
Shannon 4a33ca99ba More manual merging 2019-06-28 15:03:52 +10:00
Shannon 568835f7e2 manual merging/fixing, project builds now, but need to manually merge the remaining 2019-06-28 13:24:13 +10:00
Shannon 84aa861a5b Merge remote-tracking branch 'origin/v7/dev' into v8/dev - Iniital commit (broken)
# Conflicts:
#	build/NuSpecs/tools/Web.config.install.xdt
#	src/Umbraco.Core/Constants-DataTypes.cs
#	src/Umbraco.Core/Models/DataTypeDefinition.cs
#	src/Umbraco.Core/Models/DataTypeExtensions.cs
#	src/Umbraco.Core/Models/IDataTypeDefinition.cs
#	src/Umbraco.Core/Models/UmbracoEntity.cs
#	src/Umbraco.Core/Models/UserExtensions.cs
#	src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs
#	src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs
#	src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs
#	src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Core/Services/DataTypeService.cs
#	src/Umbraco.Core/Services/EntityService.cs
#	src/Umbraco.Core/Services/IContentService.cs
#	src/Umbraco.Core/Services/IDataTypeService.cs
#	src/Umbraco.Core/Services/IEntityService.cs
#	src/Umbraco.Core/Services/IRelationService.cs
#	src/Umbraco.Core/Services/Implement/RelationService.cs
#	src/Umbraco.Tests/Models/UmbracoEntityTests.cs
#	src/Umbraco.Tests/Plugins/PluginManagerTests.cs
#	src/Umbraco.Tests/Services/EntityServiceTests.cs
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
#	src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/search.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/contentpicker/contentpicker.html
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/rte.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html
#	src/Umbraco.Web.UI/packages.config
#	src/Umbraco.Web.UI/web.Template.config
#	src/Umbraco.Web/Editors/ContentController.cs
#	src/Umbraco.Web/Editors/EntityController.cs
#	src/Umbraco.Web/Editors/MediaController.cs
#	src/Umbraco.Web/HtmlHelperRenderExtensions.cs
#	src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs
#	src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs
#	src/Umbraco.Web/Mvc/RenderRouteHandler.cs
#	src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs
#	src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
#	src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs
#	src/Umbraco.Web/Trees/ContentTreeController.cs
#	src/Umbraco.Web/Trees/ContentTreeControllerBase.cs
#	src/Umbraco.Web/Trees/MediaTreeController.cs
#	src/Umbraco.Web/Trees/TreeControllerBase.cs
#	src/Umbraco.Web/Trees/TreeQueryStringParameters.cs
#	src/Umbraco.Web/UmbracoHelper.cs
#	src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs
#	src/Umbraco.Web/WebBootManager.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseMediaTree.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs
#	src/umbraco.cms/businesslogic/web/Access.cs
2019-06-28 13:03:36 +10:00
leekelleher ee2ebc7d14 ReadOnlyValueController - enabled filters
Previously the code checks if the `config` is an array,
but with how config options are set, this would typically
be an object (dictionary). So the previous code would
never allow a filter to be set.

Now the check is on the object property.
2019-06-27 22:43:14 +02:00
Kenn Jacobsen 9ce996cbba V8: Don't show multiple open menus (take two) (#5609) 2019-06-27 22:42:05 +02:00
leekelleher 580ba79619 Icon Constants consistency
Updated the `Constants.Icons` and replaced the hard-coded strings with
 the const references.
2019-06-27 22:35:29 +02:00
Lee Kelleher fbe184ef6e Prevent deletion of System DataTypes (#5623) 2019-06-27 22:33:19 +02:00
Kenn Jacobsen 2f7bf413ed V8: Make dialogs prompt to discard changes on outside click and ESC (#5740) 2019-06-27 22:27:42 +02:00
Andy Butland 390613c796 Fixed issue with node deletion not removing related records from the public access tables 2019-06-27 22:20:31 +02:00
BatJan b3e3475bf5 Make sure padding is not overwritten by other selectors 2019-06-27 22:19:27 +02:00
Bjarne Fyrstenborg 5333b23c23 v8: Add keyboard support to slider (#5651) 2019-06-27 22:17:31 +02:00
Patrick de Mooij 734086fcf5 temp-5612: Being able to add your own roles/startnodes etc 2019-06-27 22:05:50 +02:00
Morten Bock 12dff9bca3 Reduce size of LocalizedText output. Refactor localizationService to not expose internal dictionary. Refactor controllers to not access dictionary directly. 2019-06-27 21:59:33 +02:00
Kenn Jacobsen f370e738da V8: Use an overlay style dialog for deleting Nested Content ite… (#5357) 2019-06-27 21:34:19 +02:00
Marc Goodson a018ed9e52 V7: Less-Urgent-But-Still-Quite-Important - Add Giphy EmbeddedMedia support (#5736) 2019-06-27 14:27:33 +02:00
Marc Goodson 17f73b88dc Urgent: Add Giphy embed provider support (#5731) 2019-06-27 14:26:36 +02:00
Mike 405e9a79be V8: Make the content tree keyboard accessible (#5729) 2019-06-27 14:07:37 +02:00
Kenn Jacobsen 4d90322842 Fix broken on-outside-click 2019-06-27 13:58:43 +02:00
Kenn Jacobsen a8b5d69be0 Fix confirmation for permissions dialog 2019-06-27 13:56:50 +02:00
Kenn Jacobsen 5ebd90aba5 Make searched media pickable in linkpicker 2019-06-27 13:52:07 +02:00
Sebastiaan Janssen bec909c284 Merge branch 'v8/dev' of https://github.com/umbraco/Umbraco-CMS into v8/dev 2019-06-27 13:48:43 +02:00
Sebastiaan Janssen 46e0b08d65 Merge remote-tracking branch 'origin/v8/bugfix/fix-atroot' into v8/dev 2019-06-27 13:48:16 +02:00
Stephan 7a178be031 Fix getting content AtRoot 2019-06-27 13:29:35 +02:00
Kenn Jacobsen 9d14c9e0b7 Don't explicitly allow deleting the current editor's own content 2019-06-27 13:28:54 +02:00
Warren Buckley ef19633a90 Merge pull request #5134 from umbraco/v8/bugfix/image-cropper-converter
The ImageCropperPropertyValueEditor doesn't convert values in ConvertDbToString correctly
2019-06-27 12:20:43 +01:00
Sebastiaan Janssen 80ffd026f6 Reverts PR #5693 - we need to update the linkpicker search instead to return the correct results for us 2019-06-27 13:18:45 +02:00
Kenn Jacobsen cb7300688c Don't prompt for changes when cancelling empty properties 2019-06-27 12:53:58 +02:00
Kenn Jacobsen 040ebfe9dd Add auto-focus to the default action in overlay dialogs 2019-06-27 12:49:53 +02:00
Stephan 44e567aa34 Prepare MB future
- implement manifest filters to tweak manifests after they have been parsed
- make IEditorValidator public
- stop relying on InternalsVisibleTo Umbraco.ModelsBuilder
2019-06-27 12:42:40 +02:00
Michaël Vanbrabandt 8c5f253b41 V8: Add validation to the Version and UmbracoVersion properties (#5559) 2019-06-27 11:45:48 +02:00
Bjarke Berg 7b99e55148 Merge remote-tracking branch 'origin/v8/dev' into v8/dev 2019-06-27 10:25:12 +02:00
Bjarke Berg ba27eff5cf Added missing using in macro template 2019-06-27 10:24:53 +02:00
Shannon 01d5a12039 when syncing the picker to a path, activate the node 2019-06-27 18:00:45 +10:00
Claus 6d4d26009f Merge pull request #5730 from umbraco/v8/bugfix/umbracomapper-null-property
UmbracoMapper shouldn't throw an exception when trying to map a source prop being null
2019-06-27 08:35:57 +02:00
Bjarke Berg 857a8b163d build fix 2019-06-27 08:03:08 +02:00
Bjarke Berg acbe82f4c8 Merge pull request #5688 from umbraco/v8/bugfix/expand-tree-fix
Feature in v7 based on #2682 that wasn't merged upwards to v8
2019-06-27 07:53:15 +02:00
Shannon fad33a97b2 don't throw JS exception when no MediaPath, instead warn. 2019-06-27 15:47:25 +10:00
Shannon Deminick 3bfd9b71e2 Merge pull request #5312 from umbraco/v8/feature/5170-IPublishedContent
Refactor IPublishedContent
2019-06-27 14:49:42 +10:00
Shannon ef714ac258 Merge remote-tracking branch 'origin/v8/dev' into v8/feature/5170-IPublishedContent
# Conflicts:
#	src/Umbraco.Web/UmbracoHelper.cs
2019-06-27 14:44:33 +10:00
Claus 975816ddd7 UmbracoMapper shouldn't throw an exception when trying to map a source property being null. 2019-06-26 23:10:46 +02:00
Warren Buckley 8831860174 Merge pull request #5728 from umbraco/v8/feature/AB-1085
V8: https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/108…
2019-06-26 14:18:03 +01:00
Bjarke Berg fbf3015de4 Merge remote-tracking branch 'origin/v8/dev' into v8/bugfix/expand-tree-fix
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js
2019-06-26 14:38:19 +02:00
Bjarke Berg be587b2064 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1085 - Creates a custom IAntiForgeryAdditionalDataProvider that provides and validates custom token data in the request which allows having a custom AF token per form created with BeginUmbracoForm 2019-06-26 14:15:26 +02:00
Stephan 347c2e8238 Upgrade to ModelsBuilder 8.1.0 2019-06-26 12:30:13 +02:00
Warren Buckley f5fde0f19e Merge pull request #5719 from umbraco/v8/bug/5700
Fixes Macro Rendered in Richtext Editor when not configured to do so
2019-06-26 10:07:44 +01:00
Warren Buckley ac586c5207 Merge pull request #5715 from umbraco/v7/bugfix/AB-1085/antiforgery-per-form
Custom IAntiForgeryAdditionalDataProvider implementation
2019-06-26 09:23:32 +01:00
Bjarke Berg 8033931e31 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1085 - Fixed merge conflict 2019-06-26 09:58:01 +02:00
Bjarke Berg 8e29810598 Merge remote-tracking branch 'origin/v7/dev' into v7/bugfix/AB-1085/antiforgery-per-form 2019-06-26 09:52:44 +02:00
Shannon Deminick be96e2cf08 Merge pull request #5713 from umbraco/v7/feature/AB-1479-Reintroduce-the-bypass-security-option-in-pickers
V7: Reintroduce the bypass security option in pickers
2019-06-26 17:02:17 +10:00
Shannon 534ee67ad2 Merge branch 'v7/feature/AB-1479-Reintroduce-the-bypass-security-option-in-pickers' of https://github.com/umbraco/Umbraco-CMS into v7/feature/AB-1479-Reintroduce-the-bypass-security-option-in-pickers 2019-06-26 16:49:00 +10:00
Shannon 571a3bc257 fixes test 2019-06-26 16:48:39 +10:00
Kenn Jacobsen c12bdaacbf Show the list view paging component even when there are less than 10 pages :) 2019-06-26 08:10:39 +02:00
Bjarke Berg e7a30d0a5d https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1085 - Fixes for gulp build 2019-06-26 07:39:34 +02:00
Shannon a55323176f Updates EntityController to support passing in the dataTypeId for the GetChildren methods and updates the mediapicker to pass along that data 2019-06-26 14:35:36 +10:00
Shannon 1b83e0a87d cleanup 2019-06-26 13:49:45 +10:00
Shannon ca15f340b0 Fixes a bunch of N+1, content/media trees should be much more snappy 2019-06-26 13:32:16 +10:00
Shannon 23b8e1cce8 Removes the remaining part of the EntityRepository that was loading in ALL properties for media which we don't want whatsoever which means some other code is cleaned up/removed 2019-06-26 13:31:04 +10:00
Shannon cf53ba363d Internalizes new methods classes + cleanup 2019-06-26 13:29:05 +10:00
Rasmus Olsen 1c4b262c57 Fix/5489 actions button left margin (#5718) 2019-06-25 18:38:46 +02:00
Kim Rauff Schurmann 90d591e5a8 Fixed validation of fileextension. 2019-06-25 18:21:58 +02:00
Dennis Meinert Pedersen ad121bd758 Highlight when tabbing to umb-toggle 2019-06-25 16:20:16 +02:00
tiffy74 8d67e39e9a secondary menu tab first commit (#5701) 2019-06-25 15:58:56 +02:00
Kenn Jacobsen bd8e344736 Support keyboard input in date/time picker 2019-06-25 15:31:56 +02:00
Claus 014eba971e adding a test for enum mapping between equal enums of different types. 2019-06-25 15:29:32 +02:00
Bjarke Berg 2f309a2fd6 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1085 - moved the code that adds the ufprt token to the context items, into the constructor of UmbracoForm. Because it needs to happen before the @Html.AntiForgeryToken() is called. The dispose method is too late. 2019-06-25 15:09:37 +02:00
Sebastiaan Janssen a5fb2d2025 Replace visually-hidden in favor of sr-only as discussed in #5664 2019-06-25 14:53:58 +02:00
Rachel Breeze 40311f8590 V8: Accessibility improvements for textbox validation (#5664) 2019-06-25 14:50:40 +02:00
Jannik Anker a0c51fb212 Update da.xml
Misc Danish language "fixes", including some in the new language variants stuff
2019-06-25 14:22:53 +02:00
Stephan b306e41560 NuCache - failover to database when local db fails to load 2019-06-25 13:26:50 +02:00
Bjarke Berg 9f45d41a4a https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479
- Test fixes
2019-06-25 13:18:15 +02:00
Stephan e8d6daf59a NuCache - be more tolerant when cache is weird 2019-06-25 12:54:16 +02:00
Sebastiaan Janssen a0966be565 Fixes Macro Rendered in Richtext Editor when not configured to do so. #5700 2019-06-25 12:36:03 +02:00
Warren Buckley ba064ba4f5 Merge pull request #5717 from umbraco/v8/bug/5708
V8/bug/5708
2019-06-25 11:34:46 +01:00
Bjarke Berg 1994194656 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479
- Review fixes
2019-06-25 11:51:02 +02:00
Sebastiaan Janssen 1da2c00f0a Fix logic & make code easier to follow 2019-06-25 11:41:33 +02:00
Sebastiaan Janssen 71d076aba2 Dashboards not obeying c# access rules #5708
The invisible negator strikes again.
2019-06-25 11:34:26 +02:00
Claus c7ec1deee6 Merge pull request #5703 from kjac/v8-fix-property-settings-focus
V8: Set focus on "Mandatory" after picking a property type
2019-06-25 10:54:38 +02:00
Bjarke Berg 36559b8761 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - Fix for NullReferenceException 2019-06-25 09:22:56 +02:00
Bjarke Berg 8fe7c5599a Merge remote-tracking branch 'origin/v7/feature/AB-1479-Reintroduce-the-bypass-security-option-in-pickers' into v7/feature/AB-1479-Reintroduce-the-bypass-security-option-in-pickers
# Conflicts:
#	src/Umbraco.Core/Services/ContentService.cs
2019-06-25 09:22:43 +02:00
Bjarke Berg 4dd325cec9 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - Fix for NullReferenceException 2019-06-25 09:22:30 +02:00
Bjarke Berg d558646d75 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - Fix for NullReferenceException 2019-06-25 09:21:51 +02:00
Bjarke Berg afac4bb918 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - missing entityResource injection 2019-06-25 09:18:30 +02:00
Bjarke Berg 0869bf27c7 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - clean up 2019-06-25 08:26:01 +02:00
Bjarke Berg 383a8617ce https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - Fixed test 2019-06-25 08:19:50 +02:00
Bjarke Berg 3865f4fb50 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - bugfix - wrong constant used 2019-06-25 08:15:06 +02:00
Shannon Deminick d7d58644e5 Merge pull request #5684 from umbraco/v8/bugfix/AB-1447-Fix-for-update-checker
V8: Fix for update checker error
2019-06-25 15:13:04 +10:00
Shannon 3e74bbfb45 Creates a custom IAntiForgeryAdditionalDataProvider that provides and validates custom token data in the request which allows having a custom AF token per form created with BeginUmbracoForm 2019-06-25 14:35:28 +10:00
Bjarke Berg 966b07ba1c https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - Changed entity service to only return small model with media path. And updated media picker to use entity service when loading data. 2019-06-24 21:12:38 +02:00
Claus 56669b5c84 Merge pull request #5709 from umbraco/v8/bugfix/fix-js-tests-currentuser-auth
Fixes JS Unit Test from commit 9fffdb4
2019-06-24 14:59:50 +02:00
Warren Buckley 60ed6f6b20 Remove snupkg aka newer Symbol nuget packages 2019-06-24 13:18:20 +01:00
Warren Buckley 903c163a57 Merge branch 'v8/bugfix/fix-js-tests-currentuser-auth' into v8/feature/sourcelink-update 2019-06-24 11:31:43 +01:00
Warren Buckley 41b8294ce3 Fixes build as commit 9fffdb4 added a check/call to GetCurrentUser and JS test was failing for unexpected HTTP call to GetCurrentUser 2019-06-24 10:39:47 +01:00
Bjarke Berg d4311fe4ab https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - Replaced client side method to get Auchors with a server side version, and eliminated the use of contentResource in linkPikers 2019-06-24 10:52:35 +02:00
Bjarke Berg eab597a2a8 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - fix for js linter 2019-06-24 08:58:25 +02:00
Warren Buckley 003ee1a991 Added in Microsoft.SourceLink.GitHub Nuget package 2019-06-23 19:57:43 +01:00
Warren Buckley 601d48277e Update NuSpecs with the XML MetaData for SourceLink 2019-06-23 19:53:57 +01:00
Kenn Jacobsen aed6ef28e6 Fix overflow for specific node permissions 2019-06-23 13:19:18 +02:00
Kenn Jacobsen 339ae32c3d Fix the overflow wrapping for repeatable textstrings 2019-06-23 13:15:14 +02:00
Kenn Jacobsen 7d990a2cbb Enforce max width on numeric inputs 2019-06-23 13:14:33 +02:00
Dennis Adolfi b98812b119 V8/dev missing translations (#5639) 2019-06-23 13:13:42 +02:00
Steve Temple fafd045ed2 V8 Duplicate comments in MediaService (#5636)
* Remove duplicate comments in MediaService

* Remove temp files
2019-06-23 13:12:46 +02:00
Kenn Jacobsen acf63fc74d Fix the back button for media list views 2019-06-23 13:10:52 +02:00
Kenn Jacobsen 85565f2c5f V8: Fix the Nested Content title overflow (#5594) 2019-06-23 13:09:12 +02:00
Chriztian Steinmeier ac6625a80c Handle loginModel.RedirectUrl in Login partial (#5587) 2019-06-23 13:07:43 +02:00
Kenn Jacobsen 6d7b439aec Support negative values for integer and decimal property editors 2019-06-23 13:04:44 +02:00
Andy Butland 9fffdb407a Provided alternative messages for users that do and do not have access to document/media types for when trying to create content or media and no types can be created.
Where they do, provided a link to go to the page where child nodes can be edited.
2019-06-23 13:02:15 +02:00
Kenn Jacobsen 9170061810 V8: Add option to keep the mini profiler active at all times in debug mode (#5560) 2019-06-23 12:40:23 +02:00
Kenn Jacobsen a7da3d741f V8: Add keyboard support for navigating search results (#5500) 2019-06-23 12:30:17 +02:00
Kenn Jacobsen 255bd10296 V8: Use a picker to select allowed types for MNTP (#5506) 2019-06-23 12:25:15 +02:00
Mike 4fca0bb735 V8: Accessibility improvements for top header (#5544) 2019-06-23 12:10:16 +02:00
Kenn Jacobsen f7aaad86c5 Set focus on "Mandatory" after picking a property type when creating a new property 2019-06-21 15:56:36 +02:00
Sebastiaan Janssen 8d12170def Correct NuGet transform for the web.config file in the Views folder 2019-06-21 14:58:58 +02:00
Bjarke Berg d2655a9f2f Merge remote-tracking branch 'origin/v7/dev' into v7/feature/AB-1479-Reintroduce-the-bypass-security-option-in-pickers 2019-06-21 13:59:11 +02:00
Bjarke Berg c4c2082fa9 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 - Only allow "ignoreUserStartNodes" for custom data types and not the default build in. 2019-06-21 13:57:17 +02:00
Sebastiaan Janssen 40d4a8fe6a Modelsbuilder is asking for too old a version of CodeAnalysis, Immutable and Metadata dependencies 2019-06-21 13:32:53 +02:00
Bjarke Berg 4c443b9e2e Merge pull request #5672 from umbraco/v8/feature/0000-avoid-too-long-locking-when-delete-content
Small fixes for backoffice under load.
2019-06-21 11:58:37 +02:00
Bjarke Berg 2898203cb9 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1479 Bugfixes for the "Bypass security" feature + filter out possible sensitive data 2019-06-21 10:50:23 +02:00
Sebastiaan Janssen 5ebdfc7b1c Previously added a few too many binding redirects to the web.config 2019-06-21 10:22:16 +02:00
Bjarke Berg 31d7e58191 Merge remote-tracking branch 'origin/v7/dev' into v7/feature/AB-1479-Reintroduce-the-bypass-security-option-in-pickers 2019-06-21 10:20:51 +02:00
Sebastiaan Janssen ad4416f663 So apparently Microsoft.CodeAnalysis.CSharp version 1.3.2 contains the dll that has the version 1.3.1.. very confusing 2019-06-21 10:07:45 +02:00
Sebastiaan Janssen b55d2a8a41 Modelsbuilder is asking for too old a version of the CodeAnalysis dependency 2019-06-21 09:56:01 +02:00
Sebastiaan Janssen 17a4799b97 7.15 release needs a few more assembly redirects (#5698)
7.15 release needs a few more assembly redirects
2019-06-21 08:19:35 +02:00
Shannon b0121c44b1 Merge branch 'v8/dev' into v8/feature/5170-IPublishedContent 2019-06-21 16:09:43 +10:00
Shannon be9d8e7da7 null checks on UrlHelperRenderExtensions when requesting image crop urls, if there's a null we'll just return an empty string 2019-06-21 16:08:54 +10:00
Shannon d129989c3d Removes irrelevant GetAbsoluteMediaUrl method now that there is both a media url provider and urls have been refactored in this PR, this was overlooked with the media url provider PR 2019-06-21 16:07:07 +10:00
Shannon 2870ce5e0a a perf change that in ContentCacheRefresher it doesn't iterate payloads if there is no real Id 2019-06-21 15:48:10 +10:00
Shannon da1e2680cb Fixes ContentStore when it's building the cache from sources, adds TODO notes, questions, concerns, etc.... 2019-06-21 15:47:47 +10:00
Shannon cd2ce2486a Fixes debugger display attribute 2019-06-21 15:46:16 +10:00
Shannon 5d4f2ec697 Fixes issue with ImageCropperTemplateExtensions since it wasn't re-mapped to the new method definition 2019-06-21 15:45:12 +10:00
Shannon c2cb85f1cd Merge branch 'v8/dev' into v8/feature/5170-IPublishedContent
# Conflicts:
#	src/Umbraco.Web.UI.Client/package-lock.json
2019-06-21 15:06:43 +10:00
Bjarke Berg 4df838c20c https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1358 - Changed the ignoreUserStartNodes in public endpoints to the data type id, and then look up the setting 2019-06-20 16:02:42 +02:00
Sebastiaan Janssen 4e44871671 The NuGet packages needs an extra DotNetCompilerPlatform transform to be sure it gets applied as it sometimes didn't
Added SignalR binding redirect for Umbraco Cloud
Added System.Web.Http.WebHost binding redirect for uCommerce
2019-06-20 15:57:31 +02:00
Niels Lyngsø 37d3692cd0 Merge pull request #5694 from kjac/v8-fix-editor-state-comma-dangle
V8: Fix "comma-dangle" gulp build error (editorstate.service.js)
2019-06-20 12:56:31 +02:00
Shannon f4b2ff93fc Fixes how Umbraco Context is injected into DI so that LightInject doesn't try to control it's lifetime. 2019-06-20 19:10:32 +10:00
Shannon 5ea6ebcc66 Revert "Fixes up UmbracoContextFactory to ensure it's not returning a disposed Umbraco context"
This reverts commit fcfb107653.
2019-06-20 17:58:40 +10:00
Shannon f6ac64f705 makes TreeChangeExtensions public 2019-06-20 15:53:25 +10:00
Shannon fcfb107653 Fixes up UmbracoContextFactory to ensure it's not returning a disposed Umbraco context 2019-06-20 15:40:57 +10:00
Linus Elander 7557c584d8 Adjusts conditions for which indexes should be affected when a node is unpublished 2019-06-19 21:41:47 +02:00
Kenn Jacobsen f829bb8023 Fix "comma-dangle" gulp build error 2019-06-19 18:40:42 +02:00
Bjarke Berg 1dd2c1cb91 Revert "Revert "U4 10147 - Bypass User Security option in pickers (#2441)""
This reverts commit 994c6eed
2019-06-19 14:30:44 +02:00
Niels Lyngsø 23702ee4dc Fixes notifications issue for new variant saving, allows "soft redirect" for creating (#5646)
Fixes notifications issue for new variant saving, allows "soft redirect" for creating
2019-06-19 12:34:33 +02:00
Shannon 5c2b0647f3 Gets the feature in v7 based on #2682 that wasn't merged upwards to v8 and found some issues along the way like not filtering the mini list view properly along with not returning the content type alias in the entity controller 2019-06-19 16:42:04 +10:00
Shannon c7a725ad94 Merge remote-tracking branch 'origin/v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js
#	src/Umbraco.Web.UI.Client/src/common/services/tree.service.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js
2019-06-19 13:38:35 +10:00
Shannon 5c6a9480a6 remove unneeded method 2019-06-19 13:32:26 +10:00
Shannon c1be8e3f00 Merge branch 'v7/dev' of https://github.com/umbraco/Umbraco-CMS into v7/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js
2019-06-19 13:31:43 +10:00
Shannon d8dbda8e94 Merge branch 'kjac-v7-fix-treepicker-allowed-nodes' into v7/dev 2019-06-19 13:30:33 +10:00
Shannon a0ab7ace07 Makes the treeNodeExpanded event raised during tree syncing 2019-06-19 13:29:54 +10:00
Shannon 7c27189e2e Merge branch 'v7-fix-treepicker-allowed-nodes' of https://github.com/kjac/Umbraco-CMS into kjac-v7-fix-treepicker-allowed-nodes 2019-06-19 13:01:50 +10:00
Sebastiaan Janssen 56545ad7f1 Revert "Merge branch 'v7/dev' into v8/dev"
This reverts commit 7db0440b5c.

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.prevalues.html
#	src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs
2019-06-18 19:18:48 +02:00
Bjarke Berg 832dc7f4a5 Changed superadmin back to admin again 2019-06-18 18:44:22 +02:00
Warren Buckley 62dc68e7b2 Merge pull request #5401 from umbraco/v8/feature/logviewer-change-time-period
Added support for changing the dates of the log files
2019-06-18 15:09:16 +01:00
Bjarke Berg 348c79d841 Init preflight check 2019-06-18 15:19:27 +02:00
Sebastiaan Janssen 994c6eed50 Revert "U4 10147 - Bypass User Security option in pickers (#2441)"
This reverts commit cc9a7ff942.

# Conflicts:
#	src/Umbraco.Web/Editors/ContentController.cs
#	src/Umbraco.Web/Editors/EntityController.cs
#	src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
2019-06-18 13:07:40 +02:00
Bjarke Berg 9614740410 Added timeout for 2 seconds. Dont make sense to wait longer for this 2019-06-18 11:44:56 +02:00
Stephan 62e6168e03 Revert ContentStore changes - have to find the bug now 2019-06-18 11:36:53 +02:00
Warren Buckley b6d762c279 Merge pull request #5683 from umbraco/v8/bugfix/5600-rte-full-screen
Fixes #5600 Adds fullscreen plugin/command to the RTE and allows it to sit in front of the tree when used
2019-06-18 10:12:03 +01:00
Bjarke Berg ab93c4ff2d clean up 2019-06-18 11:02:43 +02:00
Bjarke Berg 473c39f7c4 Still being able to change date period if the period has too much data 2019-06-18 10:53:00 +02:00
Bjarke Berg 811aea7898 Added missing files 2019-06-18 10:27:56 +02:00
Bjarke Berg 07358eb46d Merge remote-tracking branch 'origin/v8/dev' into v8/feature/logviewer-change-time-period
# Conflicts:
#	src/Umbraco.Core/Logging/Viewer/JsonLogViewer.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
2019-06-18 10:20:48 +02:00
Stephan 067af64dff Cleanup ChildrenForAllCultures 2019-06-18 09:46:29 +02:00
Bjarke Berg cb428bb288 https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1447: Catch the SoapException which happends when a timeout occurs on the server. Also change such that this check is only executed for super admins. 2019-06-18 08:11:18 +02:00
Shannon b69c981100 Fixes #5600 Adds fullscreen plugin/command to the RTE and allows it to sit in front of the tree when used 2019-06-18 16:02:36 +10:00
Shannon 1709879b14 Merge remote-tracking branch 'origin/v7/dev' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
#	src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js
#	src/Umbraco.Web.UI.Client/src/views/users/views/user/details.html
2019-06-18 14:15:50 +10:00
Shannon cff5046a9e Merge branch 'kjac-v7-fix-linkpicker-anchor-link-without-url' into v7/dev 2019-06-18 14:09:11 +10:00
Shannon 9f6da2ca4b Merge branch 'v7-fix-linkpicker-anchor-link-without-url' of https://github.com/kjac/Umbraco-CMS into kjac-v7-fix-linkpicker-anchor-link-without-url 2019-06-18 14:08:45 +10:00
Shannon Deminick 0c8b0edcda Merge pull request #5472 from umbraco/v8/feature/5123-rte-data-udi-images
RTE data-udi and image paths
2019-06-18 13:40:20 +10:00
Shannon 68f9e89a32 Merge branch 'v8/dev' into v8/feature/5123-rte-data-udi-images 2019-06-18 13:05:37 +10:00
Shannon fecadeec51 Fixes issue with nucache and rebuilding and fixes ChildrenForAllCultures to deal with unpublished children 2019-06-18 11:57:36 +10:00
Warren Buckley d3b675a213 Merge pull request #5640 from umbraco/v8/feature/0000-dont-mark-default-language
Remove bold from default variant.
2019-06-17 13:39:28 +01:00
Warren Buckley 316ab6becb Merge pull request #5536 from umbraco/v8/bugfix/5345-dragging-rte-in-grid
5345 dragging rte in grid
2019-06-17 13:15:39 +01:00
Bjarke Berg 9a45bda430 Merge pull request #5658 from umbraco/v8/bugfix/3498-EntityService-updates
V8/bugfix/3498 entity service updates
2019-06-17 13:37:58 +02:00
Stephan 7c11943836 Merge remote-tracking branch 'origin/v8/feature/5170-IPublishedContent' into v8/feature/5170-IPublishedContent 2019-06-17 13:24:28 +02:00
Stephan 94d2a5cbad Bugfix published cache and children 2019-06-17 13:03:01 +02:00
Bjarke Berg 99cabe564d Merge pull request #5673 from umbraco/v7/bugfix/5665-non-admin-edit-user-group
V7: Resolved issue where adding non-admin user group editor to group already exists
2019-06-17 09:13:42 +02:00
Bjarke Berg 600c8ebbbf Merge pull request #5670 from AndyButland/defect/5665-non-admin-edit-user-group
V8: Resolved issue where adding non-admin user group editor to group already exists
2019-06-17 08:48:38 +02:00
Andy Butland 15b1d35c17 https://github.com/umbraco/Umbraco-CMS/issues/5665: Resolved issue where adding non-admin user group editor to group already exists 2019-06-17 08:43:24 +02:00
Bjarke Berg 46f4984add https://umbraco.visualstudio.com/D-Team%20Tracker/_workitems/edit/1357: Fixed issue where too fast change between sections, leads to a wrong tree (The first requested) shown in the menu. 2019-06-17 07:20:11 +02:00
Bjarke Berg e39e132feb Cleaned up, such that we are not in doubt about whether the page variable should have been increased. 2019-06-17 07:19:38 +02:00
Andy Butland 17b479275e Resolved issue where adding non-admin user group editor to group already exists 2019-06-16 12:20:52 +02:00
Shannon 9927ff3c86 removes commented out code 2019-06-13 23:47:48 +10:00
Shannon 81077c2681 Gets the entity service returning a media's url property and allows this to be used in the media picker. 2019-06-13 23:39:36 +10:00
Shannon 16f6bbcbd4 init commit of removing code for entity service that loads in any property data 2019-06-13 18:45:33 +10:00
Warren Buckley c597da8f97 Merge pull request #5423 from umbraco/v7/bugfix/4144-member-password-manual-change-fix
Fixes #4144 - AllowManuallyChangingPassword Regression Fix
2019-06-13 08:53:17 +01:00
Shannon 5775a8b614 fixes if explicitly resetting password 2019-06-13 16:50:15 +10:00
Bjarke Berg cc4a7653e5 Bugfix: Still load trees even when a tree is about to be loaded. But only use the result, if we are still on the correct section. This eliminates the issue where a wrong tree is shown in a section. 2019-06-12 14:31:01 +02:00
Bjarke Berg 5b546cc425 Bugfix: Don't increase the page number in the loop, because the items are moved to another subtree, and therefore is not any longer part of the descendants call. Now we avoid the leak of items when moving to recycle bin. 2019-06-12 10:39:34 +02:00
Sebastiaan Janssen 7f5f304d2d Merge pull request #5642 from umbraco/v8/feature/0000-Gulp-root-folder-as-real-root
Gulp root variable change
2019-06-12 10:25:13 +02:00
Niels Lyngsø 0827ced915 removed App_Plugins 2019-06-12 09:43:59 +02:00
Stephan 9c252131f7 Better exception message in NuCache 2019-06-12 08:55:03 +02:00
Shannon dec042fce4 adds Id to panic exception 2019-06-12 16:28:33 +10:00
Shannon 8eafadc29b adds some more info to panic exceptions 2019-06-12 14:00:28 +10:00
Shannon c5347a97ce Fixes setting the reset flag when allowManuallyChangingPassword is disabled 2019-06-12 12:51:26 +10:00
Niels Lyngsø 05f479a58f changed root folder to only contain the URI for root, not including /Umbraco/ 2019-06-11 14:14:44 +02:00
Sebastiaan Janssen 39d93a7ace Spelling mistake IContentFinder function (#5616)
Spelling mistake IContentFinder function
2019-06-11 13:00:27 +02:00
Niels Lyngsø 5ddf21f09f remove bold from lists of language variants 2019-06-11 10:03:04 +02:00
Niels Lyngsø 7b3ab72105 remove bold from default variant. 2019-06-11 09:48:45 +02:00
Patrick de Mooij e59d75f4f9 Spelling mistake IContentFinder function 2019-06-07 16:42:53 +02:00
Sebastiaan Janssen e3b2d427a4 Merge branch 'v7/dev' into v8/dev
# Conflicts:
#	build/Modules/Umbraco.Build/Get-UmbracoBuildEnv.ps1
#	build/Modules/Umbraco.Build/Umbraco.Build.psm1
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	build/NuSpecs/UmbracoCms.nuspec
#	src/SQLCE4Umbraco/SqlCE4Umbraco.csproj
#	src/SQLCE4Umbraco/app.config
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Core/app.config
#	src/Umbraco.Core/packages.config
#	src/Umbraco.Tests.Benchmarks/app.config
#	src/Umbraco.Tests.Benchmarks/packages.config
#	src/Umbraco.Tests/App.config
#	src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs
#	src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs
#	src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs
#	src/Umbraco.Tests/packages.config
#	src/Umbraco.Web.UI.Client/bower.json
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI/Properties/Settings.Designer.cs
#	src/Umbraco.Web.UI/config/imageprocessor/cache.config
#	src/Umbraco.Web.UI/config/imageprocessor/processing.config
#	src/Umbraco.Web.UI/packages.config
#	src/Umbraco.Web.UI/web.Template.Debug.config
#	src/Umbraco.Web.UI/web.Template.config
#	src/Umbraco.Web/Editors/ContentTypeControllerBase.cs
#	src/Umbraco.Web/Editors/EntityController.cs
#	src/Umbraco.Web/Editors/MediaController.cs
#	src/Umbraco.Web/Mvc/Strings.Designer.cs
#	src/Umbraco.Web/Properties/Settings1.Designer.cs
#	src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
#	src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs
#	src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs
#	src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs
#	src/Umbraco.Web/app.config
#	src/Umbraco.Web/packages.config
#	src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs
#	src/UmbracoExamine/UmbracoExamine.csproj
#	src/UmbracoExamine/app.config
#	src/UmbracoExamine/packages.config
#	src/umbraco.MacroEngines/Resources/Strings.Designer.cs
#	src/umbraco.MacroEngines/app.config
#	src/umbraco.MacroEngines/packages.config
#	src/umbraco.MacroEngines/umbraco.MacroEngines.csproj
#	src/umbraco.businesslogic/app.config
#	src/umbraco.businesslogic/packages.config
#	src/umbraco.businesslogic/umbraco.businesslogic.csproj
#	src/umbraco.cms/app.config
#	src/umbraco.cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs
#	src/umbraco.cms/packages.config
#	src/umbraco.cms/umbraco.cms.csproj
#	src/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs
#	src/umbraco.controls/app.config
#	src/umbraco.controls/umbraco.controls.csproj
#	src/umbraco.datalayer/app.config
#	src/umbraco.datalayer/umbraco.datalayer.csproj
#	src/umbraco.editorControls/app.config
#	src/umbraco.editorControls/mediapicker/MediaChooserScripts.Designer.cs
#	src/umbraco.editorControls/umbraco.editorControls.csproj
#	src/umbraco.interfaces/umbraco.interfaces.csproj
#	src/umbraco.providers/app.config
#	src/umbraco.providers/umbraco.providers.csproj
2019-06-07 16:05:44 +02:00
Sebastiaan Janssen 22f54394fb Fix method signatures to prevent breaking changes (just like what I'd already done in v8) 2019-06-07 16:02:03 +02:00
Sebastiaan Janssen 57c368f70d Bumps version to 7.15.0 2019-06-07 14:32:02 +02:00
Stephan 14a056f4f4 Fix and cleanup 2019-06-07 11:15:58 +02:00
Kenn Jacobsen 580de6befe Linkpicker should support anchor links without base URL 2019-06-07 09:03:35 +02:00
Bjarke Berg 0120dc6ea3 https://github.com/umbraco/Umbraco-CMS/issues/5574 - Fixes issue when… (#5575) 2019-06-07 09:01:15 +02:00
Sébastien Sougnez 4be6a48fb2 Update tinymce version to 4.9.4 in v7 (#4703) 2019-06-06 17:42:12 +02:00
Sebastiaan Janssen 53731049de Updates .NET Framework to 4.5.2 and updates dependencies (#3064)
Updates .NET Framework to 4.5.2 and updates dependencies
2019-06-06 17:27:53 +02:00
Stephan 7fd6bfa163 Make IPublishedContent changes less breaking and more friendly 2019-06-06 16:54:00 +02:00
Sebastiaan Janssen 4b2ce522fe Update nuspecs 2019-06-06 15:55:38 +02:00
Sebastiaan Janssen d0eddbb9a2 Update SignalR 2019-06-06 15:38:37 +02:00
Sebastiaan Janssen 938abab9d6 Update assembly redirects 2019-06-06 15:29:32 +02:00
Sebastiaan Janssen 5faa71187d More Owin updates 2019-06-06 15:21:05 +02:00
Sebastiaan Janssen c069f262dc Update MVC, Razor, WebApi and Owin 2019-06-06 14:50:01 +02:00
Sebastiaan Janssen 9f42e6a607 Update ImageProcessor and Newtonsoft.Json dependencies to the latest version 2019-06-06 14:37:57 +02:00
Sebastiaan Janssen 202f2d2e27 Fix build for VS2019 (not complete yet) 2019-06-06 13:53:42 +02:00
Sebastiaan Janssen aaab14be3e fix csproj file 2019-06-06 13:48:48 +02:00
Sebastiaan Janssen 1c87176d80 Merge branch 'v7/dev' into pr/3064
# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	src/Umbraco.Tests/packages.config
#	src/Umbraco.Web.UI/packages.config
#	src/Umbraco.Web/packages.config
#	src/umbraco.MacroEngines/packages.config
2019-06-06 12:50:48 +02:00
Stephan c17dbbe141 Fix merge 2019-06-06 12:16:55 +02:00
Stephan 1dde60a1d5 Merge branch v8/dev into v8/feature/5170-IPublishedContent 2019-06-06 12:12:49 +02:00
Sebastiaan Janssen a182c9b1ee Updates to latest Examine (#4851)
Updates to latest Examine
2019-06-04 13:06:35 +02:00
Stephan 983144c3f9 Unit-test published content linked-list children 2019-05-29 17:01:12 +02:00
Stephan c451498975 Fix v8/dev merge 2019-05-29 15:13:28 +02:00
Stephan 8579b5a89b Merge branch 'v8/dev' into v8/feature/5170-IPublishedContent 2019-05-29 08:48:18 +02:00
Niels Lyngsø d52d0819ab remember settings for affected RTEs 2019-05-28 16:08:38 +02:00
Niels Lyngsø ca25b3199b refactor to use area var 2019-05-28 15:24:02 +02:00
Rasmus John Pedersen 2b84f96836 Don't render data-udi in RTE on frontend 2019-05-16 08:54:57 +02:00
Rasmus John Pedersen 28b669d3a3 Don't add dada-id and rel attributes on media in RTE 2019-05-16 08:48:47 +02:00
Rasmus John Pedersen 19e2b1c24e Don't save media paths for images in RTE 2019-05-14 13:35:17 +02:00
Shannon 35645672ae Ensures the reset flag is set for users when the legacy user membership provider setting allowManuallyChangingPassword is used 2019-05-10 02:00:45 +10:00
Shannon f952877d04 ensures that the reset flag is passed to the server when an admin is changing a members password 2019-05-10 01:48:11 +10:00
Warren Buckley d69a978870 Fixes #4144 - Adds code back for allowing password changes without old password, that was removed in b029215933 2019-05-08 10:52:27 +01:00
Bjarke Berg d52f6b5810 Added support for changing the dates of the log files 2019-05-03 14:56:44 +02:00
Stephan 33b857d2c6 Merge branch 'v8/dev' into v8/feature/5170-IPublishedContent 2019-05-01 13:53:13 +02:00
Stephan bb0331e9cc Move IPublishedContent.Url() to ext method 2019-04-24 14:25:41 +02:00
Stephan 25b8c8a565 Refactor getting Urls 2019-04-24 11:53:35 +02:00
Stephan eb390f8d80 Fix merge 2019-04-24 09:32:49 +02:00
Stephan be93773399 Merge branch v8/dev into v8/feature/5170-IPublishedContent 2019-04-24 08:51:25 +02:00
Stephan 6f0baa4a8e Merge branch v8/dev into v8/feature/5170-IPublishedContent 2019-04-23 10:47:40 +02:00
Stephan a56f3b23d1 Cleanup PublishedMember 2019-04-23 08:29:43 +02:00
Stephan 4feb766cc6 Fix IPublishedContent.Children() and NuCache 2019-04-23 08:29:43 +02:00
Stephan 55d4457c70 UmbracoContext: don't use obsolete properties 2019-04-23 08:29:43 +02:00
Stephan 05c85bbce5 NuCache: children as linked lists 2019-04-23 08:28:26 +02:00
Stephan 2270188668 Refactor IPublishedContent.Children() 2019-04-23 08:28:23 +02:00
Stephan 41e14a62c0 Refactor IPublishedContent.Parent() 2019-04-23 08:27:50 +02:00
Stephan a996d46b6f Refactor IPublishedContent.GetCultureFromDomains() 2019-04-23 08:27:50 +02:00
Stephan e062ea8d31 Refactor IPublishedContent.CultureDate(), .Cultures 2019-04-23 08:27:50 +02:00
Stephan 7cf13cbf94 Fix IPublishedContent.Name(), .Segment() for invariant 2019-04-23 08:27:49 +02:00
Stephan afda7a5661 Refactor IPublishedContent.ItemType 2019-04-23 08:27:49 +02:00
Stephan 11ef00c63d Refactor IPublishedContent.Url() 2019-04-23 08:27:49 +02:00
Stephan 2b54cc50ab Refactor IPublishedContent.UrlSegment() 2019-04-23 08:27:49 +02:00
Stephan 99319e0b49 UmbracoContext: rename properties 2019-04-23 08:27:49 +02:00
Stephan f99302ac63 Cleanup IPublishedContent/PropertyType 2019-04-23 08:27:49 +02:00
Stephan 890d7d8ce3 Refactor IPublishedContent.Name() 2019-04-23 08:27:48 +02:00
Stephan f039b00a44 Introduce IPublishedPropertyType 2019-04-23 08:27:48 +02:00
Stephan 34ad8dfb8d Introduce IPublishedContentType 2019-04-23 08:27:40 +02:00
Stephan 6b23a8221d Bugfix Audit service 2019-04-15 16:34:01 +02:00
Kenn Jacobsen 0f969ecdd4 Setup non-selectable nodes after the treepicker loads 2019-04-08 19:56:15 +02:00
Shannon db867c66a3 The ImageCropperPropertyValueEditor doesn't convert values in ConvertDbToString correctly 2019-04-03 13:32:21 +11:00
Shannon 34a3389c17 Updates to latest Examine 2019-03-05 12:50:51 +11:00
Shannon beb325eacf oops got a couple versions wrong 2018-09-28 15:01:47 +10:00
Shannon 8e45bcf23f changes targetFramework in web.config 2018-09-28 14:34:39 +10:00
Shannon 40dc49ed47 updates nuspecs 2018-09-28 14:27:03 +10:00
Shannon 4b07305dc5 Update HtmlAgilityPack 2018-09-28 14:10:45 +10:00
Shannon 2514a59e93 Latest MS libs for benchmark project 2018-09-28 14:00:03 +10:00
Shannon 6843da790c Latest MS libs for benchmark project 2018-09-28 13:57:48 +10:00
Shannon ba1a9c3758 Updates to latest compatible CodeAnalysis & DotNetCompilerPlatform libs 2018-09-28 13:54:20 +10:00
Shannon 332ad6349d Updates latest newtonsoft.json 2018-09-28 12:59:12 +10:00
Shannon 42e48426e4 Updates other MS libs: ValueTuple, Dataflow, Reflection.Metadata 2018-09-28 12:44:17 +10:00
Shannon a0cc788f27 Updates to latest Image Processor versions 2018-09-28 12:24:16 +10:00
Shannon aecf96d74d Updates to latest MVC, WebApi and Owin 2018-09-28 12:19:34 +10:00
Shannon c75938076e reinstalls all packages flagged as 'requiresReinstallation' 2018-09-28 11:54:05 +10:00
Shannon cebbcb711a csproj, etc... updates for 452 (and 462 for benchmark proj) 2018-09-28 11:29:56 +10:00
708 changed files with 13381 additions and 9619 deletions
+35
View File
@@ -0,0 +1,35 @@
# Contributing to Umbraco CMS
When youre considering creating a pull request for Umbraco CMS, we will categorize them in two different sizes, small and large.
The process for both sizes is very similar, as [explained in the contribution document](CONTRIBUTING.md#how-do-i-begin).
## Small PRs
Bug fixes and small improvements - can be recognized by seeing a small number of changes and possibly a small number of new files.
Were usually able to handle small PRs pretty quickly. A community volunteer will do the initial review and flag it for Umbraco HQ as “community tested”. If everything looks good, it will be merged pretty quickly [as per the described process](REVIEW_PROCESS.md).
### Up for grabs
Umbraco HQ will regularly mark newly created issues on the issue tracker with the `Up for grabs` tag. This means that the proposed changes are wanted in Umbraco but the HQ does not have the time to make them at this time. We encourage anyone to pick them up and help out.
If you do start working on something, make sure leave a small comment on the issue saying something like: "I'm working on this". That way other people stumbling upon the issue know they don't need to pick it up, someone already has.
## Large PRs
New features and large refactorings - can be recognized by seeing a large number of changes, plenty of new files, updates to package manager files (NuGets packages.config, NPMs packages.json, etc.).
We would love to follow the same process for larger PRs but this is not always possible due to time limitations and priorities that need to be aligned. We dont want to put up any barriers, but this document should set the correct expectations.
Please make sure to describe your idea in an issue, it helps to put in mockup screenshots or videos.
If the change makes sense for HQ to include in Umbraco CMS we will leave you some feedback on how wed like to see it being implemented.
If a larger pull request is encouraged by Umbraco HQ, the process will be similar to what is described in the [small PRs process](#small-prs) above, we strive to feedback within 14 days. Finalizing and merging the PR might take longer though as it will likely need to be picked up by the development team to make sure everything is in order. Well keep you posted on the progress.
It is highly recommended that you speak to the HQ before making large, complex changes.
### Pull request or package?
If it doesnt fit in CMS right now, we will likely encourage you to make it into a package instead. A package is a great way to check out popularity of a feature, learn how people use it, validate good usability and to fix bugs.
Eventually, a package could "graduate" to be included in the CMS.
+1 -1
View File
@@ -12,7 +12,7 @@ thoroughly. Then, proceed by filling out the rest of the details in the issue
template below. The more details you can give us, the easier it will be for us
to determine the cause of a problem.
See: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/.github/CONTRIBUTING.md
See: https://github.com/umbraco/Umbraco-CMS/blob/v8/dev/.github/CONTRIBUTING.md
-->
+25
View File
@@ -0,0 +1,25 @@
# Review process
You're an awesome person and have sent us your contribution in the form of a pull request! It's now time to relax for a bit and wait for our response.
In order to set some expectations, here's what happens next.
## Review process
You will get an initial reply within 48 hours (workdays) to acknowledge that weve seen your PR and well pick it up as soon as we can.
You will get feedback within at most 14 days after opening the PR. Youll most likely get feedback sooner though. Then there are a few possible outcomes:
- Your proposed change is awesome! We merge it in and it will be included in the next minor release of Umbraco
- If the change is a high priority bug fix, we will cherry-pick it into the next patch release as well so that we can release it as soon as possible
- Your proposed change is awesome but needs a bit more work, well give you feedback on the changes wed like to see
- Your proposed change is awesome but.. not something were looking to include at this point. Well close your PR and the related issue (well be nice about it!)
## Are you still available?
We understand you have other things to do and can't just drop everything to help us out.
So if were asking for your help to improve the PR well wait for two weeks to give you a fair chance to make changes. Well ask for an update if we dont hear back from you after that time.
If we dont hear back from you for 4 weeks, well close the PR so that it doesnt just hang around forever. Youre very welcome to re-open it once you have some more time to spend on it.
There will be times that we really like your proposed changes and well finish the final improvements wed like to see ourselves. You still get the credits and your commits will live on in the git repository.
+3 -2
View File
@@ -14,6 +14,7 @@
<summary>Contains the core assemblies needed to run Umbraco Cms</summary>
<language>en-US</language>
<tags>umbraco</tags>
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
<dependencies>
<group targetFramework="net472">
@@ -44,7 +45,7 @@
<dependency id="Umbraco.SqlServerCE" version="[4.0.0.1,4.999999)" />
<dependency id="NPoco" version="[3.9.4,3.999999)" />
</group>
</dependencies>
</metadata>
<files>
@@ -55,6 +56,6 @@
<file src="$BuildTmp$\WebApp\bin\Umbraco.Core.xml" target="lib\net472\Umbraco.Core.xml" />
<!-- symbols -->
<file src="$BuildTmp$\bin\Umbraco.Core.pdb" target="lib" />
<file src="$BuildTmp$\bin\Umbraco.Core.pdb" target="lib\net472\Umbraco.Core.pdb" />
</files>
</package>
+4 -3
View File
@@ -14,6 +14,7 @@
<summary>Contains the core assemblies needed to run Umbraco Cms</summary>
<language>en-US</language>
<tags>umbraco</tags>
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
<dependencies>
<group targetFramework="net472">
@@ -43,7 +44,7 @@
<dependency id="System.Threading.Tasks.Dataflow" version="[4.9.0,4.999999)" />
</group>
</dependencies>
</metadata>
<files>
@@ -58,7 +59,7 @@
<file src="$BuildTmp$\WebApp\bin\Umbraco.Examine.xml" target="lib\net472\Umbraco.Examine.xml" />
<!-- symbols -->
<file src="$BuildTmp$\bin\Umbraco.Web.pdb" target="lib" />
<file src="$BuildTmp$\bin\Umbraco.Examine.pdb" target="lib" />
<file src="$BuildTmp$\bin\Umbraco.Web.pdb" target="lib\net472\Umbraco.Web.pdb" />
<file src="$BuildTmp$\bin\Umbraco.Examine.pdb" target="lib\net472\Umbraco.Examine.pdb" />
</files>
</package>
+2 -1
View File
@@ -14,6 +14,7 @@
<summary>Installs Umbraco Cms in your Visual Studio ASP.NET project</summary>
<language>en-US</language>
<tags>umbraco</tags>
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
<dependencies>
<group targetFramework="net472">
@@ -25,7 +26,7 @@
not want this to happen as the alpha of the next major is, really, the next major already.
-->
<dependency id="Microsoft.AspNet.SignalR.Core" version="[2.4.0, 2.999999)" />
<dependency id="Umbraco.ModelsBuilder.Ui" version="[8.0.4]" />
<dependency id="Umbraco.ModelsBuilder.Ui" version="[8.1.0]" />
<dependency id="ImageProcessor.Web" version="[4.10.0.100,4.999999)" />
<dependency id="ImageProcessor.Web.Config" version="[2.5.0.100,2.999999)" />
<dependency id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="[2.0.1,2.999999)" />
+7 -7
View File
@@ -1,11 +1,11 @@
888
888
888 888 88888b.d88b. 88888b. 888d888 8888b. .d8888b .d88b.
888 888 888 "888 "88b 888 "88b 888P" "88b d88P" d88""88b
888 888 888 888 888 888 888 888 .d888888 888 888 888
Y88b 888 888 888 888 888 d88P 888 888 888 Y88b. Y88..88P
"Y88888 888 888 888 88888P" 888 "Y888888 "Y8888P "Y88P"
888
888
888 888 88888b.d88b. 88888b. 888d888 8888b. .d8888b .d88b.
888 888 888 "888 "88b 888 "88b 888P" "88b d88P" d88""88b
888 888 888 888 888 888 888 888 .d888888 888 888 888
Y88 88Y 888 888 888 888 d88P 888 888 888 Y88b. Y88..88P
"Y888P" 888 888 888 88888P" 888 "Y888888 "Y8888P "Y88P"
------------------------------------------------------------------
+8 -7
View File
@@ -1,12 +1,13 @@
_ _ __ __ ____ _____ _____ ____
| | | | \/ | _ \| __ \ /\ / ____/ __ \
| | | | \ / | |_) | |__) | / \ | | | | | |
| | | | |\/| | _ <| _ / / /\ \| | | | | |
| |__| | | | | |_) | | \ \ / ____ | |___| |__| |
\____/|_| |_|____/|_| \_/_/ \_\_____\____/
888
888
888 888 88888b.d88b. 88888b. 888d888 8888b. .d8888b .d88b.
888 888 888 "888 "88b 888 "88b 888P" "88b d88P" d88""88b
888 888 888 888 888 888 888 888 .d888888 888 888 888
Y88 88Y 888 888 888 888 d88P 888 888 888 Y88b. Y88..88P
"Y888P" 888 888 888 88888P" 888 "Y888888 "Y8888P "Y88P"
----------------------------------------------------
------------------------------------------------------------------
Don't forget to build!
@@ -8,7 +8,7 @@
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(factoryType)" xdt:Transform="SetAttributes(factoryType)" />
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(factoryType)" xdt:Transform="SetAttributes(factoryType)" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="Umbraco.Web.PublishedContentModels" xdt:Transform="InsertIfMissing" />
@@ -18,13 +18,13 @@
<system.web>
<pages
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
xdt:Locator="Match(pageParserFilterType,pageBaseType,userControlBaseType)"
xdt:Transform="SetAttributes(pageParserFilterType,pageBaseType,userControlBaseType)">
<controls>
<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" xdt:Locator="Match(namespace)" xdt:Transform="SetAttributes(assembly)" />
<add assembly="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" xdt:Locator="Match(namespace)" xdt:Transform="SetAttributes(assembly)" />
</controls>
</pages>
</system.web>
+21 -4
View File
@@ -18,9 +18,20 @@ if ($project) {
# Copy umbraco and umbraco_files from package to project folder
$umbracoFolder = Join-Path $projectPath "Umbraco"
New-Item -ItemType Directory -Force -Path $umbracoFolder
New-Item -ItemType Directory -Force -Path $umbracoFolder
$umbracoFolderSource = Join-Path $installPath "UmbracoFiles\Umbraco"
robocopy $umbracoFolderSource $umbracoFolder /is /it /e /xf UI.xml /LOG:$copyLogsPath\UmbracoCopy.log
Write-Host "copying files to $umbracoFolder ..."
# see https://support.microsoft.com/en-us/help/954404/return-codes-that-are-used-by-the-robocopy-utility-in-windows-server-2
robocopy $umbracoFolderSource $umbracoFolder /is /it /e
if (($lastexitcode -eq 1) -or ($lastexitcode -eq 3) -or ($lastexitcode -eq 5) -or ($lastexitcode -eq 7))
{
write-host "Copy succeeded!"
}
else
{
write-host "Copy failed with exit code:" $lastexitcode
}
$copyWebconfig = $true
$destinationWebConfig = Join-Path $projectPath "Web.config"
@@ -40,7 +51,11 @@ if ($project) {
}
}
}
Catch { }
Catch
{
Write-Host "An error occurred:"
Write-Host $_
}
}
if($copyWebconfig -eq $true)
@@ -74,7 +89,9 @@ if ($project) {
}
Catch
{
# Not a big problem if this fails, let it go
# Not a big problem if this fails, let it go
# Write-Host "An error occurred:"
# Write-Host $_
}
}
+10 -10
View File
@@ -15,7 +15,7 @@
[Parameter(Mandatory=$false)]
[Alias("doc")]
[switch] $docfx = $false,
# keep the build directories, don't clear them
[Parameter(Mandatory=$false)]
[Alias("c")]
@@ -392,13 +392,13 @@
&$this.BuildEnv.NuGet Pack "$nuspecs\UmbracoCms.Core.nuspec" `
-Properties BuildTmp="$($this.BuildTemp)" `
-Version "$($this.Version.Semver.ToString())" `
-Symbols -SymbolPackageFormat snupkg -Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cmscore.log"
-Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cmscore.log"
if (-not $?) { throw "Failed to pack NuGet UmbracoCms.Core." }
&$this.BuildEnv.NuGet Pack "$nuspecs\UmbracoCms.Web.nuspec" `
-Properties BuildTmp="$($this.BuildTemp)" `
-Version "$($this.Version.Semver.ToString())" `
-Symbols -SymbolPackageFormat snupkg -Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cmsweb.log"
-Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cmsweb.log"
if (-not $?) { throw "Failed to pack NuGet UmbracoCms.Web." }
&$this.BuildEnv.NuGet Pack "$nuspecs\UmbracoCms.nuspec" `
@@ -429,37 +429,37 @@
Write-Host "Prepare Azure Gallery"
$this.CopyFile("$($this.SolutionRoot)\build\Azure\azuregalleryrelease.ps1", $this.BuildOutput)
})
$ubuild.DefineMethod("PrepareCSharpDocs",
{
Write-Host "Prepare C# Documentation"
$src = "$($this.SolutionRoot)\src"
$tmp = $this.BuildTemp
$out = $this.BuildOutput
$DocFxJson = Join-Path -Path $src "\ApiDocs\docfx.json"
$DocFxSiteOutput = Join-Path -Path $tmp "\_site\*.*"
#restore nuget packages
$this.RestoreNuGet()
# run DocFx
$DocFx = $this.BuildEnv.DocFx
& $DocFx metadata $DocFxJson
& $DocFx build $DocFxJson
# zip it
& $this.BuildEnv.Zip a -tzip -r "$out\csharp-docs.zip" $DocFxSiteOutput
})
$ubuild.DefineMethod("PrepareAngularDocs",
{
Write-Host "Prepare Angular Documentation"
$src = "$($this.SolutionRoot)\src"
$out = $this.BuildOutput
$this.CompileBelle()
"Moving to Umbraco.Web.UI.Client folder"
+2 -2
View File
@@ -18,5 +18,5 @@ using System.Resources;
[assembly: AssemblyVersion("8.0.0")]
// these are FYI and changed automatically
[assembly: AssemblyFileVersion("8.1.0")]
[assembly: AssemblyInformationalVersion("8.1.0")]
[assembly: AssemblyFileVersion("8.2.0")]
[assembly: AssemblyInformationalVersion("8.2.0")]
+25 -22
View File
@@ -67,31 +67,34 @@ namespace Umbraco.Core
: new NamedSemaphoreReleaser(_semaphore2);
}
public Task<IDisposable> LockAsync()
{
var wait = _semaphore != null
? _semaphore.WaitAsync()
: _semaphore2.WaitOneAsync();
//NOTE: We don't use the "Async" part of this lock at all
//TODO: Remove this and rename this class something like SystemWideLock, then we can re-instate this logic if we ever need an Async lock again
return wait.IsCompleted
? _releaserTask ?? Task.FromResult(CreateReleaser()) // anonymous vs named
: wait.ContinueWith((_, state) => (((AsyncLock) state).CreateReleaser()),
this, CancellationToken.None,
TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
}
//public Task<IDisposable> LockAsync()
//{
// var wait = _semaphore != null
// ? _semaphore.WaitAsync()
// : _semaphore2.WaitOneAsync();
public Task<IDisposable> LockAsync(int millisecondsTimeout)
{
var wait = _semaphore != null
? _semaphore.WaitAsync(millisecondsTimeout)
: _semaphore2.WaitOneAsync(millisecondsTimeout);
// return wait.IsCompleted
// ? _releaserTask ?? Task.FromResult(CreateReleaser()) // anonymous vs named
// : wait.ContinueWith((_, state) => (((AsyncLock) state).CreateReleaser()),
// this, CancellationToken.None,
// TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
//}
return wait.IsCompleted
? _releaserTask ?? Task.FromResult(CreateReleaser()) // anonymous vs named
: wait.ContinueWith((_, state) => (((AsyncLock)state).CreateReleaser()),
this, CancellationToken.None,
TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
}
//public Task<IDisposable> LockAsync(int millisecondsTimeout)
//{
// var wait = _semaphore != null
// ? _semaphore.WaitAsync(millisecondsTimeout)
// : _semaphore2.WaitOneAsync(millisecondsTimeout);
// return wait.IsCompleted
// ? _releaserTask ?? Task.FromResult(CreateReleaser()) // anonymous vs named
// : wait.ContinueWith((_, state) => (((AsyncLock)state).CreateReleaser()),
// this, CancellationToken.None,
// TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
//}
public IDisposable Lock()
{
@@ -90,7 +90,7 @@ namespace Umbraco.Core.Composing.CompositionExtensions
// register the IFileSystem supporting the IMediaFileSystem
// THIS IS THE ONLY THING THAT NEEDS TO CHANGE, IN ORDER TO REPLACE THE UNDERLYING FILESYSTEM
// and, SupportingFileSystem.For<IMediaFileSystem>() returns the underlying filesystem
composition.SetMediaFileSystem(() => new PhysicalFileSystem("~/media"));
composition.SetMediaFileSystem(() => new PhysicalFileSystem(SystemDirectories.Media));
return composition;
}
@@ -96,7 +96,7 @@ namespace Umbraco.Core.Composing.CompositionExtensions
var pluginLangFolders = appPlugins.Exists == false
? Enumerable.Empty<LocalizedTextServiceSupplementaryFileSource>()
: appPlugins.GetDirectories()
.SelectMany(x => x.GetDirectories("Lang"))
.SelectMany(x => x.GetDirectories("Lang", SearchOption.AllDirectories))
.SelectMany(x => x.GetFiles("*.xml", SearchOption.TopDirectoryOnly))
.Select(x => new LocalizedTextServiceSupplementaryFileSource(x, false));
+49 -18
View File
@@ -12,31 +12,62 @@
/// or MS.DI, PerDependency in Autofac.</remarks>
Transient,
// TODO: We need to fix this up, currently LightInject is the only one that behaves differently from all other containers.
// ... the simple fix would be to map this to PerScopeLifetime in LI but need to wait on a response here https://github.com/seesharper/LightInject/issues/494#issuecomment-518942625
//
// we use it for controllers, httpContextBase and other request scoped objects: MembershpHelper, TagQuery, UmbracoTreeSearcher and ISearchableTree
// - so that they are automatically disposed at the end of the scope (ie request)
// - not sure they should not be simply 'scoped'?
/// <summary>
/// One unique instance per request.
/// </summary>
// TODO: review lifetimes for LightInject vs other containers
// currently, corresponds to 'Request' in LightInject which is 'Transient + disposed by Scope'
// but NOT (in LightInject) a per-web-request lifetime, more a TransientScoped
//
// we use it for controllers, httpContextBase and umbracoContext
// - so that they are automatically disposed at the end of the scope (ie request)
// - not sure they should not be simply 'scoped'?
//
// Castle has an extra PerWebRequest something, and others use scope
// what about Request before first request ie during application startup?
// see http://blog.ploeh.dk/2009/11/17/UsingCastleWindsor'sPerWebRequestlifestylewithASP.NETMVConIIS7/
// Castle ends up requiring a special scope manager too
// see https://groups.google.com/forum/#!topic/castle-project-users/1E2W9LVIYR4
//
// but maybe also - why are we requiring scoped services at startup?
/// <remarks>
/// <para>
/// Any instance created with this lifetime will be disposed at the end of a request.
/// </para>
/// Corresponds to
/// <para>
/// PerRequestLifeTime in LightInject - means transient but disposed at the end of the current web request.
/// see: https://github.com/seesharper/LightInject/issues/494#issuecomment-518493262
/// </para>
/// <para>
/// Scoped in MS.DI - means one per web request.
/// see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-2.2#service-lifetimes</para>
/// <para>
/// InstancePerRequest in Autofac - means one per web request.
/// see https://autofaccn.readthedocs.io/en/latest/lifetime/instance-scope.html#instance-per-request
/// But "Behind the scenes, though, its still just instance per matching lifetime scope."
/// </para>
/// <para>
/// LifestylePerWebRequest in Castle Windsor - means one per web request.
/// see https://github.com/castleproject/Windsor/blob/master/docs/mvc-tutorial-part-7-lifestyles.md#the-perwebrequest-lifestyle
/// </para>
/// </remarks>
Request,
/// <summary>
/// One unique instance per container scope.
/// One unique instance per scope.
/// </summary>
/// <remarks>Corresponds to Scope in LightInject, Scoped in MS.DI
/// or Castle Windsor, PerLifetimeScope in Autofac.</remarks>
/// <remarks>
/// <para>
/// Any instance created with this lifetime will be disposed at the end of the current scope.
/// </para>
/// Corresponds to
/// <para>PerScopeLifetime in LightInject (when in a request, means one per web request)</para>
/// <para>
/// Scoped in MS.DI (when in a request, means one per web request)
/// see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-2.2#service-lifetimes</para>
/// <para>
/// InstancePerLifetimeScope in Autofac (when in a request, means one per web request)
/// see https://autofaccn.readthedocs.io/en/latest/lifetime/instance-scope.html#instance-per-lifetime-scope
/// Also note that Autofac's InstancePerRequest is the same as this, see https://autofaccn.readthedocs.io/en/latest/lifetime/instance-scope.html#instance-per-request
/// it says "Behind the scenes, though, its still just instance per matching lifetime scope."
/// </para>
/// <para>
/// LifestyleScoped in Castle Windsor
/// </para>
/// </remarks>
Scope,
/// <summary>
+2 -2
View File
@@ -42,8 +42,8 @@ namespace Umbraco.Core.Composing
private string _currentAssembliesHash;
private IEnumerable<Assembly> _assemblies;
private bool _reportedChange;
private static string _localTempPath;
private static string _fileBasePath;
private readonly string _localTempPath;
private string _fileBasePath;
/// <summary>
/// Initializes a new instance of the <see cref="TypeLoader"/> class.
+9 -1
View File
@@ -4,6 +4,7 @@ using Umbraco.Core.Composing;
using Umbraco.Core.Dictionary;
using Umbraco.Core.IO;
using Umbraco.Core.Logging.Viewer;
using Umbraco.Core.Manifest;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PackageActions;
using Umbraco.Core.Persistence.Mappers;
@@ -66,9 +67,16 @@ namespace Umbraco.Core
/// Gets the validators collection builder.
/// </summary>
/// <param name="composition">The composition.</param>
internal static ManifestValueValidatorCollectionBuilder Validators(this Composition composition)
internal static ManifestValueValidatorCollectionBuilder ManifestValueValidators(this Composition composition)
=> composition.WithCollectionBuilder<ManifestValueValidatorCollectionBuilder>();
/// <summary>
/// Gets the manifest filter collection builder.
/// </summary>
/// <param name="composition">The composition.</param>
public static ManifestFilterCollectionBuilder ManifestFilters(this Composition composition)
=> composition.WithCollectionBuilder<ManifestFilterCollectionBuilder>();
/// <summary>
/// Gets the components collection builder.
/// </summary>
+7 -1
View File
@@ -7,6 +7,7 @@ using Umbraco.Core.Configuration.HealthChecks;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
namespace Umbraco.Core
{
@@ -41,7 +42,12 @@ namespace Umbraco.Core
configs.Add(() => new CoreDebug());
// GridConfig depends on runtime caches, manifest parsers... and cannot be available during composition
configs.Add<IGridConfig>(factory => new GridConfig(factory.GetInstance<ILogger>(), factory.GetInstance<AppCaches>(), configDir, factory.GetInstance<IRuntimeState>().Debug));
configs.Add<IGridConfig>(factory => new GridConfig(
factory.GetInstance<ILogger>(),
factory.GetInstance<AppCaches>(),
configDir,
factory.GetInstance<ManifestParser>(),
factory.GetInstance<IRuntimeState>().Debug));
}
}
}
@@ -1,14 +1,15 @@
using System.IO;
using Umbraco.Core.Cache;
using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
namespace Umbraco.Core.Configuration.Grid
{
class GridConfig : IGridConfig
{
public GridConfig(ILogger logger, AppCaches appCaches, DirectoryInfo configFolder, bool isDebug)
public GridConfig(ILogger logger, AppCaches appCaches, DirectoryInfo configFolder, ManifestParser manifestParser, bool isDebug)
{
EditorsConfig = new GridEditorsConfig(logger, appCaches, configFolder, isDebug);
EditorsConfig = new GridEditorsConfig(logger, appCaches, configFolder, manifestParser, isDebug);
}
public IGridEditorsConfig EditorsConfig { get; }
@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
using Umbraco.Core.PropertyEditors;
@@ -15,13 +13,15 @@ namespace Umbraco.Core.Configuration.Grid
private readonly ILogger _logger;
private readonly AppCaches _appCaches;
private readonly DirectoryInfo _configFolder;
private readonly ManifestParser _manifestParser;
private readonly bool _isDebug;
public GridEditorsConfig(ILogger logger, AppCaches appCaches, DirectoryInfo configFolder, bool isDebug)
public GridEditorsConfig(ILogger logger, AppCaches appCaches, DirectoryInfo configFolder, ManifestParser manifestParser, bool isDebug)
{
_logger = logger;
_appCaches = appCaches;
_configFolder = configFolder;
_manifestParser = manifestParser;
_isDebug = isDebug;
}
@@ -31,9 +31,6 @@ namespace Umbraco.Core.Configuration.Grid
{
List<GridEditor> GetResult()
{
// TODO: should use the common one somehow! + ignoring _appPlugins here!
var parser = new ManifestParser(_appCaches, Current.ManifestValidators, _logger);
var editors = new List<GridEditor>();
var gridConfig = Path.Combine(_configFolder.FullName, "grid.editors.config.js");
if (File.Exists(gridConfig))
@@ -42,7 +39,7 @@ namespace Umbraco.Core.Configuration.Grid
try
{
editors.AddRange(parser.ParseGridEditors(sourceString));
editors.AddRange(_manifestParser.ParseGridEditors(sourceString));
}
catch (Exception ex)
{
@@ -51,7 +48,7 @@ namespace Umbraco.Core.Configuration.Grid
}
// add manifest editors, skip duplicates
foreach (var gridEditor in parser.Manifest.GridEditors)
foreach (var gridEditor in _manifestParser.Manifest.GridEditors)
{
if (editors.Contains(gridEditor) == false) editors.Add(gridEditor);
}
+350 -2
View File
@@ -1,27 +1,375 @@
namespace Umbraco.Core
using System;
namespace Umbraco.Core
{
public static partial class Constants
{
public static class DataTypes
{
public const int LabelString = -92;
//NOTE: unfortunately due to backwards compat we can't move/rename these, with the addition of the GUID
//constants, it would make more sense to have these suffixed with "ID" or in a Subclass called "INT", for
//now all we can do is make a subclass called Guids to put the GUID IDs.
public const int LabelString = System.DefaultLabelDataTypeId;
public const int LabelInt = -91;
public const int LabelBigint = -93;
public const int LabelDateTime = -94;
public const int LabelTime = -98;
public const int LabelDecimal = -99;
public const int Textarea = -89;
public const int Textbox = -88;
public const int RichtextEditor = -87;
public const int Boolean = -49;
public const int DateTime = -36;
public const int DropDownSingle = -39;
public const int DropDownMultiple = -42;
public const int Upload = -90;
public const int DefaultContentListView = -95;
public const int DefaultMediaListView = -96;
public const int DefaultMembersListView = -97;
public const int ImageCropper = 1043;
public const int Tags = 1041;
public static class ReservedPreValueKeys
{
public const string IgnoreUserStartNodes = "ignoreUserStartNodes";
}
/// <summary>
/// Defines the identifiers for Umbraco data types as constants for easy centralized access/management.
/// </summary>
public static class Guids
{
/// <summary>
/// Guid for Content Picker as string
/// </summary>
public const string ContentPicker = "FD1E0DA5-5606-4862-B679-5D0CF3A52A59";
/// <summary>
/// Guid for Content Picker
/// </summary>
public static readonly Guid ContentPickerGuid = new Guid(ContentPicker);
/// <summary>
/// Guid for Member Picker as string
/// </summary>
public const string MemberPicker = "1EA2E01F-EBD8-4CE1-8D71-6B1149E63548";
/// <summary>
/// Guid for Member Picker
/// </summary>
public static readonly Guid MemberPickerGuid = new Guid(MemberPicker);
/// <summary>
/// Guid for Media Picker as string
/// </summary>
public const string MediaPicker = "135D60E0-64D9-49ED-AB08-893C9BA44AE5";
/// <summary>
/// Guid for Media Picker
/// </summary>
public static readonly Guid MediaPickerGuid = new Guid(MediaPicker);
/// <summary>
/// Guid for Multiple Media Picker as string
/// </summary>
public const string MultipleMediaPicker = "9DBBCBBB-2327-434A-B355-AF1B84E5010A";
/// <summary>
/// Guid for Multiple Media Picker
/// </summary>
public static readonly Guid MultipleMediaPickerGuid = new Guid(MultipleMediaPicker);
/// <summary>
/// Guid for Related Links as string
/// </summary>
public const string RelatedLinks = "B4E3535A-1753-47E2-8568-602CF8CFEE6F";
/// <summary>
/// Guid for Related Links
/// </summary>
public static readonly Guid RelatedLinksGuid = new Guid(RelatedLinks);
/// <summary>
/// Guid for Member as string
/// </summary>
public const string Member = "d59be02f-1df9-4228-aa1e-01917d806cda";
/// <summary>
/// Guid for Member
/// </summary>
public static readonly Guid MemberGuid = new Guid(Member);
/// <summary>
/// Guid for Image Cropper as string
/// </summary>
public const string ImageCropper = "1df9f033-e6d4-451f-b8d2-e0cbc50a836f";
/// <summary>
/// Guid for Image Cropper
/// </summary>
public static readonly Guid ImageCropperGuid = new Guid(ImageCropper);
/// <summary>
/// Guid for Tags as string
/// </summary>
public const string Tags = "b6b73142-b9c1-4bf8-a16d-e1c23320b549";
/// <summary>
/// Guid for Tags
/// </summary>
public static readonly Guid TagsGuid = new Guid(Tags);
/// <summary>
/// Guid for List View - Content as string
/// </summary>
public const string ListViewContent = "C0808DD3-8133-4E4B-8CE8-E2BEA84A96A4";
/// <summary>
/// Guid for List View - Content
/// </summary>
public static readonly Guid ListViewContentGuid = new Guid(ListViewContent);
/// <summary>
/// Guid for List View - Media as string
/// </summary>
public const string ListViewMedia = "3A0156C4-3B8C-4803-BDC1-6871FAA83FFF";
/// <summary>
/// Guid for List View - Media
/// </summary>
public static readonly Guid ListViewMediaGuid = new Guid(ListViewMedia);
/// <summary>
/// Guid for List View - Members as string
/// </summary>
public const string ListViewMembers = "AA2C52A0-CE87-4E65-A47C-7DF09358585D";
/// <summary>
/// Guid for List View - Members
/// </summary>
public static readonly Guid ListViewMembersGuid = new Guid(ListViewMembers);
/// <summary>
/// Guid for Date Picker with time as string
/// </summary>
public const string DatePickerWithTime = "e4d66c0f-b935-4200-81f0-025f7256b89a";
/// <summary>
/// Guid for Date Picker with time
/// </summary>
public static readonly Guid DatePickerWithTimeGuid = new Guid(DatePickerWithTime);
/// <summary>
/// Guid for Approved Color as string
/// </summary>
public const string ApprovedColor = "0225af17-b302-49cb-9176-b9f35cab9c17";
/// <summary>
/// Guid for Approved Color
/// </summary>
public static readonly Guid ApprovedColorGuid = new Guid(ApprovedColor);
/// <summary>
/// Guid for Dropdown multiple as string
/// </summary>
public const string DropdownMultiple = "f38f0ac7-1d27-439c-9f3f-089cd8825a53";
/// <summary>
/// Guid for Dropdown multiple
/// </summary>
public static readonly Guid DropdownMultipleGuid = new Guid(DropdownMultiple);
/// <summary>
/// Guid for Radiobox as string
/// </summary>
public const string Radiobox = "bb5f57c9-ce2b-4bb9-b697-4caca783a805";
/// <summary>
/// Guid for Radiobox
/// </summary>
public static readonly Guid RadioboxGuid = new Guid(Radiobox);
/// <summary>
/// Guid for Date Picker as string
/// </summary>
public const string DatePicker = "5046194e-4237-453c-a547-15db3a07c4e1";
/// <summary>
/// Guid for Date Picker
/// </summary>
public static readonly Guid DatePickerGuid = new Guid(DatePicker);
/// <summary>
/// Guid for Dropdown as string
/// </summary>
public const string Dropdown = "0b6a45e7-44ba-430d-9da5-4e46060b9e03";
/// <summary>
/// Guid for Dropdown
/// </summary>
public static readonly Guid DropdownGuid = new Guid(Dropdown);
/// <summary>
/// Guid for Checkbox list as string
/// </summary>
public const string CheckboxList = "fbaf13a8-4036-41f2-93a3-974f678c312a";
/// <summary>
/// Guid for Checkbox list
/// </summary>
public static readonly Guid CheckboxListGuid = new Guid(CheckboxList);
/// <summary>
/// Guid for Checkbox as string
/// </summary>
public const string Checkbox = "92897bc6-a5f3-4ffe-ae27-f2e7e33dda49";
/// <summary>
/// Guid for Checkbox
/// </summary>
public static readonly Guid CheckboxGuid = new Guid(Checkbox);
/// <summary>
/// Guid for Numeric as string
/// </summary>
public const string Numeric = "2e6d3631-066e-44b8-aec4-96f09099b2b5";
/// <summary>
/// Guid for Dropdown
/// </summary>
public static readonly Guid NumericGuid = new Guid(Numeric);
/// <summary>
/// Guid for Richtext editor as string
/// </summary>
public const string RichtextEditor = "ca90c950-0aff-4e72-b976-a30b1ac57dad";
/// <summary>
/// Guid for Richtext editor
/// </summary>
public static readonly Guid RichtextEditorGuid = new Guid(RichtextEditor);
/// <summary>
/// Guid for Textstring as string
/// </summary>
public const string Textstring = "0cc0eba1-9960-42c9-bf9b-60e150b429ae";
/// <summary>
/// Guid for Textstring
/// </summary>
public static readonly Guid TextstringGuid = new Guid(Textstring);
/// <summary>
/// Guid for Textarea as string
/// </summary>
public const string Textarea = "c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3";
/// <summary>
/// Guid for Dropdown
/// </summary>
public static readonly Guid TextareaGuid = new Guid(Textarea);
/// <summary>
/// Guid for Upload as string
/// </summary>
public const string Upload = "84c6b441-31df-4ffe-b67e-67d5bc3ae65a";
/// <summary>
/// Guid for Upload
/// </summary>
public static readonly Guid UploadGuid = new Guid(Upload);
/// <summary>
/// Guid for Label as string
/// </summary>
public const string LabelString = "f0bc4bfb-b499-40d6-ba86-058885a5178c";
/// <summary>
/// Guid for Label string
/// </summary>
public static readonly Guid LabelStringGuid = new Guid(LabelString);
/// <summary>
/// Guid for Label as int
/// </summary>
public const string LabelInt = "8e7f995c-bd81-4627-9932-c40e568ec788";
/// <summary>
/// Guid for Label int
/// </summary>
public static readonly Guid LabelIntGuid = new Guid(LabelInt);
/// <summary>
/// Guid for Label as big int
/// </summary>
public const string LabelBigInt = "930861bf-e262-4ead-a704-f99453565708";
/// <summary>
/// Guid for Label big int
/// </summary>
public static readonly Guid LabelBigIntGuid = new Guid(LabelBigInt);
/// <summary>
/// Guid for Label as date time
/// </summary>
public const string LabelDateTime = "0e9794eb-f9b5-4f20-a788-93acd233a7e4";
/// <summary>
/// Guid for Label date time
/// </summary>
public static readonly Guid LabelDateTimeGuid = new Guid(LabelDateTime);
/// <summary>
/// Guid for Label as time
/// </summary>
public const string LabelTime = "a97cec69-9b71-4c30-8b12-ec398860d7e8";
/// <summary>
/// Guid for Label time
/// </summary>
public static readonly Guid LabelTimeGuid = new Guid(LabelTime);
/// <summary>
/// Guid for Label as decimal
/// </summary>
public const string LabelDecimal = "8f1ef1e1-9de4-40d3-a072-6673f631ca64";
/// <summary>
/// Guid for Label decimal
/// </summary>
public static readonly Guid LabelDecimalGuid = new Guid(LabelDecimal);
}
}
}
}
+56 -6
View File
@@ -5,39 +5,89 @@
public static class Icons
{
/// <summary>
/// System contenttype icon
/// System default icon
/// </summary>
public const string ContentType = "icon-arrangement";
public const string DefaultIcon = Content;
/// <summary>
/// System datatype icon
/// System content icon
/// </summary>
public const string Content = "icon-document";
/// <summary>
/// System content type icon
/// </summary>
public const string ContentType = "icon-item-arrangement";
/// <summary>
/// System data type icon
/// </summary>
public const string DataType = "icon-autofill";
/// <summary>
/// System property editor icon
/// System list view icon
/// </summary>
public const string PropertyEditor = "icon-autofill";
public const string ListView = "icon-thumbnail-list";
/// <summary>
/// System macro icon
/// </summary>
public const string Macro = "icon-settings-alt";
/// <summary>
/// System media file icon
/// </summary>
public const string MediaFile = "icon-document";
/// <summary>
/// System media folder icon
/// </summary>
public const string MediaFolder = "icon-folder";
/// <summary>
/// System media image icon
/// </summary>
public const string MediaImage = "icon-picture";
/// <summary>
/// System media type icon
/// </summary>
public const string MediaType = "icon-thumbnails";
/// <summary>
/// System member icon
/// </summary>
public const string Member = "icon-user";
/// <summary>
/// System member icon
/// System member group icon
/// </summary>
public const string MemberGroup = "icon-users-alt";
/// <summary>
/// System member type icon
/// </summary>
public const string MemberType = "icon-users";
/// <summary>
/// System property editor icon
/// </summary>
public const string PropertyEditor = "icon-autofill";
/// <summary>
/// System member icon
/// </summary>
public const string Template = "icon-layout";
/// <summary>
/// System user icon
/// </summary>
public const string User = "icon-user";
/// <summary>
/// System user group icon
/// </summary>
public const string UserGroup = "icon-users";
}
}
}
@@ -14,6 +14,23 @@ namespace Umbraco.Core
/// </summary>
public const string InternalGenericPropertiesPrefix = "_umb_";
public static class Legacy
{
public static class Aliases
{
public const string Textbox = "Umbraco.Textbox";
public const string Date = "Umbraco.Date";
public const string ContentPicker2 = "Umbraco.ContentPicker2";
public const string MediaPicker2 = "Umbraco.MediaPicker2";
public const string MemberPicker2 = "Umbraco.MemberPicker2";
public const string MultiNodeTreePicker2 = "Umbraco.MultiNodeTreePicker2";
public const string TextboxMultiple = "Umbraco.TextboxMultiple";
public const string RelatedLinks2 = "Umbraco.RelatedLinks2";
public const string RelatedLinks = "Umbraco.RelatedLinks";
}
}
/// <summary>
/// Defines Umbraco built-in property editor aliases.
/// </summary>
@@ -79,6 +96,11 @@ namespace Umbraco.Core
/// </summary>
public const string MediaPicker = "Umbraco.MediaPicker";
/// <summary>
/// Multiple Media Picker.
/// </summary>
public const string MultipleMediaPicker = "Umbraco.MultipleMediaPicker";
/// <summary>
/// Member Picker.
/// </summary>
@@ -186,6 +208,24 @@ namespace Umbraco.Core
/// <remarks>Must be a valid <see cref="ValueTypes"/> value.</remarks>
public const string DataValueType = "umbracoDataValueType";
}
/// <summary>
/// Defines Umbraco's built-in property editor groups.
/// </summary>
public static class Groups
{
public const string Common = "Common";
public const string Lists = "Lists";
public const string Media = "Media";
public const string People = "People";
public const string Pickers = "Pickers";
public const string RichContent = "Rich Content";
}
}
}
}
@@ -66,44 +66,44 @@ namespace Umbraco.Core
/// <summary>
/// Determines whether the content type is invariant.
/// </summary>
public static bool VariesByNothing(this PublishedContentType contentType) => contentType.Variations.VariesByNothing();
public static bool VariesByNothing(this IPublishedContentType contentType) => contentType.Variations.VariesByNothing();
/// <summary>
/// Determines whether the content type varies by culture.
/// </summary>
/// <remarks>And then it could also vary by segment.</remarks>
public static bool VariesByCulture(this PublishedContentType contentType) => contentType.Variations.VariesByCulture();
public static bool VariesByCulture(this IPublishedContentType contentType) => contentType.Variations.VariesByCulture();
/// <summary>
/// Determines whether the content type varies by segment.
/// </summary>
/// <remarks>And then it could also vary by culture.</remarks>
public static bool VariesBySegment(this PublishedContentType contentType) => contentType.Variations.VariesBySegment();
public static bool VariesBySegment(this IPublishedContentType contentType) => contentType.Variations.VariesBySegment();
/// <summary>
/// Determines whether the content type varies by culture and segment.
/// </summary>
public static bool VariesByCultureAndSegment(this PublishedContentType contentType) => contentType.Variations.VariesByCultureAndSegment();
public static bool VariesByCultureAndSegment(this IPublishedContentType contentType) => contentType.Variations.VariesByCultureAndSegment();
/// <summary>
/// Determines whether the property type is invariant.
/// </summary>
public static bool VariesByNothing(this PublishedPropertyType propertyType) => propertyType.Variations.VariesByNothing();
public static bool VariesByNothing(this IPublishedPropertyType propertyType) => propertyType.Variations.VariesByNothing();
/// <summary>
/// Determines whether the property type varies by culture.
/// </summary>
public static bool VariesByCulture(this PublishedPropertyType propertyType) => propertyType.Variations.VariesByCulture();
public static bool VariesByCulture(this IPublishedPropertyType propertyType) => propertyType.Variations.VariesByCulture();
/// <summary>
/// Determines whether the property type varies by segment.
/// </summary>
public static bool VariesBySegment(this PublishedPropertyType propertyType) => propertyType.Variations.VariesBySegment();
public static bool VariesBySegment(this IPublishedPropertyType propertyType) => propertyType.Variations.VariesBySegment();
/// <summary>
/// Determines whether the property type varies by culture and segment.
/// </summary>
public static bool VariesByCultureAndSegment(this PublishedPropertyType propertyType) => propertyType.Variations.VariesByCultureAndSegment();
public static bool VariesByCultureAndSegment(this IPublishedPropertyType propertyType) => propertyType.Variations.VariesByCultureAndSegment();
/// <summary>
/// Determines whether a variation is invariant.
+2 -1
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
@@ -15,7 +16,7 @@ namespace Umbraco.Core
/// <returns></returns>
public static string ToIsoString(this DateTime dt)
{
return dt.ToString("yyyy-MM-dd HH:mm:ss");
return dt.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
}
public static DateTime TruncateTo(this DateTime dt, DateTruncate truncateTo)
+2 -1
View File
@@ -10,6 +10,8 @@ namespace Umbraco.Core
///</summary>
public static class EnumerableExtensions
{
internal static bool IsCollectionEmpty<T>(this IReadOnlyCollection<T> list) => list == null || list.Count == 0;
internal static bool HasDuplicates<T>(this IEnumerable<T> items, bool includeNull)
{
var hs = new HashSet<T>();
@@ -112,7 +114,6 @@ namespace Umbraco.Core
}
}
/// <summary>
/// Returns true if all items in the other collection exist in this collection
/// </summary>
@@ -0,0 +1,28 @@
using System;
using System.Runtime.Serialization;
namespace Umbraco.Core.Exceptions
{
/// <summary>
/// Internal exception that in theory should never ben thrown, it is only thrown in circumstances that should never happen
/// </summary>
[Serializable]
internal class PanicException : Exception
{
public PanicException()
{
}
public PanicException(string message) : base(message)
{
}
public PanicException(string message, Exception innerException) : base(message, innerException)
{
}
protected PanicException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
+11 -5
View File
@@ -26,26 +26,32 @@ namespace Umbraco.Core.Logging.Viewer
/// A count of number of errors
/// By counting Warnings with Exceptions, Errors & Fatal messages
/// </summary>
int GetNumberOfErrors(DateTimeOffset startDate, DateTimeOffset endDate);
int GetNumberOfErrors(LogTimePeriod logTimePeriod);
/// <summary>
/// Returns a number of the different log level entries
/// </summary>
LogLevelCounts GetLogLevelCounts(DateTimeOffset startDate, DateTimeOffset endDate);
LogLevelCounts GetLogLevelCounts(LogTimePeriod logTimePeriod);
/// <summary>
/// Returns a list of all unique message templates and their counts
/// </summary>
IEnumerable<LogTemplate> GetMessageTemplates(DateTimeOffset startDate, DateTimeOffset endDate);
IEnumerable<LogTemplate> GetMessageTemplates(LogTimePeriod logTimePeriod);
bool CanHandleLargeLogs { get; }
bool CheckCanOpenLogs(DateTimeOffset startDate, DateTimeOffset endDate);
bool CheckCanOpenLogs(LogTimePeriod logTimePeriod);
/// <summary>
/// Gets the current Serilog minimum log level
/// </summary>
/// <returns></returns>
string GetLogLevel();
/// <summary>
/// Returns the collection of logs
/// </summary>
PagedResult<LogMessage> GetLogs(DateTimeOffset startDate, DateTimeOffset endDate,
PagedResult<LogMessage> GetLogs(LogTimePeriod logTimePeriod,
int pageNumber = 1,
int pageSize = 100,
Direction orderDirection = Direction.Descending,
@@ -26,7 +26,7 @@ namespace Umbraco.Core.Logging.Viewer
public override bool CanHandleLargeLogs => false;
public override bool CheckCanOpenLogs(DateTimeOffset startDate, DateTimeOffset endDate)
public override bool CheckCanOpenLogs(LogTimePeriod logTimePeriod)
{
//Log Directory
var logDirectory = _logsPath;
@@ -36,7 +36,7 @@ namespace Umbraco.Core.Logging.Viewer
//foreach full day in the range - see if we can find one or more filenames that end with
//yyyyMMdd.json - Ends with due to MachineName in filenames - could be 1 or more due to load balancing
for (var day = startDate.Date; day.Date <= endDate.Date; day = day.AddDays(1))
for (var day = logTimePeriod.StartTime.Date; day.Date <= logTimePeriod.EndTime.Date; day = day.AddDays(1))
{
//Filename ending to search for (As could be multiple)
var filesToFind = GetSearchPattern(day);
@@ -57,7 +57,7 @@ namespace Umbraco.Core.Logging.Viewer
return $"*{day:yyyyMMdd}*.json";
}
protected override IReadOnlyList<LogEvent> GetLogs(DateTimeOffset startDate, DateTimeOffset endDate, ILogFilter filter, int skip, int take)
protected override IReadOnlyList<LogEvent> GetLogs(LogTimePeriod logTimePeriod, ILogFilter filter, int skip, int take)
{
var logs = new List<LogEvent>();
@@ -68,7 +68,7 @@ namespace Umbraco.Core.Logging.Viewer
//foreach full day in the range - see if we can find one or more filenames that end with
//yyyyMMdd.json - Ends with due to MachineName in filenames - could be 1 or more due to load balancing
for (var day = startDate.Date; day.Date <= endDate.Date; day = day.AddDays(1))
for (var day = logTimePeriod.StartTime.Date; day.Date <= logTimePeriod.EndTime.Date; day = day.AddDays(1))
{
//Filename ending to search for (As could be multiple)
var filesToFind = GetSearchPattern(day);
@@ -0,0 +1,16 @@
using System;
namespace Umbraco.Core.Logging.Viewer
{
public class LogTimePeriod
{
public LogTimePeriod(DateTime startTime, DateTime endTime)
{
StartTime = startTime;
EndTime = endTime;
}
public DateTime StartTime { get; }
public DateTime EndTime { get; }
}
}
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using Newtonsoft.Json;
using Serilog;
using Serilog.Events;
using Umbraco.Core.IO;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Formatting = Newtonsoft.Json.Formatting;
namespace Umbraco.Core.Logging.Viewer
{
@@ -27,9 +30,9 @@ namespace Umbraco.Core.Logging.Viewer
/// <summary>
/// Get all logs from your chosen data source back as Serilog LogEvents
/// </summary>
protected abstract IReadOnlyList<LogEvent> GetLogs(DateTimeOffset startDate, DateTimeOffset endDate, ILogFilter filter, int skip, int take);
protected abstract IReadOnlyList<LogEvent> GetLogs(LogTimePeriod logTimePeriod, ILogFilter filter, int skip, int take);
public abstract bool CheckCanOpenLogs(DateTimeOffset startDate, DateTimeOffset endDate);
public abstract bool CheckCanOpenLogs(LogTimePeriod logTimePeriod);
public virtual IReadOnlyList<SavedLogSearch> GetSavedSearches()
{
@@ -82,24 +85,34 @@ namespace Umbraco.Core.Logging.Viewer
return searches;
}
public int GetNumberOfErrors(DateTimeOffset startDate, DateTimeOffset endDate)
public int GetNumberOfErrors(LogTimePeriod logTimePeriod)
{
var errorCounter = new ErrorCounterFilter();
GetLogs(startDate, endDate, errorCounter, 0, int.MaxValue);
GetLogs(logTimePeriod, errorCounter, 0, int.MaxValue);
return errorCounter.Count;
}
public LogLevelCounts GetLogLevelCounts(DateTimeOffset startDate, DateTimeOffset endDate)
/// <summary>
/// Get the Serilog minimum-level value from the config file.
/// </summary>
/// <returns></returns>
public string GetLogLevel()
{
var logLevel = Enum.GetValues(typeof(LogEventLevel)).Cast<LogEventLevel>().Where(Log.Logger.IsEnabled)?.Min() ?? null;
return logLevel?.ToString() ?? "";
}
public LogLevelCounts GetLogLevelCounts(LogTimePeriod logTimePeriod)
{
var counter = new CountingFilter();
GetLogs(startDate, endDate, counter, 0, int.MaxValue);
GetLogs(logTimePeriod, counter, 0, int.MaxValue);
return counter.Counts;
}
public IEnumerable<LogTemplate> GetMessageTemplates(DateTimeOffset startDate, DateTimeOffset endDate)
public IEnumerable<LogTemplate> GetMessageTemplates(LogTimePeriod logTimePeriod)
{
var messageTemplates = new MessageTemplateFilter();
GetLogs(startDate, endDate, messageTemplates, 0, int.MaxValue);
GetLogs(logTimePeriod, messageTemplates, 0, int.MaxValue);
var templates = messageTemplates.Counts.
Select(x => new LogTemplate { MessageTemplate = x.Key, Count = x.Value })
@@ -108,14 +121,14 @@ namespace Umbraco.Core.Logging.Viewer
return templates;
}
public PagedResult<LogMessage> GetLogs(DateTimeOffset startDate, DateTimeOffset endDate,
public PagedResult<LogMessage> GetLogs(LogTimePeriod logTimePeriod,
int pageNumber = 1, int pageSize = 100,
Direction orderDirection = Direction.Descending,
string filterExpression = null,
string[] logLevels = null)
{
var expression = new ExpressionFilter(filterExpression);
var filteredLogs = GetLogs(startDate, endDate, expression, 0, int.MaxValue);
var filteredLogs = GetLogs(logTimePeriod, expression, 0, int.MaxValue);
//This is user used the checkbox UI to toggle which log levels they wish to see
//If an empty array or null - its implied all levels to be viewed
+6 -1
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Web.Hosting;
@@ -113,7 +114,7 @@ namespace Umbraco.Core
lock (_locko)
{
_logger.Debug<MainDom>("Signaled {Signaled} ({SignalSource})", _signaled ? "(again)" : string.Empty, source);
_logger.Debug<MainDom>("Signaled ({Signaled}) ({SignalSource})", _signaled ? "again" : "first", source);
if (_signaled) return;
if (_isMainDom == false) return; // probably not needed
_signaled = true;
@@ -171,6 +172,7 @@ namespace Umbraco.Core
// if more than 1 instance reach that point, one will get the lock
// and the other one will timeout, which is accepted
//TODO: This can throw a TimeoutException - in which case should this be in a try/finally to ensure the signal is always reset?
_asyncLocker = _asyncLock.Lock(LockTimeoutMilliseconds);
_isMainDom = true;
@@ -181,6 +183,9 @@ namespace Umbraco.Core
// which is accepted
_signal.Reset();
//WaitOneAsync (ext method) will wait for a signal without blocking the main thread, the waiting is done on a background thread
_signal.WaitOneAsync()
.ContinueWith(_ => OnSignal("signal"));
@@ -0,0 +1,19 @@
using System.Collections.Generic;
namespace Umbraco.Core.Manifest
{
/// <summary>
/// Provides filtering for package manifests.
/// </summary>
public interface IManifestFilter
{
/// <summary>
/// Filters package manifests.
/// </summary>
/// <param name="manifests">The package manifests.</param>
/// <remarks>
/// <para>It is possible to remove, change, or add manifests.</para>
/// </remarks>
void Filter(List<PackageManifest> manifests);
}
}
@@ -0,0 +1,28 @@
using System.Collections.Generic;
using Umbraco.Core.Composing;
namespace Umbraco.Core.Manifest
{
/// <summary>
/// Contains the manifest filters.
/// </summary>
public class ManifestFilterCollection : BuilderCollectionBase<IManifestFilter>
{
/// <summary>
/// Initializes a new instance of the <see cref="ManifestFilterCollection"/> class.
/// </summary>
public ManifestFilterCollection(IEnumerable<IManifestFilter> items)
: base(items)
{ }
/// <summary>
/// Filters package manifests.
/// </summary>
/// <param name="manifests">The package manifests.</param>
public void Filter(List<PackageManifest> manifests)
{
foreach (var filter in this)
filter.Filter(manifests);
}
}
}
@@ -0,0 +1,12 @@
using Umbraco.Core.Composing;
namespace Umbraco.Core.Manifest
{
public class ManifestFilterCollectionBuilder : OrderedCollectionBuilderBase<ManifestFilterCollectionBuilder, ManifestFilterCollection, IManifestFilter>
{
protected override ManifestFilterCollectionBuilder This => this;
// do NOT cache this, it's only used once
protected override Lifetime CollectionLifetime => Lifetime.Transient;
}
}
+8 -3
View File
@@ -22,24 +22,26 @@ namespace Umbraco.Core.Manifest
private readonly IAppPolicyCache _cache;
private readonly ILogger _logger;
private readonly ManifestValueValidatorCollection _validators;
private readonly ManifestFilterCollection _filters;
private string _path;
/// <summary>
/// Initializes a new instance of the <see cref="ManifestParser"/> class.
/// </summary>
public ManifestParser(AppCaches appCaches, ManifestValueValidatorCollection validators, ILogger logger)
: this(appCaches, validators, "~/App_Plugins", logger)
public ManifestParser(AppCaches appCaches, ManifestValueValidatorCollection validators, ManifestFilterCollection filters, ILogger logger)
: this(appCaches, validators, filters, "~/App_Plugins", logger)
{ }
/// <summary>
/// Initializes a new instance of the <see cref="ManifestParser"/> class.
/// </summary>
private ManifestParser(AppCaches appCaches, ManifestValueValidatorCollection validators, string path, ILogger logger)
private ManifestParser(AppCaches appCaches, ManifestValueValidatorCollection validators, ManifestFilterCollection filters, string path, ILogger logger)
{
if (appCaches == null) throw new ArgumentNullException(nameof(appCaches));
_cache = appCaches.RuntimeCache;
_validators = validators ?? throw new ArgumentNullException(nameof(validators));
_filters = filters ?? throw new ArgumentNullException(nameof(filters));
if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullOrEmptyException(nameof(path));
Path = path;
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
@@ -78,6 +80,7 @@ namespace Umbraco.Core.Manifest
if (string.IsNullOrWhiteSpace(text))
continue;
var manifest = ParseManifest(text);
manifest.Source = path;
manifests.Add(manifest);
}
catch (Exception e)
@@ -86,6 +89,8 @@ namespace Umbraco.Core.Manifest
}
}
_filters.Filter(manifests);
return manifests;
}
@@ -9,6 +9,16 @@ namespace Umbraco.Core.Manifest
/// </summary>
public class PackageManifest
{
/// <summary>
/// Gets the source path of the manifest.
/// </summary>
/// <remarks>
/// <para>Gets the full absolute file path of the manifest,
/// using system directory separators.</para>
/// </remarks>
[JsonIgnore]
public string Source { get; set; }
/// <summary>
/// Gets or sets the scripts listed in the manifest.
/// </summary>
+4 -3
View File
@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Exceptions;
namespace Umbraco.Core.Mapping
{
@@ -191,7 +192,7 @@ namespace Umbraco.Core.Mapping
private TTarget Map<TTarget>(object source, Type sourceType, MapperContext context)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
return default;
var targetType = typeof(TTarget);
@@ -259,7 +260,7 @@ namespace Umbraco.Core.Mapping
if (typeof(TTarget).IsArray)
{
var elementType = typeof(TTarget).GetElementType();
if (elementType == null) throw new Exception("panic");
if (elementType == null) throw new PanicException("elementType == null which should never occur");
var targetArray = Array.CreateInstance(elementType, targetList.Count);
targetList.CopyTo(targetArray, 0);
target = targetArray;
@@ -382,7 +383,7 @@ namespace Umbraco.Core.Mapping
{
if (type.IsArray) return type.GetElementType();
if (type.IsGenericType) return type.GenericTypeArguments[0];
throw new Exception("panic");
throw new PanicException($"Could not get enumerable or array type from {type}");
}
/// <summary>
@@ -1,5 +1,7 @@
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using NPoco;
using Umbraco.Core;
using Umbraco.Core.Migrations.Expressions.Common;
using Umbraco.Core.Persistence.SqlSyntax;
@@ -27,31 +29,57 @@ namespace Umbraco.Core.Migrations.Expressions.Delete.KeysAndIndexes
{
_context.BuildingExpression = false;
//get a list of all constraints - this will include all PK, FK and unique constraints
var tableConstraints = _context.SqlContext.SqlSyntax.GetConstraintsPerTable(_context.Database).DistinctBy(x => x.Item2).ToList();
//get a list of defined indexes - this will include all indexes, unique indexes and unique constraint indexes
var indexes = _context.SqlContext.SqlSyntax.GetDefinedIndexesDefinitions(_context.Database).DistinctBy(x => x.IndexName).ToList();
var uniqueConstraintNames = tableConstraints.Where(x => !x.Item2.InvariantStartsWith("PK_") && !x.Item2.InvariantStartsWith("FK_")).Select(x => x.Item2);
var indexNames = indexes.Select(x => x.IndexName).ToList();
// drop keys
if (DeleteLocal || DeleteForeign)
{
// table, constraint
var tableKeys = _context.SqlContext.SqlSyntax.GetConstraintsPerTable(_context.Database).DistinctBy(x => x.Item2).ToList();
if (DeleteForeign)
{
foreach (var key in tableKeys.Where(x => x.Item1 == TableName && x.Item2.StartsWith("FK_")))
//In some cases not all FK's are prefixed with "FK" :/ mostly with old upgraded databases so we need to check if it's either:
// * starts with FK OR
// * doesn't start with PK_ and doesn't exist in the list of indexes
foreach (var key in tableConstraints.Where(x => x.Item1 == TableName
&& (x.Item2.InvariantStartsWith("FK_") || (!x.Item2.InvariantStartsWith("PK_") && !indexNames.InvariantContains(x.Item2)))))
{
Delete.ForeignKey(key.Item2).OnTable(key.Item1).Do();
}
}
if (DeleteLocal)
{
foreach (var key in tableKeys.Where(x => x.Item1 == TableName && x.Item2.StartsWith("PK_")))
foreach (var key in tableConstraints.Where(x => x.Item1 == TableName && x.Item2.InvariantStartsWith("PK_")))
Delete.PrimaryKey(key.Item2).FromTable(key.Item1).Do();
// note: we do *not* delete the DEFAULT constraints
// note: we do *not* delete the DEFAULT constraints and if we wanted to we'd have to deal with that in interesting ways
// since SQL server has a specific way to handle that, see SqlServerSyntaxProvider.GetDefaultConstraintsPerColumn
}
}
// drop indexes
if (DeleteLocal)
{
var indexes = _context.SqlContext.SqlSyntax.GetDefinedIndexesDefinitions(_context.Database).DistinctBy(x => x.IndexName).ToList();
{
foreach (var index in indexes.Where(x => x.TableName == TableName))
Delete.Index(index.IndexName).OnTable(index.TableName).Do();
{
//if this is a unique constraint we need to drop the constraint, else drop the index
//to figure this out, the index must be tagged as unique and it must exist in the tableConstraints
if (index.IsUnique && uniqueConstraintNames.InvariantContains(index.IndexName))
Delete.UniqueConstraint(index.IndexName).FromTable(index.TableName).Do();
else
Delete.Index(index.IndexName).OnTable(index.TableName).Do();
}
}
}
@@ -101,33 +101,33 @@ namespace Umbraco.Core.Migrations.Install
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -1, Trashed = false, ParentId = -1, UserId = -1, Level = 0, Path = "-1", SortOrder = 0, UniqueId = new Guid("916724a5-173d-4619-b97e-b9de133dd6f5"), Text = "SYSTEM DATA: umbraco master root", NodeObjectType = Constants.ObjectTypes.SystemRoot, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -20, Trashed = false, ParentId = -1, UserId = -1, Level = 0, Path = "-1,-20", SortOrder = 0, UniqueId = new Guid("0F582A79-1E41-4CF0-BFA0-76340651891A"), Text = "Recycle Bin", NodeObjectType = Constants.ObjectTypes.ContentRecycleBin, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -21, Trashed = false, ParentId = -1, UserId = -1, Level = 0, Path = "-1,-21", SortOrder = 0, UniqueId = new Guid("BF7C7CBC-952F-4518-97A2-69E9C7B33842"), Text = "Recycle Bin", NodeObjectType = Constants.ObjectTypes.MediaRecycleBin, CreateDate = DateTime.Now });
InsertDataTypeNodeDto(Constants.DataTypes.LabelString, 35, "f0bc4bfb-b499-40d6-ba86-058885a5178c", "Label");
InsertDataTypeNodeDto(Constants.DataTypes.LabelInt, 36, "8e7f995c-bd81-4627-9932-c40e568ec788", "Label (integer)");
InsertDataTypeNodeDto(Constants.DataTypes.LabelBigint, 36, "930861bf-e262-4ead-a704-f99453565708", "Label (bigint)");
InsertDataTypeNodeDto(Constants.DataTypes.LabelDateTime, 37, "0e9794eb-f9b5-4f20-a788-93acd233a7e4", "Label (datetime)");
InsertDataTypeNodeDto(Constants.DataTypes.LabelTime, 38, "a97cec69-9b71-4c30-8b12-ec398860d7e8", "Label (time)");
InsertDataTypeNodeDto(Constants.DataTypes.LabelDecimal, 39, "8f1ef1e1-9de4-40d3-a072-6673f631ca64", "Label (decimal)");
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -90, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-90", SortOrder = 34, UniqueId = new Guid("84c6b441-31df-4ffe-b67e-67d5bc3ae65a"), Text = "Upload", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -89, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-89", SortOrder = 33, UniqueId = new Guid("c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3"), Text = "Textarea", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -88, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-88", SortOrder = 32, UniqueId = new Guid("0cc0eba1-9960-42c9-bf9b-60e150b429ae"), Text = "Textstring", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -87, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-87", SortOrder = 4, UniqueId = new Guid("ca90c950-0aff-4e72-b976-a30b1ac57dad"), Text = "Richtext editor", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -51, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-51", SortOrder = 2, UniqueId = new Guid("2e6d3631-066e-44b8-aec4-96f09099b2b5"), Text = "Numeric", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -49, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-49", SortOrder = 2, UniqueId = new Guid("92897bc6-a5f3-4ffe-ae27-f2e7e33dda49"), Text = "True/false", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -43, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-43", SortOrder = 2, UniqueId = new Guid("fbaf13a8-4036-41f2-93a3-974f678c312a"), Text = "Checkbox list", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DropDownSingle, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DropDownSingle}", SortOrder = 2, UniqueId = new Guid("0b6a45e7-44ba-430d-9da5-4e46060b9e03"), Text = "Dropdown", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -41, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-41", SortOrder = 2, UniqueId = new Guid("5046194e-4237-453c-a547-15db3a07c4e1"), Text = "Date Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -40, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-40", SortOrder = 2, UniqueId = new Guid("bb5f57c9-ce2b-4bb9-b697-4caca783a805"), Text = "Radiobox", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DropDownMultiple, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DropDownMultiple}", SortOrder = 2, UniqueId = new Guid("f38f0ac7-1d27-439c-9f3f-089cd8825a53"), Text = "Dropdown multiple", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -37, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-37", SortOrder = 2, UniqueId = new Guid("0225af17-b302-49cb-9176-b9f35cab9c17"), Text = "Approved Color", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -36, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-36", SortOrder = 2, UniqueId = new Guid("e4d66c0f-b935-4200-81f0-025f7256b89a"), Text = "Date Picker with time", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultContentListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DefaultContentListView}", SortOrder = 2, UniqueId = new Guid("C0808DD3-8133-4E4B-8CE8-E2BEA84A96A4"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Content", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMediaListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DefaultMediaListView}", SortOrder = 2, UniqueId = new Guid("3A0156C4-3B8C-4803-BDC1-6871FAA83FFF"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Media", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMembersListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DefaultMembersListView}", SortOrder = 2, UniqueId = new Guid("AA2C52A0-CE87-4E65-A47C-7DF09358585D"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
InsertDataTypeNodeDto(Constants.DataTypes.LabelString, 35, Constants.DataTypes.Guids.LabelString, "Label (string)");
InsertDataTypeNodeDto(Constants.DataTypes.LabelInt, 36, Constants.DataTypes.Guids.LabelInt, "Label (integer)");
InsertDataTypeNodeDto(Constants.DataTypes.LabelBigint, 36, Constants.DataTypes.Guids.LabelBigInt, "Label (bigint)");
InsertDataTypeNodeDto(Constants.DataTypes.LabelDateTime, 37, Constants.DataTypes.Guids.LabelDateTime, "Label (datetime)");
InsertDataTypeNodeDto(Constants.DataTypes.LabelTime, 38, Constants.DataTypes.Guids.LabelTime, "Label (time)");
InsertDataTypeNodeDto(Constants.DataTypes.LabelDecimal, 39, Constants.DataTypes.Guids.LabelDecimal, "Label (decimal)");
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Upload, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Upload}", SortOrder = 34, UniqueId = Constants.DataTypes.Guids.UploadGuid, Text = "Upload", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Textarea, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Textarea}", SortOrder = 33, UniqueId = Constants.DataTypes.Guids.TextareaGuid, Text = "Textarea", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Textbox, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Textbox}", SortOrder = 32, UniqueId = Constants.DataTypes.Guids.TextstringGuid, Text = "Textstring", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.RichtextEditor, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.RichtextEditor}", SortOrder = 4, UniqueId = Constants.DataTypes.Guids.RichtextEditorGuid, Text = "Richtext editor", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -51, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-51", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.NumericGuid, Text = "Numeric", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Boolean, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Boolean}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.CheckboxGuid, Text = "True/false", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -43, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-43", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.CheckboxListGuid, Text = "Checkbox list", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DropDownSingle, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DropDownSingle}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.DropdownGuid, Text = "Dropdown", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -41, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-41", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.DatePickerGuid, Text = "Date Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -40, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-40", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.RadioboxGuid, Text = "Radiobox", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DropDownMultiple, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DropDownMultiple}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.DropdownMultipleGuid, Text = "Dropdown multiple", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -37, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-37", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.ApprovedColorGuid, Text = "Approved Color", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DateTime, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DateTime}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.DatePickerWithTimeGuid, Text = "Date Picker with time", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultContentListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DefaultContentListView}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.ListViewContentGuid, Text = Constants.Conventions.DataTypes.ListViewPrefix + "Content", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMediaListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DefaultMediaListView}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.ListViewMediaGuid, Text = Constants.Conventions.DataTypes.ListViewPrefix + "Media", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMembersListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DefaultMembersListView}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.ListViewMembersGuid, Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1031, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1031", SortOrder = 2, UniqueId = new Guid("f38bd2d7-65d0-48e6-95dc-87ce06ec2d3d"), Text = Constants.Conventions.MediaTypes.Folder, NodeObjectType = Constants.ObjectTypes.MediaType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1032, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1032", SortOrder = 2, UniqueId = new Guid("cc07b313-0843-4aa8-bbda-871c8da728c8"), Text = Constants.Conventions.MediaTypes.Image, NodeObjectType = Constants.ObjectTypes.MediaType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1033, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1033", SortOrder = 2, UniqueId = new Guid("4c52d8ab-54e6-40cd-999c-7a5f24903e4d"), Text = Constants.Conventions.MediaTypes.File, NodeObjectType = Constants.ObjectTypes.MediaType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1041, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1041", SortOrder = 2, UniqueId = new Guid("b6b73142-b9c1-4bf8-a16d-e1c23320b549"), Text = "Tags", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1043, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1043", SortOrder = 2, UniqueId = new Guid("1df9f033-e6d4-451f-b8d2-e0cbc50a836f"), Text = "Image Cropper", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Tags, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Tags}", SortOrder = 2, UniqueId = new Guid("b6b73142-b9c1-4bf8-a16d-e1c23320b549"), Text = "Tags", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.ImageCropper, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.ImageCropper}", SortOrder = 2, UniqueId = new Guid("1df9f033-e6d4-451f-b8d2-e0cbc50a836f"), Text = "Image Cropper", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1044, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1044", SortOrder = 0, UniqueId = new Guid("d59be02f-1df9-4228-aa1e-01917d806cda"), Text = Constants.Conventions.MemberTypes.DefaultAlias, NodeObjectType = Constants.ObjectTypes.MemberType, CreateDate = DateTime.Now });
//New UDI pickers with newer Ids
@@ -155,10 +155,10 @@ namespace Umbraco.Core.Migrations.Install
private void CreateContentTypeData()
{
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 532, NodeId = 1031, Alias = Constants.Conventions.MediaTypes.Folder, Icon = "icon-folder", Thumbnail = "icon-folder", IsContainer = false, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 533, NodeId = 1032, Alias = Constants.Conventions.MediaTypes.Image, Icon = "icon-picture", Thumbnail = "icon-picture", AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 534, NodeId = 1033, Alias = Constants.Conventions.MediaTypes.File, Icon = "icon-document", Thumbnail = "icon-document", AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 531, NodeId = 1044, Alias = Constants.Conventions.MemberTypes.DefaultAlias, Icon = "icon-user", Thumbnail = "icon-user", Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 532, NodeId = 1031, Alias = Constants.Conventions.MediaTypes.Folder, Icon = Constants.Icons.MediaFolder, Thumbnail = Constants.Icons.MediaFolder, IsContainer = false, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 533, NodeId = 1032, Alias = Constants.Conventions.MediaTypes.Image, Icon = Constants.Icons.MediaImage, Thumbnail = Constants.Icons.MediaImage, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 534, NodeId = 1033, Alias = Constants.Conventions.MediaTypes.File, Icon = Constants.Icons.MediaFile, Thumbnail = Constants.Icons.MediaFile, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 531, NodeId = 1044, Alias = Constants.Conventions.MemberTypes.DefaultAlias, Icon = Constants.Icons.Member, Thumbnail = Constants.Icons.Member, Variations = (byte) ContentVariation.Nothing });
}
private void CreateUserData()
@@ -210,19 +210,19 @@ namespace Umbraco.Core.Migrations.Install
private void CreatePropertyTypeData()
{
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = 1043, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = true, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = Constants.DataTypes.ImageCropper, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = true, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 7, UniqueId = 7.ToGuid(), DataTypeId = Constants.DataTypes.LabelInt, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Width, Name = "Width", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in pixels", Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 8, UniqueId = 8.ToGuid(), DataTypeId = Constants.DataTypes.LabelInt, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Height, Name = "Height", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in pixels", Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 9, UniqueId = 9.ToGuid(), DataTypeId = Constants.DataTypes.LabelBigint, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in bytes", Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 10, UniqueId = 10.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Extension, Name = "Type", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 24, UniqueId = 24.ToGuid(), DataTypeId = -90, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.File, Name = "Upload file", SortOrder = 0, Mandatory = true, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 24, UniqueId = 24.ToGuid(), DataTypeId = Constants.DataTypes.Upload, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.File, Name = "Upload file", SortOrder = 0, Mandatory = true, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 25, UniqueId = 25.ToGuid(), DataTypeId = -92, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.Extension, Name = "Type", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 26, UniqueId = 26.ToGuid(), DataTypeId = Constants.DataTypes.LabelBigint, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in bytes", Variations = (byte) ContentVariation.Nothing });
//membership property types
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 28, UniqueId = 28.ToGuid(), DataTypeId = -89, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.Comments, Name = Constants.Conventions.Member.CommentsLabel, SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 28, UniqueId = 28.ToGuid(), DataTypeId = Constants.DataTypes.Textarea, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.Comments, Name = Constants.Conventions.Member.CommentsLabel, SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 29, UniqueId = 29.ToGuid(), DataTypeId = Constants.DataTypes.LabelInt, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.FailedPasswordAttempts, Name = Constants.Conventions.Member.FailedPasswordAttemptsLabel, SortOrder = 1, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 30, UniqueId = 30.ToGuid(), DataTypeId = -49, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.IsApproved, Name = Constants.Conventions.Member.IsApprovedLabel, SortOrder = 2, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 31, UniqueId = 31.ToGuid(), DataTypeId = -49, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.IsLockedOut, Name = Constants.Conventions.Member.IsLockedOutLabel, SortOrder = 3, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 30, UniqueId = 30.ToGuid(), DataTypeId = Constants.DataTypes.Boolean, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.IsApproved, Name = Constants.Conventions.Member.IsApprovedLabel, SortOrder = 2, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 31, UniqueId = 31.ToGuid(), DataTypeId = Constants.DataTypes.Boolean, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.IsLockedOut, Name = Constants.Conventions.Member.IsLockedOutLabel, SortOrder = 3, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 32, UniqueId = 32.ToGuid(), DataTypeId = Constants.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastLockoutDate, Name = Constants.Conventions.Member.LastLockoutDateLabel, SortOrder = 4, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 33, UniqueId = 33.ToGuid(), DataTypeId = Constants.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastLoginDate, Name = Constants.Conventions.Member.LastLoginDateLabel, SortOrder = 5, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 34, UniqueId = 34.ToGuid(), DataTypeId = Constants.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastPasswordChangeDate, Name = Constants.Conventions.Member.LastPasswordChangeDateLabel, SortOrder = 6, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
@@ -266,30 +266,30 @@ namespace Umbraco.Core.Migrations.Install
const string layouts = "[" + cardLayout + "," + listLayout + "]";
// TODO: Check which of the DataTypeIds below doesn't exist in umbracoNode, which results in a foreign key constraint errors.
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -49, EditorAlias = Constants.PropertyEditors.Aliases.Boolean, DbType = "Integer" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Boolean, EditorAlias = Constants.PropertyEditors.Aliases.Boolean, DbType = "Integer" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -51, EditorAlias = Constants.PropertyEditors.Aliases.Integer, DbType = "Integer" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -87, EditorAlias = Constants.PropertyEditors.Aliases.TinyMce, DbType = "Ntext",
Configuration = "{\"value\":\",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,|1|1,2,3,|0|500,400|1049,|true|\"}" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -88, EditorAlias = Constants.PropertyEditors.Aliases.TextBox, DbType = "Nvarchar" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -89, EditorAlias = Constants.PropertyEditors.Aliases.TextArea, DbType = "Ntext" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -90, EditorAlias = Constants.PropertyEditors.Aliases.UploadField, DbType = "Nvarchar" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Textbox, EditorAlias = Constants.PropertyEditors.Aliases.TextBox, DbType = "Nvarchar" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Textarea, EditorAlias = Constants.PropertyEditors.Aliases.TextArea, DbType = "Ntext" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Upload, EditorAlias = Constants.PropertyEditors.Aliases.UploadField, DbType = "Nvarchar" });
InsertDataTypeDto(Constants.DataTypes.LabelString, Constants.PropertyEditors.Aliases.Label, "Nvarchar", "{\"umbracoDataValueType\":\"STRING\"}");
InsertDataTypeDto(Constants.DataTypes.LabelInt, Constants.PropertyEditors.Aliases.Label, "Integer", "{\"umbracoDataValueType\":\"INT\"}");
InsertDataTypeDto(Constants.DataTypes.LabelBigint, Constants.PropertyEditors.Aliases.Label, "Nvarchar", "{\"umbracoDataValueType\":\"BIGINT\"}");
InsertDataTypeDto(Constants.DataTypes.LabelDateTime, Constants.PropertyEditors.Aliases.Label, "Date", "{\"umbracoDataValueType\":\"DATETIME\"}");
InsertDataTypeDto(Constants.DataTypes.LabelDecimal, Constants.PropertyEditors.Aliases.Label, "Decimal", "{\"umbracoDataValueType\":\"DECIMAL\"}");
InsertDataTypeDto(Constants.DataTypes.LabelTime, Constants.PropertyEditors.Aliases.Label, "Date", "{\"umbracoDataValueType\":\"TIME\"}");
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -36, EditorAlias = Constants.PropertyEditors.Aliases.DateTime, DbType = "Date" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.DateTime, EditorAlias = Constants.PropertyEditors.Aliases.DateTime, DbType = "Date" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -37, EditorAlias = Constants.PropertyEditors.Aliases.ColorPicker, DbType = "Nvarchar" });
InsertDataTypeDto(Constants.DataTypes.DropDownSingle, Constants.PropertyEditors.Aliases.DropDownListFlexible, "Nvarchar", "{\"multiple\":false}");
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -40, EditorAlias = Constants.PropertyEditors.Aliases.RadioButtonList, DbType = "Nvarchar" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -41, EditorAlias = "Umbraco.DateTime", DbType = "Date", Configuration = "{\"format\":\"YYYY-MM-DD\"}" });
InsertDataTypeDto(Constants.DataTypes.DropDownMultiple, Constants.PropertyEditors.Aliases.DropDownListFlexible, "Nvarchar", "{\"multiple\":true}");
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -43, EditorAlias = Constants.PropertyEditors.Aliases.CheckBoxList, DbType = "Nvarchar" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1041, EditorAlias = Constants.PropertyEditors.Aliases.Tags, DbType = "Ntext",
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Tags, EditorAlias = Constants.PropertyEditors.Aliases.Tags, DbType = "Ntext",
Configuration = "{\"group\":\"default\", \"storageType\":\"Json\"}"
});
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1043, EditorAlias = Constants.PropertyEditors.Aliases.ImageCropper, DbType = "Ntext" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.ImageCropper, EditorAlias = Constants.PropertyEditors.Aliases.ImageCropper, DbType = "Ntext" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.DefaultContentListView, EditorAlias = Constants.PropertyEditors.Aliases.ListView, DbType = "Nvarchar",
Configuration = "{\"pageSize\":100, \"orderBy\":\"updateDate\", \"orderDirection\":\"desc\", \"layouts\":" + layouts + ", \"includeProperties\":[{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1},{\"alias\":\"owner\",\"header\":\"Updated by\",\"isSystem\":1}]}" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.DefaultMediaListView, EditorAlias = Constants.PropertyEditors.Aliases.ListView, DbType = "Nvarchar",
@@ -74,6 +74,11 @@ namespace Umbraco.Core.Migrations.Upgrade
throw new InvalidOperationException($"Version {currentVersion} cannot be migrated to {UmbracoVersion.SemanticVersion}."
+ $" Please upgrade first to at least {minVersion}.");
// Force versions between 7.14.*-7.15.* into into 7.14 initial state. Because there is no db-changes,
// and we don't want users to workaround my putting in version 7.14.0 them self.
if (minVersion <= currentVersion && currentVersion < new SemVersion(7, 16))
return GetInitState(minVersion);
// initial state is eg "{init-7.14.0}"
return GetInitState(currentVersion);
}
@@ -19,8 +19,8 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
var sqlDataTypes = Sql()
.Select<DataTypeDto>()
.From<DataTypeDto>()
.Where<DataTypeDto>(x => x.EditorAlias == "Umbraco.RelatedLinks"
|| x.EditorAlias == "Umbraco.RelatedLinks2");
.Where<DataTypeDto>(x => x.EditorAlias == Constants.PropertyEditors.Legacy.Aliases.RelatedLinks
|| x.EditorAlias == Constants.PropertyEditors.Legacy.Aliases.RelatedLinks2);
var dataTypes = Database.Fetch<DataTypeDto>(sqlDataTypes);
var dataTypeIds = dataTypes.Select(x => x.NodeId).ToList();
@@ -50,10 +50,10 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
var properties = Database.Fetch<PropertyDataDto>(sqlPropertyData);
// Create a Multi URL Picker datatype for the converted RelatedLinks data
foreach (var property in properties)
{
var value = property.Value.ToString();
var value = property.Value?.ToString();
if (string.IsNullOrWhiteSpace(value))
continue;
@@ -89,7 +89,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
Name = relatedLink.Caption,
Target = relatedLink.NewWindow ? "_blank" : null,
Udi = udi,
// Should only have a URL if it's an external link otherwise it wil be a UDI
// Should only have a URL if it's an external link otherwise it wil be a UDI
Url = relatedLink.IsInternal == false ? relatedLink.Link : null
};
@@ -103,7 +103,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
Database.Update(property);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Umbraco.Core.Composing;
@@ -18,6 +19,18 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
private readonly PropertyEditorCollection _propertyEditors;
private readonly ILogger _logger;
private static readonly ISet<string> LegacyAliases = new HashSet<string>()
{
Constants.PropertyEditors.Legacy.Aliases.Date,
Constants.PropertyEditors.Legacy.Aliases.Textbox,
Constants.PropertyEditors.Legacy.Aliases.ContentPicker2,
Constants.PropertyEditors.Legacy.Aliases.MediaPicker2,
Constants.PropertyEditors.Legacy.Aliases.MemberPicker2,
Constants.PropertyEditors.Legacy.Aliases.RelatedLinks2,
Constants.PropertyEditors.Legacy.Aliases.TextboxMultiple,
Constants.PropertyEditors.Legacy.Aliases.MultiNodeTreePicker2,
};
public DataTypeMigration(IMigrationContext context, PreValueMigratorCollection preValueMigrators, PropertyEditorCollection propertyEditors, ILogger logger)
: base(context)
{
@@ -70,16 +83,23 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
var newAlias = migrator.GetNewAlias(dataType.EditorAlias);
if (newAlias == null)
{
_logger.Warn<DataTypeMigration>("Skipping validation of configuration for data type {NodeId} : {EditorAlias}."
+ " Please ensure that the configuration is valid. The site may fail to start and / or load data types and run.",
dataType.NodeId, dataType.EditorAlias);
if (!LegacyAliases.Contains(dataType.EditorAlias))
{
_logger.Warn<DataTypeMigration>(
"Skipping validation of configuration for data type {NodeId} : {EditorAlias}."
+ " Please ensure that the configuration is valid. The site may fail to start and / or load data types and run.",
dataType.NodeId, dataType.EditorAlias);
}
}
else if (!_propertyEditors.TryGet(newAlias, out var propertyEditor))
{
_logger.Warn<DataTypeMigration>("Skipping validation of configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})"
+ " because no property editor with that alias was found."
+ " Please ensure that the configuration is valid. The site may fail to start and / or load data types and run.",
dataType.NodeId, newAlias, dataType.EditorAlias);
if (!LegacyAliases.Contains(newAlias))
{
_logger.Warn<DataTypeMigration>("Skipping validation of configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})"
+ " because no property editor with that alias was found."
+ " Please ensure that the configuration is valid. The site may fail to start and / or load data types and run.",
dataType.NodeId, newAlias, dataType.EditorAlias);
}
}
else
{
@@ -3,7 +3,7 @@
class ContentPickerPreValueMigrator : DefaultPreValueMigrator
{
public override bool CanMigrate(string editorAlias)
=> editorAlias == "Umbraco.ContentPicker2";
=> editorAlias == Constants.PropertyEditors.Legacy.Aliases.ContentPicker2;
public override string GetNewAlias(string editorAlias)
=> null;
@@ -0,0 +1,32 @@
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes
{
class DropDownFlexiblePreValueMigrator : IPreValueMigrator
{
public bool CanMigrate(string editorAlias)
=> editorAlias == "Umbraco.DropDown.Flexible";
public virtual string GetNewAlias(string editorAlias)
=> null;
public object GetConfiguration(int dataTypeId, string editorAlias, Dictionary<string, PreValueDto> preValues)
{
var config = new DropDownFlexibleConfiguration();
foreach (var preValue in preValues.Values)
{
if (preValue.Alias == "multiple")
{
config.Multiple = (preValue.Value == "1");
}
else
{
config.Items.Add(new ValueListConfiguration.ValueListItem { Id = preValue.Id, Value = preValue.Value });
}
}
return config;
}
}
}
@@ -0,0 +1,19 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes
{
class MarkdownEditorPreValueMigrator : DefaultPreValueMigrator //PreValueMigratorBase
{
public override bool CanMigrate(string editorAlias)
=> editorAlias == Constants.PropertyEditors.Aliases.MarkdownEditor;
protected override object GetPreValueValue(PreValueDto preValue)
{
if (preValue.Alias == "preview")
return preValue.Value == "1";
return base.GetPreValueValue(preValue);
}
}
}
@@ -6,15 +6,15 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes
{
private readonly string[] _editors =
{
"Umbraco.MediaPicker2",
"Umbraco.MediaPicker"
Constants.PropertyEditors.Legacy.Aliases.MediaPicker2,
Constants.PropertyEditors.Aliases.MediaPicker
};
public override bool CanMigrate(string editorAlias)
=> _editors.Contains(editorAlias);
public override string GetNewAlias(string editorAlias)
=> "Umbraco.MediaPicker";
=> Constants.PropertyEditors.Aliases.MediaPicker;
// you wish - but MediaPickerConfiguration lives in Umbraco.Web
/*
@@ -2,24 +2,26 @@
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes
{
[RuntimeLevel(MinLevel = RuntimeLevel.Upgrade, MaxLevel = RuntimeLevel.Upgrade)] // only on upgrades
public class PreValueMigratorComposer : ICoreComposer
[RuntimeLevel(MinLevel = RuntimeLevel.Upgrade, MaxLevel = RuntimeLevel.Upgrade)] // only on upgrades
public class PreValueMigratorComposer : ICoreComposer
{
public void Compose(Composition composition)
{
public void Compose(Composition composition)
{
// do NOT add DefaultPreValueMigrator to this list!
// it will be automatically used if nothing matches
// do NOT add DefaultPreValueMigrator to this list!
// it will be automatically used if nothing matches
composition.WithCollectionBuilder<PreValueMigratorCollectionBuilder>()
.Append<RenamingPreValueMigrator>()
.Append<RichTextPreValueMigrator>()
.Append<UmbracoSliderPreValueMigrator>()
.Append<MediaPickerPreValueMigrator>()
.Append<ContentPickerPreValueMigrator>()
.Append<NestedContentPreValueMigrator>()
.Append<DecimalPreValueMigrator>()
.Append<ListViewPreValueMigrator>()
.Append<ValueListPreValueMigrator>();
}
composition.WithCollectionBuilder<PreValueMigratorCollectionBuilder>()
.Append<RenamingPreValueMigrator>()
.Append<RichTextPreValueMigrator>()
.Append<UmbracoSliderPreValueMigrator>()
.Append<MediaPickerPreValueMigrator>()
.Append<ContentPickerPreValueMigrator>()
.Append<NestedContentPreValueMigrator>()
.Append<DecimalPreValueMigrator>()
.Append<ListViewPreValueMigrator>()
.Append<DropDownFlexiblePreValueMigrator>()
.Append<ValueListPreValueMigrator>()
.Append<MarkdownEditorPreValueMigrator>();
}
}
}
@@ -1,5 +1,6 @@
using System;
using System.Linq;
using Umbraco.Core.Exceptions;
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes
{
@@ -20,7 +21,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes
case "Umbraco.NoEdit":
return Constants.PropertyEditors.Aliases.Label;
default:
throw new Exception("panic");
throw new PanicException($"The alias {editorAlias} is not supported");
}
}
}
@@ -9,6 +9,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes
private readonly string[] _editors =
{
"Umbraco.RadioButtonList",
"Umbraco.CheckBoxList",
"Umbraco.DropDown",
"Umbraco.DropdownlistPublishingKeys",
"Umbraco.DropDownMultiple",
@@ -16,7 +16,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
public override void Migrate()
{
var dataTypes = GetDataTypes("Umbraco.Date");
var dataTypes = GetDataTypes(Constants.PropertyEditors.Legacy.Aliases.Date);
foreach (var dataType in dataTypes)
{
@@ -25,6 +25,14 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
{
config = (DateTimeConfiguration) new CustomDateTimeConfigurationEditor().FromDatabase(
dataType.Configuration);
// If the Umbraco.Date type is the default from V7 and it has never been updated, then the
// configuration is empty, and the format stuff is handled by in JS by moment.js. - We can't do that
// after the migration, so we force the format to the default from V7.
if (string.IsNullOrEmpty(dataType.Configuration))
{
config.Format = "YYYY-MM-DD";
};
}
catch (Exception ex)
{
@@ -12,12 +12,12 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
public override void Migrate()
{
RenameDataType(Constants.PropertyEditors.Aliases.ContentPicker + "2", Constants.PropertyEditors.Aliases.ContentPicker);
RenameDataType(Constants.PropertyEditors.Aliases.MediaPicker + "2", Constants.PropertyEditors.Aliases.MediaPicker);
RenameDataType(Constants.PropertyEditors.Aliases.MemberPicker + "2", Constants.PropertyEditors.Aliases.MemberPicker);
RenameDataType(Constants.PropertyEditors.Aliases.MultiNodeTreePicker + "2", Constants.PropertyEditors.Aliases.MultiNodeTreePicker);
RenameDataType("Umbraco.TextboxMultiple", Constants.PropertyEditors.Aliases.TextArea, false);
RenameDataType("Umbraco.Textbox", Constants.PropertyEditors.Aliases.TextBox, false);
RenameDataType(Constants.PropertyEditors.Legacy.Aliases.ContentPicker2, Constants.PropertyEditors.Aliases.ContentPicker);
RenameDataType(Constants.PropertyEditors.Legacy.Aliases.MediaPicker2, Constants.PropertyEditors.Aliases.MediaPicker);
RenameDataType(Constants.PropertyEditors.Legacy.Aliases.MemberPicker2, Constants.PropertyEditors.Aliases.MemberPicker);
RenameDataType(Constants.PropertyEditors.Legacy.Aliases.MultiNodeTreePicker2, Constants.PropertyEditors.Aliases.MultiNodeTreePicker);
RenameDataType(Constants.PropertyEditors.Legacy.Aliases.TextboxMultiple, Constants.PropertyEditors.Aliases.TextArea, false);
RenameDataType(Constants.PropertyEditors.Legacy.Aliases.Textbox, Constants.PropertyEditors.Aliases.TextBox, false);
}
private void RenameDataType(string fromAlias, string toAlias, bool checkCollision = true)
@@ -30,7 +30,20 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
.Where<DataTypeDto>(x => x.EditorAlias == toAlias));
if (oldCount > 0)
throw new InvalidOperationException($"Cannot rename datatype alias \"{fromAlias}\" to \"{toAlias}\" because the target alias is already used.");
{
// If we throw it means that the upgrade will exit and cannot continue.
// This will occur if a v7 site has the old "Obsolete" property editors that are already named with the `toAlias` name.
// TODO: We should have an additional upgrade step when going from 7 -> 8 like we did with 6 -> 7 that shows a compatibility report,
// this would include this check and then we can provide users with information on what they should do (i.e. before upgrading to v8 they will
// need to migrate these old obsolete editors to non-obsolete editors)
throw new InvalidOperationException(
$"Cannot rename datatype alias \"{fromAlias}\" to \"{toAlias}\" because the target alias is already used." +
$"This is generally because when upgrading from a v7 to v8 site, the v7 site contains Data Types that reference old and already Obsolete " +
$"Property Editors. Before upgrading to v8, any Data Types using property editors that are named with the prefix '(Obsolete)' must be migrated " +
$"to the non-obsolete v7 property editors of the same type.");
}
}
Database.Execute(Sql()
@@ -15,21 +15,17 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
{
//special trick to add the column without constraints and return the sql to add them later
AddColumn<MacroDto>("macroType", out var sqls1);
//now we need to update the new column with some values because this column doesn't allow NULL values
Update.Table(Constants.DatabaseSchema.Tables.Macro).Set(new { macroType = (int)MacroTypes.Unknown}).AllRows().Do();
//now apply constraints (NOT NULL) to new table
foreach (var sql in sqls1) Execute.Sql(sql).Do();
//special trick to add the column without constraints and return the sql to add them later
AddColumn<MacroDto>("macroSource", out var sqls2);
//populate the new macroSource column with legacy data
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroXSLT, macroType = {(int)MacroTypes.Unknown} WHERE macroXSLT IS NOT NULL").Do();
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroScriptAssembly, macroType = {(int)MacroTypes.Unknown} WHERE macroScriptAssembly IS NOT NULL").Do();
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroScriptType, macroType = {(int)MacroTypes.Unknown} WHERE macroScriptType IS NOT NULL").Do();
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroPython, macroType = {(int)MacroTypes.PartialView} WHERE macroPython IS NOT NULL").Do();
//populate the new columns with legacy data
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = '', macroType = {(int)MacroTypes.Unknown}").Do();
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroXSLT, macroType = {(int)MacroTypes.Unknown} WHERE macroXSLT != '' AND macroXSLT IS NOT NULL").Do();
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroScriptAssembly, macroType = {(int)MacroTypes.Unknown} WHERE macroScriptAssembly != '' AND macroScriptAssembly IS NOT NULL").Do();
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroScriptType, macroType = {(int)MacroTypes.Unknown} WHERE macroScriptType != '' AND macroScriptType IS NOT NULL").Do();
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroPython, macroType = {(int)MacroTypes.PartialView} WHERE macroPython != '' AND macroPython IS NOT NULL").Do();
//now apply constraints (NOT NULL) to new table
foreach (var sql in sqls1) Execute.Sql(sql).Do();
foreach (var sql in sqls2) Execute.Sql(sql).Do();
//now remove these old columns
@@ -14,11 +14,18 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
public override void Migrate()
{
//Get anything currently scheduled
var scheduleSql = new Sql()
.Select("nodeId", "releaseDate", "expireDate")
var releaseSql = new Sql()
.Select("nodeId", "releaseDate")
.From("umbracoDocument")
.Where("releaseDate IS NOT NULL OR expireDate IS NOT NULL");
var schedules = Database.Dictionary<int, (DateTime? releaseDate, DateTime? expireDate)> (scheduleSql);
.Where("releaseDate IS NOT NULL");
var releases = Database.Dictionary<int, DateTime> (releaseSql);
var expireSql = new Sql()
.Select("nodeId", "expireDate")
.From("umbracoDocument")
.Where("expireDate IS NOT NULL");
var expires = Database.Dictionary<int, DateTime>(expireSql);
//drop old cols
Delete.Column("releaseDate").FromTable("umbracoDocument").Do();
@@ -27,20 +34,25 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
Create.Table<ContentScheduleDto>(true).Do();
//migrate the schedule
foreach(var s in schedules)
foreach(var s in releases)
{
var date = s.Value.releaseDate;
var date = s.Value;
var action = ContentScheduleAction.Release.ToString();
if (!date.HasValue)
{
date = s.Value.expireDate;
action = ContentScheduleAction.Expire.ToString();
}
Insert.IntoTable(ContentScheduleDto.TableName)
.Row(new { nodeId = s.Key, date = date.Value, action = action })
.Row(new { id = Guid.NewGuid(), nodeId = s.Key, date = date, action = action })
.Do();
}
foreach (var s in expires)
{
var date = s.Value;
var action = ContentScheduleAction.Expire.ToString();
Insert.IntoTable(ContentScheduleDto.TableName)
.Row(new { id = Guid.NewGuid(), nodeId = s.Key, date = date, action = action })
.Do();
}
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
@@ -36,6 +37,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_1_0
var properties = Database.Fetch<PropertyDataDto>(sqlPropertyData);
var exceptions = new List<Exception>();
foreach (var property in properties)
{
var value = property.TextValue;
@@ -43,19 +45,34 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_1_0
if (property.PropertyTypeDto.DataTypeDto.EditorAlias == Constants.PropertyEditors.Aliases.Grid)
{
var obj = JsonConvert.DeserializeObject<JObject>(value);
var allControls = obj.SelectTokens("$.sections..rows..areas..controls");
foreach (var control in allControls.SelectMany(c => c))
try
{
var controlValue = control["value"];
if (controlValue.Type == JTokenType.String)
var obj = JsonConvert.DeserializeObject<JObject>(value);
var allControls = obj.SelectTokens("$.sections..rows..areas..controls");
foreach (var control in allControls.SelectMany(c => c).OfType<JObject>())
{
control["value"] = UpdateMediaUrls(mediaLinkPattern, controlValue.Value<string>());
var controlValue = control["value"];
if (controlValue?.Type == JTokenType.String)
{
control["value"] = UpdateMediaUrls(mediaLinkPattern, controlValue.Value<string>());
}
}
property.TextValue = JsonConvert.SerializeObject(obj);
}
catch (JsonException e)
{
exceptions.Add(new InvalidOperationException(
"Cannot deserialize the value as json. This can be because the property editor " +
"type is changed from another type into a grid. Old versions of the value in this " +
"property can have the structure from the old property editor type. This needs to be " +
"changed manually before updating the database.\n" +
$"Property info: Id = {property.Id}, LanguageId = {property.LanguageId}, VersionId = {property.VersionId}, Value = {property.Value}"
, e));
continue;
}
property.TextValue = JsonConvert.SerializeObject(obj);
}
else
{
@@ -65,6 +82,12 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_1_0
Database.Update(property);
}
if (exceptions.Any())
{
throw new AggregateException("One or more errors related to unexpected data in grid values occurred.", exceptions);
}
Context.AddPostMigration<RebuildPublishedSnapshot>();
}
@@ -222,7 +222,13 @@ namespace Umbraco.Core.Models
return true;
}
public static void UnpublishCulture(this IContent content, string culture = "*")
/// <summary>
/// Returns false if the culture is already unpublished
/// </summary>
/// <param name="content"></param>
/// <param name="culture"></param>
/// <returns></returns>
public static bool UnpublishCulture(this IContent content, string culture = "*")
{
culture = culture.NullOrWhiteSpaceAsNull();
@@ -230,16 +236,31 @@ namespace Umbraco.Core.Models
if (!content.ContentType.SupportsPropertyVariation(culture, "*", true))
throw new NotSupportedException($"Culture \"{culture}\" is not supported by content type \"{content.ContentType.Alias}\" with variation \"{content.ContentType.Variations}\".");
if (culture == "*") // all cultures
var keepProcessing = true;
if (culture == "*")
{
// all cultures
content.ClearPublishInfos();
else // one single culture
content.ClearPublishInfo(culture);
}
else
{
// one single culture
keepProcessing = content.ClearPublishInfo(culture);
}
// property.PublishValues only publishes what is valid, variation-wise
foreach (var property in content.Properties)
property.UnpublishValues(culture);
if (keepProcessing)
{
// property.PublishValues only publishes what is valid, variation-wise
foreach (var property in content.Properties)
property.UnpublishValues(culture);
content.PublishedState = PublishedState.Publishing;
content.PublishedState = PublishedState.Publishing;
}
return keepProcessing;
}
public static void ClearPublishInfos(this IContent content)
@@ -247,15 +268,24 @@ namespace Umbraco.Core.Models
content.PublishCultureInfos = null;
}
public static void ClearPublishInfo(this IContent content, string culture)
/// <summary>
/// Returns false if the culture is already unpublished
/// </summary>
/// <param name="content"></param>
/// <param name="culture"></param>
/// <returns></returns>
public static bool ClearPublishInfo(this IContent content, string culture)
{
if (culture.IsNullOrWhiteSpace())
throw new ArgumentNullOrEmptyException(nameof(culture));
content.PublishCultureInfos.Remove(culture);
// set the culture to be dirty - it's been modified
content.TouchCulture(culture);
var removed = content.PublishCultureInfos.Remove(culture);
if (removed)
{
// set the culture to be dirty - it's been modified
content.TouchCulture(culture);
}
return removed;
}
/// <summary>
@@ -35,5 +35,58 @@ namespace Umbraco.Core.Models
throw new InvalidCastException($"Cannot cast dataType configuration, of type {configuration.GetType().Name}, to {typeof(T).Name}.");
}
private static readonly ISet<Guid> IdsOfBuildInDataTypes = new HashSet<Guid>()
{
Constants.DataTypes.Guids.ContentPickerGuid,
Constants.DataTypes.Guids.MemberPickerGuid,
Constants.DataTypes.Guids.MediaPickerGuid,
Constants.DataTypes.Guids.MultipleMediaPickerGuid,
Constants.DataTypes.Guids.RelatedLinksGuid,
Constants.DataTypes.Guids.MemberGuid,
Constants.DataTypes.Guids.ImageCropperGuid,
Constants.DataTypes.Guids.TagsGuid,
Constants.DataTypes.Guids.ListViewContentGuid,
Constants.DataTypes.Guids.ListViewMediaGuid,
Constants.DataTypes.Guids.ListViewMembersGuid,
Constants.DataTypes.Guids.DatePickerWithTimeGuid,
Constants.DataTypes.Guids.ApprovedColorGuid,
Constants.DataTypes.Guids.DropdownMultipleGuid,
Constants.DataTypes.Guids.RadioboxGuid,
Constants.DataTypes.Guids.DatePickerGuid,
Constants.DataTypes.Guids.DropdownGuid,
Constants.DataTypes.Guids.CheckboxListGuid,
Constants.DataTypes.Guids.CheckboxGuid,
Constants.DataTypes.Guids.NumericGuid,
Constants.DataTypes.Guids.RichtextEditorGuid,
Constants.DataTypes.Guids.TextstringGuid,
Constants.DataTypes.Guids.TextareaGuid,
Constants.DataTypes.Guids.UploadGuid,
Constants.DataTypes.Guids.LabelStringGuid,
Constants.DataTypes.Guids.LabelDecimalGuid,
Constants.DataTypes.Guids.LabelDateTimeGuid,
Constants.DataTypes.Guids.LabelBigIntGuid,
Constants.DataTypes.Guids.LabelTimeGuid,
Constants.DataTypes.Guids.LabelDateTimeGuid,
};
/// <summary>
/// Returns true if this date type is build-in/default.
/// </summary>
/// <param name="dataType">The data type definition.</param>
/// <returns></returns>
internal static bool IsBuildInDataType(this IDataType dataType)
{
return IsBuildInDataType(dataType.Key);
}
/// <summary>
/// Returns true if this date type is build-in/default.
/// </summary>
internal static bool IsBuildInDataType(Guid key)
{
return IdsOfBuildInDataTypes.Contains(key);
}
}
}
@@ -3,6 +3,7 @@ using System.Linq;
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Implements <see cref="IDocumentEntitySlim"/>.
/// </summary>
+1 -31
View File
@@ -81,37 +81,7 @@ namespace Umbraco.Core.Models.Entities
_key = Guid.Empty;
_hasIdentity = false;
}
/// <summary>
/// Updates the entity when it is being saved for the first time.
/// </summary>
internal virtual void AddingEntity()
{
var now = DateTime.Now;
// set the create and update dates, if not already set
if (IsPropertyDirty("CreateDate") == false || _createDate == default)
CreateDate = now;
if (IsPropertyDirty("UpdateDate") == false || _updateDate == default)
UpdateDate = now;
}
/// <summary>
/// Updates the entity when it is being saved.
/// </summary>
internal virtual void UpdatingEntity()
{
var now = DateTime.Now;
// just in case
if (_createDate == default)
CreateDate = now;
// set the update date if not already set
if (IsPropertyDirty("UpdateDate") == false || _updateDate == default)
UpdateDate = now;
}
public virtual bool Equals(EntityBase other)
{
return other != null && (ReferenceEquals(this, other) || SameIdentityAs(other));
@@ -0,0 +1,46 @@
using System;
namespace Umbraco.Core.Models.Entities
{
internal static class EntityExtensions
{
/// <summary>
/// Updates the entity when it is being saved.
/// </summary>
internal static void UpdatingEntity(this IEntity entity)
{
var now = DateTime.Now;
// just in case
if (entity.CreateDate == default)
{
entity.CreateDate = now;
}
// set the update date if not already set
if (entity.UpdateDate == default || (entity is ICanBeDirty canBeDirty && canBeDirty.IsPropertyDirty("UpdateDate") == false))
{
entity.UpdateDate = now;
}
}
/// <summary>
/// Updates the entity when it is being saved for the first time.
/// </summary>
internal static void AddingEntity(this IEntity entity)
{
var now = DateTime.Now;
var canBeDirty = entity as ICanBeDirty;
// set the create and update dates, if not already set
if (entity.CreateDate == default || canBeDirty?.IsPropertyDirty("CreateDate") == false)
{
entity.CreateDate = now;
}
if (entity.UpdateDate == default || canBeDirty?.IsPropertyDirty("UpdateDate") == false)
{
entity.UpdateDate = now;
}
}
}
}
@@ -111,52 +111,6 @@ namespace Umbraco.Core.Models.Entities
public virtual bool IsContainer { get; set; }
/// <summary>
/// Represents a lightweight property.
/// </summary>
public class PropertySlim
{
/// <summary>
/// Initializes a new instance of the <see cref="PropertySlim"/> class.
/// </summary>
public PropertySlim(string editorAlias, object value)
{
PropertyEditorAlias = editorAlias;
Value = value;
}
/// <summary>
/// Gets the property editor alias.
/// </summary>
public string PropertyEditorAlias { get; }
/// <summary>
/// Gets the property value.
/// </summary>
public object Value { get; }
protected bool Equals(PropertySlim other)
{
return PropertyEditorAlias.Equals(other.PropertyEditorAlias) && Equals(Value, other.Value);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != GetType()) return false;
return Equals((PropertySlim) obj);
}
public override int GetHashCode()
{
unchecked
{
return (PropertyEditorAlias.GetHashCode() * 397) ^ (Value != null ? Value.GetHashCode() : 0);
}
}
}
#region IDeepCloneable
/// <inheritdoc />
@@ -2,6 +2,7 @@
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Represents a lightweight document entity, managed by the entity service.
/// </summary>
@@ -0,0 +1,14 @@
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Represents a lightweight media entity, managed by the entity service.
/// </summary>
public interface IMediaEntitySlim : IContentEntitySlim
{
/// <summary>
/// The media file's path/url
/// </summary>
string MediaPath { get; }
}
}
@@ -0,0 +1,10 @@
namespace Umbraco.Core.Models.Entities
{
/// <summary>
/// Implements <see cref="IMediaEntitySlim"/>.
/// </summary>
public class MediaEntitySlim : ContentEntitySlim, IMediaEntitySlim
{
public string MediaPath { get; set; }
}
}
+1 -1
View File
@@ -101,7 +101,7 @@ namespace Umbraco.Core.Models
PropertyGroupCollection PropertyGroups { get; set; }
/// <summary>
/// Gets all local property types belonging to a group, across all local property groups.
/// Gets all local property types all local property groups or ungrouped.
/// </summary>
IEnumerable<PropertyType> PropertyTypes { get; }
-13
View File
@@ -478,19 +478,6 @@ namespace Umbraco.Core.Models
set => SetPropertyValueAndDetectChanges(value, ref _providerUserKey, nameof(ProviderUserKey));
}
/// <summary>
/// Method to call when Entity is being saved
/// </summary>
/// <remarks>Created date is set and a Unique key is assigned</remarks>
internal override void AddingEntity()
{
base.AddingEntity();
if (ProviderUserKey == null)
ProviderUserKey = Key;
}
/* Internal experiment - only used for mapping queries.
* Adding these to have first level properties instead of the Properties collection.
*/
+9 -1
View File
@@ -21,6 +21,7 @@ namespace Umbraco.Core.Models
private string _alias;
private string _description;
private int _dataTypeId;
private Guid _dataTypeKey;
private Lazy<int> _propertyGroupId;
private string _propertyEditorAlias;
private ValueStorageType _valueStorageType;
@@ -113,7 +114,7 @@ namespace Umbraco.Core.Models
/// Gets of sets the alias of the property type.
/// </summary>
[DataMember]
public string Alias
public virtual string Alias
{
get => _alias;
set => SetPropertyValueAndDetectChanges(SanitizeAlias(value), ref _alias, nameof(Alias));
@@ -139,6 +140,13 @@ namespace Umbraco.Core.Models
set => SetPropertyValueAndDetectChanges(value, ref _dataTypeId, nameof(DataTypeId));
}
[DataMember]
public Guid DataTypeKey
{
get => _dataTypeKey;
set => SetPropertyValueAndDetectChanges(value, ref _dataTypeKey, nameof(DataTypeKey));
}
/// <summary>
/// Gets or sets the alias of the property editor for this property type.
/// </summary>
@@ -13,6 +13,10 @@
/// <summary>
/// Refreshes the factory.
/// </summary>
/// <remarks>
/// <para>This will typically re-compiled models/classes into a new DLL that are used to populate the cache.</para>
/// <para>This is called prior to refreshing the cache.</para>
/// </remarks>
void Refresh();
}
}
@@ -3,7 +3,6 @@ using System.Collections.Generic;
namespace Umbraco.Core.Models.PublishedContent
{
/// <inheritdoc />
/// <summary>
/// Represents a published content item.
@@ -27,21 +26,13 @@ namespace Umbraco.Core.Models.PublishedContent
int Id { get; }
/// <summary>
/// Gets the name of the content item.
/// Gets the name of the content item for the current culture.
/// </summary>
/// <remarks>
/// <para>The value of this property is contextual. When the content type is multi-lingual,
/// this is the name for the 'current' culture. Otherwise, it is the invariant name.</para>
/// </remarks>
string Name { get; }
/// <summary>
/// Gets the url segment of the content item.
/// Gets the url segment of the content item for the current culture.
/// </summary>
/// <remarks>
/// <para>The value of this property is contextual. When the content type is multi-lingual,
/// this is the name for the 'current' culture. Otherwise, it is the invariant url segment.</para>
/// </remarks>
string UrlSegment { get; }
/// <summary>
@@ -94,43 +85,28 @@ namespace Umbraco.Core.Models.PublishedContent
/// </summary>
/// <remarks>
/// <para>For published content items, this is also the date the item was published.</para>
/// <para>This date is always global to the content item, see GetCulture().Date for the
/// <para>This date is always global to the content item, see CultureDate() for the
/// date each culture was published.</para>
/// </remarks>
DateTime UpdateDate { get; }
/// <summary>
/// Gets the url of the content item.
/// Gets the url of the content item for the current culture.
/// </summary>
/// <remarks>
/// <para>The value of this property is contextual. It depends on the 'current' request uri,
/// if any. In addition, when the content type is multi-lingual, this is the url for the
/// 'current' culture. Otherwise, it is the invariant url.</para>
/// if any.</para>
/// </remarks>
string Url { get; }
/// <summary>
/// Gets the url of the content item.
/// </summary>
/// <remarks>
/// <para>The value of this property is contextual. It depends on the 'current' request uri,
/// if any. In addition, when the content type is multi-lingual, this is the url for the
/// specified culture. Otherwise, it is the invariant url.</para>
/// </remarks>
string GetUrl(string culture = null);
/// <summary>
/// Gets culture infos for a culture.
/// </summary>
PublishedCultureInfo GetCulture(string culture = null);
/// <summary>
/// Gets culture infos.
/// Gets available culture infos.
/// </summary>
/// <remarks>
/// <para>Contains only those culture that are available. For a published content, these are
/// the cultures that are published. For a draft content, those that are 'available' ie
/// have a non-empty content name.</para>
/// <para>Does not contain the invariant culture.</para> // fixme?
/// </remarks>
IReadOnlyDictionary<string, PublishedCultureInfo> Cultures { get; }
@@ -178,11 +154,15 @@ namespace Umbraco.Core.Models.PublishedContent
IPublishedContent Parent { get; }
/// <summary>
/// Gets the children of the content item.
/// Gets the children of the content item that are available for the current culture.
/// </summary>
/// <remarks>Children are sorted by their sortOrder.</remarks>
IEnumerable<IPublishedContent> Children { get; }
/// <summary>
/// Gets all the children of the content item, regardless of whether they are available for the current culture.
/// </summary>
IEnumerable<IPublishedContent> ChildrenForAllCultures { get; }
#endregion
}
}
@@ -0,0 +1,63 @@
using System.Collections.Generic;
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Represents an <see cref="IPublishedElement"/> type.
/// </summary>
/// <remarks>Instances implementing the <see cref="IPublishedContentType"/> interface should be
/// immutable, ie if the content type changes, then a new instance needs to be created.</remarks>
public interface IPublishedContentType
{
/// <summary>
/// Gets the content type identifier.
/// </summary>
int Id { get; }
/// <summary>
/// Gets the content type alias.
/// </summary>
string Alias { get; }
/// <summary>
/// Gets the content item type.
/// </summary>
PublishedItemType ItemType { get; }
/// <summary>
/// Gets the aliases of the content types participating in the composition.
/// </summary>
HashSet<string> CompositionAliases { get; }
/// <summary>
/// Gets the content variations of the content type.
/// </summary>
ContentVariation Variations { get; }
/// <summary>
/// Gets a value indicating whether this content type is for an element.
/// </summary>
bool IsElement { get; }
/// <summary>
/// Gets the content type properties.
/// </summary>
IEnumerable<IPublishedPropertyType> PropertyTypes { get; }
/// <summary>
/// Gets a property type index.
/// </summary>
/// <remarks>The alias is case-insensitive. This is the only place where alias strings are compared.</remarks>
int GetPropertyIndex(string alias);
/// <summary>
/// Gets a property type.
/// </summary>
IPublishedPropertyType GetPropertyType(string alias);
/// <summary>
/// Gets a property type.
/// </summary>
IPublishedPropertyType GetPropertyType(int index);
}
}
@@ -10,7 +10,7 @@
/// </summary>
/// <param name="contentType">An content type.</param>
/// <returns>A published content type corresponding to the item type and content type.</returns>
PublishedContentType CreateContentType(IContentTypeComposition contentType);
IPublishedContentType CreateContentType(IContentTypeComposition contentType);
/// <summary>
/// Creates a published property type.
@@ -18,7 +18,7 @@
/// <param name="contentType">The published content type owning the property.</param>
/// <param name="propertyType">A property type.</param>
/// <remarks>Is used by <see cref="PublishedContentType"/> constructor to create property types.</remarks>
PublishedPropertyType CreatePropertyType(PublishedContentType contentType, PropertyType propertyType);
IPublishedPropertyType CreatePropertyType(IPublishedContentType contentType, PropertyType propertyType);
/// <summary>
/// Creates a published property type.
@@ -28,7 +28,7 @@
/// <param name="dataTypeId">The datatype identifier.</param>
/// <param name="variations">The variations.</param>
/// <remarks>Is used by <see cref="PublishedContentType"/> constructor to create special property types.</remarks>
PublishedPropertyType CreatePropertyType(PublishedContentType contentType, string propertyTypeAlias, int dataTypeId, ContentVariation variations);
IPublishedPropertyType CreatePropertyType(IPublishedContentType contentType, string propertyTypeAlias, int dataTypeId, ContentVariation variations);
/// <summary>
/// Gets a published datatype.
@@ -13,7 +13,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// <summary>
/// Gets the content type.
/// </summary>
PublishedContentType ContentType { get; }
IPublishedContentType ContentType { get; }
#endregion
@@ -5,7 +5,7 @@
/// </summary>
public interface IPublishedProperty
{
PublishedPropertyType PropertyType { get; }
IPublishedPropertyType PropertyType { get; }
/// <summary>
/// Gets the alias of the property.
@@ -0,0 +1,108 @@
using System;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Represents a published property type.
/// </summary>
/// <remarks>Instances implementing the <see cref="PublishedPropertyType"/> interface should be
/// immutable, ie if the property type changes, then a new instance needs to be created.</remarks>
public interface IPublishedPropertyType
{
/// <summary>
/// Gets the published content type containing the property type.
/// </summary>
IPublishedContentType ContentType { get; }
/// <summary>
/// Gets the data type.
/// </summary>
PublishedDataType DataType { get; }
/// <summary>
/// Gets property type alias.
/// </summary>
string Alias { get; }
/// <summary>
/// Gets the property editor alias.
/// </summary>
string EditorAlias { get; }
/// <summary>
/// Gets a value indicating whether the property is a user content property.
/// </summary>
/// <remarks>A non-user content property is a property that has been added to a
/// published content type by Umbraco but does not corresponds to a user-defined
/// published property.</remarks>
bool IsUserProperty { get; }
/// <summary>
/// Gets the content variations of the property type.
/// </summary>
ContentVariation Variations { get; }
/// <summary>
/// Determines whether a value is an actual value, or not a value.
/// </summary>
/// <remarks>Used by property.HasValue and, for instance, in fallback scenarios.</remarks>
bool? IsValue(object value, PropertyValueLevel level);
/// <summary>
/// Gets the property cache level.
/// </summary>
PropertyCacheLevel CacheLevel { get; }
/// <summary>
/// Converts the source value into the intermediate value.
/// </summary>
/// <param name="owner">The published element owning the property.</param>
/// <param name="source">The source value.</param>
/// <param name="preview">A value indicating whether content should be considered draft.</param>
/// <returns>The intermediate value.</returns>
object ConvertSourceToInter(IPublishedElement owner, object source, bool preview);
/// <summary>
/// Converts the intermediate value into the object value.
/// </summary>
/// <param name="owner">The published element owning the property.</param>
/// <param name="referenceCacheLevel">The reference cache level.</param>
/// <param name="inter">The intermediate value.</param>
/// <param name="preview">A value indicating whether content should be considered draft.</param>
/// <returns>The object value.</returns>
object ConvertInterToObject(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview);
/// <summary>
/// Converts the intermediate value into the XPath value.
/// </summary>
/// <param name="owner">The published element owning the property.</param>
/// <param name="referenceCacheLevel">The reference cache level.</param>
/// <param name="inter">The intermediate value.</param>
/// <param name="preview">A value indicating whether content should be considered draft.</param>
/// <returns>The XPath value.</returns>
/// <remarks>
/// <para>The XPath value can be either a string or an XPathNavigator.</para>
/// </remarks>
object ConvertInterToXPath(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview);
/// <summary>
/// Gets the property model CLR type.
/// </summary>
/// <remarks>
/// <para>The model CLR type may be a <see cref="ModelType"/> type, or may contain <see cref="ModelType"/> types.</para>
/// <para>For the actual CLR type, see <see cref="ClrType"/>.</para>
/// </remarks>
Type ModelClrType { get; }
/// <summary>
/// Gets the property CLR type.
/// </summary>
/// <remarks>
/// <para>Returns the actual CLR type which does not contain <see cref="ModelType"/> types.</para>
/// <para>Mapping from <see cref="ModelClrType"/> may throw if some <see cref="ModelType"/> instances
/// could not be mapped to actual CLR types.</para>
/// </remarks>
Type ClrType { get; }
}
}
@@ -75,7 +75,7 @@ namespace Umbraco.Core.Models.PublishedContent
return type;
var def = type.GetGenericTypeDefinition();
if (def == null)
throw new InvalidOperationException("panic");
throw new PanicException($"The type {type} has not generic type definition");
var args = type.GetGenericArguments().Select(x => Map(x, modelTypes, true)).ToArray();
return def.MakeGenericType(args);
@@ -114,7 +114,7 @@ namespace Umbraco.Core.Models.PublishedContent
return type.FullName;
var def = type.GetGenericTypeDefinition();
if (def == null)
throw new InvalidOperationException("panic");
throw new PanicException($"The type {type} has not generic type definition");
var args = type.GetGenericArguments().Select(x => MapToName(x, map, true)).ToArray();
var defFullName = def.FullName.Substring(0, def.FullName.IndexOf('`'));
@@ -5,13 +5,13 @@ using System.Linq;
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Represents an <see cref="IPublishedContent"/> type.
/// Represents an <see cref="IPublishedElement"/> type.
/// </summary>
/// <remarks>Instances of the <see cref="PublishedContentType"/> class are immutable, ie
/// if the content type changes, then a new class needs to be created.</remarks>
public class PublishedContentType
public class PublishedContentType : IPublishedContentType
{
private readonly PublishedPropertyType[] _propertyTypes;
private readonly IPublishedPropertyType[] _propertyTypes;
// fast alias-to-index xref containing both the raw alias and its lowercase version
private readonly Dictionary<string, int> _indexes = new Dictionary<string, int>();
@@ -35,11 +35,10 @@ namespace Umbraco.Core.Models.PublishedContent
}
/// <summary>
/// Initializes a new instance of the <see cref="PublishedContentType"/> with specific values.
/// This constructor is for tests and is not intended to be used directly from application code.
/// </summary>
/// <remarks>
/// <para>This constructor is for tests and is not intended to be used directly from application code.</para>
/// <para>Values are assumed to be consisted and are not checked.</para>
/// <para>Values are assumed to be consistent and are not checked.</para>
/// </remarks>
public PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes, ContentVariation variations, bool isElement = false)
: this (id, alias, itemType, compositionAliases, variations, isElement)
@@ -52,6 +51,20 @@ namespace Umbraco.Core.Models.PublishedContent
InitializeIndexes();
}
/// <summary>
/// This constructor is for tests and is not intended to be used directly from application code.
/// </summary>
/// <remarks>
/// <para>Values are assumed to be consistent and are not checked.</para>
/// </remarks>
public PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable<string> compositionAliases, Func<IPublishedContentType, IEnumerable<IPublishedPropertyType>> propertyTypes, ContentVariation variations, bool isElement = false)
: this(id, alias, itemType, compositionAliases, variations, isElement)
{
_propertyTypes = propertyTypes(this).ToArray();
InitializeIndexes();
}
private PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable<string> compositionAliases, ContentVariation variations, bool isElement)
{
Id = id;
@@ -75,7 +88,7 @@ namespace Umbraco.Core.Models.PublishedContent
// Members have properties such as IMember LastLoginDate which are plain C# properties and not content
// properties; they are exposed as pseudo content properties, as long as a content property with the
// same alias does not exist already.
private void EnsureMemberProperties(List<PublishedPropertyType> propertyTypes, IPublishedContentTypeFactory factory)
private void EnsureMemberProperties(List<IPublishedPropertyType> propertyTypes, IPublishedContentTypeFactory factory)
{
var aliases = new HashSet<string>(propertyTypes.Select(x => x.Alias), StringComparer.OrdinalIgnoreCase);
@@ -103,44 +116,29 @@ namespace Umbraco.Core.Models.PublishedContent
#region Content type
/// <summary>
/// Gets the content type identifier.
/// </summary>
/// <inheritdoc />
public int Id { get; }
/// <summary>
/// Gets the content type alias.
/// </summary>
/// <inheritdoc />
public string Alias { get; }
/// <summary>
/// Gets the content item type.
/// </summary>
/// <inheritdoc />
public PublishedItemType ItemType { get; }
/// <summary>
/// Gets the aliases of the content types participating in the composition.
/// </summary>
/// <inheritdoc />
public HashSet<string> CompositionAliases { get; }
/// <summary>
/// Gets the content variations of the content type.
/// </summary>
/// <inheritdoc />
public ContentVariation Variations { get; }
#endregion
#region Properties
/// <summary>
/// Gets the content type properties.
/// </summary>
public IEnumerable<PublishedPropertyType> PropertyTypes => _propertyTypes;
/// <inheritdoc />
public IEnumerable<IPublishedPropertyType> PropertyTypes => _propertyTypes;
/// <summary>
/// Gets a property type index.
/// </summary>
/// <remarks>The alias is case-insensitive. This is the only place where alias strings are compared.</remarks>
/// <inheritdoc />
public int GetPropertyIndex(string alias)
{
if (_indexes.TryGetValue(alias, out var index)) return index; // fastest
@@ -150,10 +148,8 @@ namespace Umbraco.Core.Models.PublishedContent
// virtual for unit tests
// TODO: explain why
/// <summary>
/// Gets a property type.
/// </summary>
public virtual PublishedPropertyType GetPropertyType(string alias)
/// <inheritdoc />
public virtual IPublishedPropertyType GetPropertyType(string alias)
{
var index = GetPropertyIndex(alias);
return GetPropertyType(index);
@@ -161,17 +157,13 @@ namespace Umbraco.Core.Models.PublishedContent
// virtual for unit tests
// TODO: explain why
/// <summary>
/// Gets a property type.
/// </summary>
public virtual PublishedPropertyType GetPropertyType(int index)
/// <inheritdoc />
public virtual IPublishedPropertyType GetPropertyType(int index)
{
return index >= 0 && index < _propertyTypes.Length ? _propertyTypes[index] : null;
}
/// <summary>
/// Gets a value indicating whether this content type is for an element.
/// </summary>
/// <inheritdoc />
public bool IsElement { get; }
#endregion
@@ -26,37 +26,46 @@ namespace Umbraco.Core.Models.PublishedContent
}
/// <inheritdoc />
public PublishedContentType CreateContentType(IContentTypeComposition contentType)
public IPublishedContentType CreateContentType(IContentTypeComposition contentType)
{
return new PublishedContentType(contentType, this);
}
// for tests
internal PublishedContentType CreateContentType(int id, string alias, IEnumerable<PublishedPropertyType> propertyTypes, ContentVariation variations = ContentVariation.Nothing, bool isElement = false)
/// <summary>
/// This method is for tests and is not intended to be used directly from application code.
/// </summary>
/// <remarks>Values are assumed to be consisted and are not checked.</remarks>
internal IPublishedContentType CreateContentType(int id, string alias, Func<IPublishedContentType, IEnumerable<IPublishedPropertyType>> propertyTypes, ContentVariation variations = ContentVariation.Nothing, bool isElement = false)
{
return new PublishedContentType(id, alias, PublishedItemType.Content, Enumerable.Empty<string>(), propertyTypes, variations, isElement);
}
// for tests
internal PublishedContentType CreateContentType(int id, string alias, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes, ContentVariation variations = ContentVariation.Nothing, bool isElement = false)
/// <summary>
/// This method is for tests and is not intended to be used directly from application code.
/// </summary>
/// <remarks>Values are assumed to be consisted and are not checked.</remarks>
internal IPublishedContentType CreateContentType(int id, string alias, IEnumerable<string> compositionAliases, Func<IPublishedContentType, IEnumerable<IPublishedPropertyType>> propertyTypes, ContentVariation variations = ContentVariation.Nothing, bool isElement = false)
{
return new PublishedContentType(id, alias, PublishedItemType.Content, compositionAliases, propertyTypes, variations, isElement);
}
/// <inheritdoc />
public PublishedPropertyType CreatePropertyType(PublishedContentType contentType, PropertyType propertyType)
public IPublishedPropertyType CreatePropertyType(IPublishedContentType contentType, PropertyType propertyType)
{
return new PublishedPropertyType(contentType, propertyType, _propertyValueConverters, _publishedModelFactory, this);
}
/// <inheritdoc />
public PublishedPropertyType CreatePropertyType(PublishedContentType contentType, string propertyTypeAlias, int dataTypeId, ContentVariation variations = ContentVariation.Nothing)
public IPublishedPropertyType CreatePropertyType(IPublishedContentType contentType, string propertyTypeAlias, int dataTypeId, ContentVariation variations = ContentVariation.Nothing)
{
return new PublishedPropertyType(contentType, propertyTypeAlias, dataTypeId, true, variations, _propertyValueConverters, _publishedModelFactory, this);
}
// for tests
internal PublishedPropertyType CreatePropertyType(string propertyTypeAlias, int dataTypeId, bool umbraco = false, ContentVariation variations = ContentVariation.Nothing)
/// <summary>
/// This method is for tests and is not intended to be used directly from application code.
/// </summary>
/// <remarks>Values are assumed to be consisted and are not checked.</remarks>
internal IPublishedPropertyType CreatePropertyType(string propertyTypeAlias, int dataTypeId, bool umbraco = false, ContentVariation variations = ContentVariation.Nothing)
{
return new PublishedPropertyType(propertyTypeAlias, dataTypeId, umbraco, variations, _propertyValueConverters, _publishedModelFactory, this);
}
@@ -41,7 +41,7 @@ namespace Umbraco.Core.Models.PublishedContent
#region ContentType
/// <inheritdoc />
public virtual PublishedContentType ContentType => _content.ContentType;
public virtual IPublishedContentType ContentType => _content.ContentType;
#endregion
@@ -96,12 +96,6 @@ namespace Umbraco.Core.Models.PublishedContent
/// <inheritdoc />
public virtual string Url => _content.Url;
/// <inheritdoc />
public virtual string GetUrl(string culture = null) => _content.GetUrl(culture);
/// <inheritdoc />
public PublishedCultureInfo GetCulture(string culture = null) => _content.GetCulture(culture);
/// <inheritdoc />
public IReadOnlyDictionary<string, PublishedCultureInfo> Cultures => _content.Cultures;
@@ -124,6 +118,9 @@ namespace Umbraco.Core.Models.PublishedContent
/// <inheritdoc />
public virtual IEnumerable<IPublishedContent> Children => _content.Children;
/// <inheritdoc />
public virtual IEnumerable<IPublishedContent> ChildrenForAllCultures => _content.ChildrenForAllCultures;
#endregion
#region Properties
@@ -13,10 +13,9 @@ namespace Umbraco.Core.Models.PublishedContent
/// </summary>
public PublishedCultureInfo(string culture, string name, string urlSegment, DateTime date)
{
if (string.IsNullOrWhiteSpace(culture)) throw new ArgumentNullOrEmptyException(nameof(culture));
if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullOrEmptyException(nameof(name));
Culture = culture;
Culture = culture ?? throw new ArgumentNullException(nameof(culture));
Name = name;
UrlSegment = urlSegment;
Date = date;
@@ -30,12 +29,12 @@ namespace Umbraco.Core.Models.PublishedContent
/// <summary>
/// Gets the name of the item.
/// </summary>
public string Name { get; }
internal string Name { get; }
/// <summary>
/// Gets the url segment of the item.
/// </summary>
public string UrlSegment { get; }
internal string UrlSegment { get; }
/// <summary>
/// Gets the date associated with the culture.
@@ -28,7 +28,7 @@ namespace Umbraco.Core.Models.PublishedContent
public IPublishedElement Unwrap() => _content;
/// <inheritdoc />
public PublishedContentType ContentType => _content.ContentType;
public IPublishedContentType ContentType => _content.ContentType;
/// <inheritdoc />
public Guid Key => _content.Key;
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// <summary>
/// Initializes a new instance of the <see cref="PublishedPropertyBase"/> class.
/// </summary>
protected PublishedPropertyBase(PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel)
protected PublishedPropertyBase(IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel)
{
PropertyType = propertyType ?? throw new ArgumentNullException(nameof(propertyType));
ReferenceCacheLevel = referenceCacheLevel;
@@ -42,7 +42,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// <summary>
/// Gets the property type.
/// </summary>
public PublishedPropertyType PropertyType { get; }
public IPublishedPropertyType PropertyType { get; }
/// <summary>
/// Gets the property reference cache level.
@@ -10,10 +10,8 @@ namespace Umbraco.Core.Models.PublishedContent
/// </summary>
/// <remarks>Instances of the <see cref="PublishedPropertyType"/> class are immutable, ie
/// if the property type changes, then a new class needs to be created.</remarks>
public class PublishedPropertyType
public class PublishedPropertyType : IPublishedPropertyType
{
// TODO: API design review, should this be an interface?
private readonly IPublishedModelFactory _publishedModelFactory;
private readonly PropertyValueConverterCollection _propertyValueConverters;
private readonly object _locker = new object();
@@ -32,7 +30,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// <remarks>
/// <para>The new published property type belongs to the published content type.</para>
/// </remarks>
public PublishedPropertyType(PublishedContentType contentType, PropertyType propertyType, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)
public PublishedPropertyType(IPublishedContentType contentType, PropertyType propertyType, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)
: this(propertyType.Alias, propertyType.DataTypeId, true, propertyType.Variations, propertyValueConverters, publishedModelFactory, factory)
{
ContentType = contentType ?? throw new ArgumentNullException(nameof(contentType));
@@ -45,7 +43,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// <para>Values are assumed to be consisted and are not checked.</para>
/// <para>The new published property type belongs to the published content type.</para>
/// </remarks>
public PublishedPropertyType(PublishedContentType contentType, string propertyTypeAlias, int dataTypeId, bool isUserProperty, ContentVariation variations, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)
public PublishedPropertyType(IPublishedContentType contentType, string propertyTypeAlias, int dataTypeId, bool isUserProperty, ContentVariation variations, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)
: this(propertyTypeAlias, dataTypeId, isUserProperty, variations, propertyValueConverters, publishedModelFactory, factory)
{
ContentType = contentType ?? throw new ArgumentNullException(nameof(contentType));
@@ -75,37 +73,22 @@ namespace Umbraco.Core.Models.PublishedContent
#region Property type
/// <summary>
/// Gets the published content type containing the property type.
/// </summary>
public PublishedContentType ContentType { get; internal set; } // internally set by PublishedContentType constructor
/// <inheritdoc />
public IPublishedContentType ContentType { get; internal set; } // internally set by PublishedContentType constructor
/// <summary>
/// Gets the data type.
/// </summary>
/// <inheritdoc />
public PublishedDataType DataType { get; }
/// <summary>
/// Gets property type alias.
/// </summary>
/// <inheritdoc />
public string Alias { get; }
/// <summary>
/// Gets the property editor alias.
/// </summary>
/// <inheritdoc />
public string EditorAlias => DataType.EditorAlias;
/// <summary>
/// Gets a value indicating whether the property is a user content property.
/// </summary>
/// <remarks>A non-user content property is a property that has been added to a
/// published content type by Umbraco but does not corresponds to a user-defined
/// published property.</remarks>
/// <inheritdoc />
public bool IsUserProperty { get; }
/// <summary>
/// Gets the content variations of the property type.
/// </summary>
/// <inheritdoc />
public ContentVariation Variations { get; }
#endregion
@@ -193,10 +176,7 @@ namespace Umbraco.Core.Models.PublishedContent
_modelClrType = _converter == null ? typeof (object) : _converter.GetPropertyValueType(this);
}
/// <summary>
/// Determines whether a value is an actual value, or not a value.
/// </summary>
/// <remarks>Used by property.HasValue and, for instance, in fallback scenarios.</remarks>
/// <inheritdoc />
public bool? IsValue(object value, PropertyValueLevel level)
{
if (!_initialized) Initialize();
@@ -209,9 +189,7 @@ namespace Umbraco.Core.Models.PublishedContent
return value != null && (!(value is string) || string.IsNullOrWhiteSpace((string) value) == false);
}
/// <summary>
/// Gets the property cache level.
/// </summary>
/// <inheritdoc />
public PropertyCacheLevel CacheLevel
{
get
@@ -221,13 +199,7 @@ namespace Umbraco.Core.Models.PublishedContent
}
}
/// <summary>
/// Converts the source value into the intermediate value.
/// </summary>
/// <param name="owner">The published element owning the property.</param>
/// <param name="source">The source value.</param>
/// <param name="preview">A value indicating whether content should be considered draft.</param>
/// <returns>The intermediate value.</returns>
/// <inheritdoc />
public object ConvertSourceToInter(IPublishedElement owner, object source, bool preview)
{
if (!_initialized) Initialize();
@@ -238,14 +210,7 @@ namespace Umbraco.Core.Models.PublishedContent
: source;
}
/// <summary>
/// Converts the intermediate value into the object value.
/// </summary>
/// <param name="owner">The published element owning the property.</param>
/// <param name="referenceCacheLevel">The reference cache level.</param>
/// <param name="inter">The intermediate value.</param>
/// <param name="preview">A value indicating whether content should be considered draft.</param>
/// <returns>The object value.</returns>
/// <inheritdoc />
public object ConvertInterToObject(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
if (!_initialized) Initialize();
@@ -256,17 +221,7 @@ namespace Umbraco.Core.Models.PublishedContent
: inter;
}
/// <summary>
/// Converts the intermediate value into the XPath value.
/// </summary>
/// <param name="owner">The published element owning the property.</param>
/// <param name="referenceCacheLevel">The reference cache level.</param>
/// <param name="inter">The intermediate value.</param>
/// <param name="preview">A value indicating whether content should be considered draft.</param>
/// <returns>The XPath value.</returns>
/// <remarks>
/// <para>The XPath value can be either a string or an XPathNavigator.</para>
/// </remarks>
/// <inheritdoc />
public object ConvertInterToXPath(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
if (!_initialized) Initialize();
@@ -282,13 +237,7 @@ namespace Umbraco.Core.Models.PublishedContent
return inter.ToString().Trim();
}
/// <summary>
/// Gets the property model CLR type.
/// </summary>
/// <remarks>
/// <para>The model CLR type may be a <see cref="ModelType"/> type, or may contain <see cref="ModelType"/> types.</para>
/// <para>For the actual CLR type, see <see cref="ClrType"/>.</para>
/// </remarks>
/// <inheritdoc />
public Type ModelClrType
{
get
@@ -298,14 +247,7 @@ namespace Umbraco.Core.Models.PublishedContent
}
}
/// <summary>
/// Gets the property CLR type.
/// </summary>
/// <remarks>
/// <para>Returns the actual CLR type which does not contain <see cref="ModelType"/> types.</para>
/// <para>Mapping from <see cref="ModelClrType"/> may throw if some <see cref="ModelType"/> instances
/// could not be mapped to actual CLR types.</para>
/// </remarks>
/// <inheritdoc />
public Type ClrType
{
get
@@ -38,7 +38,7 @@ namespace Umbraco.Core.Models.PublishedContent
public override object GetXPathValue(string culture = null, string segment = null)
=> string.IsNullOrEmpty(culture) & string.IsNullOrEmpty(segment) ? _xpathValue.Value : null;
public RawValueProperty(PublishedPropertyType propertyType, IPublishedElement content, object sourceValue, bool isPreviewing = false)
public RawValueProperty(IPublishedPropertyType propertyType, IPublishedElement content, object sourceValue, bool isPreviewing = false)
: base(propertyType, PropertyCacheLevel.Unknown) // cache level is ignored
{
if (propertyType.Variations != ContentVariation.Nothing)
@@ -1,14 +1,14 @@
namespace Umbraco.Web.Routing
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Specifies the type of urls that the url provider should produce, Auto is the default
/// Specifies the type of urls that the url provider should produce, Auto is the default.
/// </summary>
/// <remarks>
/// <para>The <c>Relative</c> option can lead to invalid results when combined with hostnames, but it is the only way to reproduce
/// the true, pre-4.10, always-relative behavior of Umbraco.</para>
/// </remarks>
public enum UrlProviderMode
public enum UrlMode
{
/// <summary>
/// Indicates that the url provider should do what it has been configured to do.
/// </summary>
Default = 0,
/// <summary>
/// Indicates that the url provider should produce relative urls exclusively.
-13
View File
@@ -193,19 +193,6 @@ namespace Umbraco.Core.Models
return ContentPermissionsHelper.HasPathAccess(entity.Path, user.CalculateMediaStartNodeIds(entityService), Constants.System.RecycleBinMedia);
}
internal static bool IsInBranchOfStartNode(this IUser user, IUmbracoEntity entity, IEntityService entityService, int recycleBinId, out bool hasPathAccess)
{
switch (recycleBinId)
{
case Constants.System.RecycleBinMedia:
return ContentPermissionsHelper.IsInBranchOfStartNode(entity.Path, user.CalculateMediaStartNodeIds(entityService), user.GetMediaStartNodePaths(entityService), out hasPathAccess);
case Constants.System.RecycleBinContent:
return ContentPermissionsHelper.IsInBranchOfStartNode(entity.Path, user.CalculateContentStartNodeIds(entityService), user.GetContentStartNodePaths(entityService), out hasPathAccess);
default:
throw new NotSupportedException("Path access is only determined on content or media");
}
}
/// <summary>
/// Determines whether this user has access to view sensitive data
/// </summary>
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Xml.Linq;
using System.Xml.XPath;
@@ -575,12 +574,11 @@ namespace Umbraco.Core.Packaging
contentType.Thumbnail = infoElement.Element("Thumbnail").Value;
contentType.Description = infoElement.Element("Description").Value;
//NOTE AllowAtRoot is a new property in the package xml so we need to verify it exists before using it.
//NOTE AllowAtRoot, IsListView, IsElement and Variations are new properties in the package xml so we need to verify it exists before using it.
var allowAtRoot = infoElement.Element("AllowAtRoot");
if (allowAtRoot != null)
contentType.AllowedAsRoot = allowAtRoot.Value.InvariantEquals("true");
//NOTE IsListView is a new property in the package xml so we need to verify it exists before using it.
var isListView = infoElement.Element("IsListView");
if (isListView != null)
contentType.IsContainer = isListView.Value.InvariantEquals("true");
@@ -589,6 +587,10 @@ namespace Umbraco.Core.Packaging
if (isElement != null)
contentType.IsElement = isElement.Value.InvariantEquals("true");
var variationsElement = infoElement.Element("Variations");
if (variationsElement != null)
contentType.Variations = (ContentVariation)Enum.Parse(typeof(ContentVariation), variationsElement.Value);
//Name of the master corresponds to the parent and we need to ensure that the Parent Id is set
var masterElement = infoElement.Element("Master");
if (masterElement != null)
@@ -614,7 +616,7 @@ namespace Umbraco.Core.Packaging
var compositionContentType = importedContentTypes.ContainsKey(compositionAlias)
? importedContentTypes[compositionAlias]
: _contentTypeService.Get(compositionAlias);
var added = contentType.AddContentType(compositionContentType);
contentType.AddContentType(compositionContentType);
}
}
}
@@ -748,9 +750,14 @@ namespace Umbraco.Core.Packaging
{
Name = property.Element("Name").Value,
Description = (string)property.Element("Description"),
Mandatory = property.Element("Mandatory") != null ? property.Element("Mandatory").Value.ToLowerInvariant().Equals("true") : false,
Mandatory = property.Element("Mandatory") != null
? property.Element("Mandatory").Value.ToLowerInvariant().Equals("true")
: false,
ValidationRegExp = (string)property.Element("Validation"),
SortOrder = sortOrder
SortOrder = sortOrder,
Variations = property.Element("Variations") != null
? (ContentVariation)Enum.Parse(typeof(ContentVariation), property.Element("Variations").Value)
: ContentVariation.Nothing
};
var tab = (string)property.Element("Tab");
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Factories
public static IEnumerable<Property> BuildEntities(PropertyType[] propertyTypes, IReadOnlyCollection<PropertyDataDto> dtos, int publishedVersionId, ILanguageRepository languageRepository)
{
var properties = new List<Property>();
var xdtos = dtos.GroupBy(x => x.PropertyTypeId).ToDictionary(x => x.Key, x => (IEnumerable<PropertyDataDto>) x);
var xdtos = dtos.GroupBy(x => x.PropertyTypeId).ToDictionary(x => x.Key, x => (IEnumerable<PropertyDataDto>)x);
foreach (var propertyType in propertyTypes)
{
@@ -104,10 +104,14 @@ namespace Umbraco.Core.Persistence.Factories
/// <param name="properties">The properties to map</param>
/// <param name="languageRepository"></param>
/// <param name="edited">out parameter indicating that one or more properties have been edited</param>
/// <param name="editedCultures">out parameter containing a collection of edited cultures when the contentVariation varies by culture</param>
/// <param name="editedCultures">
/// Out parameter containing a collection of edited cultures when the contentVariation varies by culture.
/// The value of this will be used to populate the edited cultures in the umbracoDocumentCultureVariation table.
/// </param>
/// <returns></returns>
public static IEnumerable<PropertyDataDto> BuildDtos(ContentVariation contentVariation, int currentVersionId, int publishedVersionId, IEnumerable<Property> properties,
ILanguageRepository languageRepository, out bool edited, out HashSet<string> editedCultures)
ILanguageRepository languageRepository, out bool edited,
out HashSet<string> editedCultures)
{
var propertyDataDtos = new List<PropertyDataDto>();
edited = false;
@@ -130,6 +134,9 @@ namespace Umbraco.Core.Persistence.Factories
// publishing = deal with edit and published values
foreach (var propertyValue in property.Values)
{
var isInvariantValue = propertyValue.Culture == null;
var isCultureValue = propertyValue.Culture != null && propertyValue.Segment == null;
// deal with published value
if (propertyValue.PublishedValue != null && publishedVersionId > 0)
propertyDataDtos.Add(BuildDto(publishedVersionId, property, languageRepository.GetIdByIsoCode(propertyValue.Culture), propertyValue.Segment, propertyValue.PublishedValue));
@@ -138,26 +145,36 @@ namespace Umbraco.Core.Persistence.Factories
if (propertyValue.EditedValue != null)
propertyDataDtos.Add(BuildDto(currentVersionId, property, languageRepository.GetIdByIsoCode(propertyValue.Culture), propertyValue.Segment, propertyValue.EditedValue));
// property.Values will contain ALL of it's values, both variant and invariant which will be populated if the
// administrator has previously changed the property type to be variant vs invariant.
// We need to check for this scenario here because otherwise the editedCultures and edited flags
// will end up incorrectly set in the umbracoDocumentCultureVariation table so here we need to
// only process edited cultures based on the current value type and how the property varies.
// The above logic will still persist the currently saved property value for each culture in case the admin
// decides to swap the property's variance again, in which case the edited flag will be recalculated.
if (property.PropertyType.VariesByCulture() && isInvariantValue || !property.PropertyType.VariesByCulture() && isCultureValue)
continue;
// use explicit equals here, else object comparison fails at comparing eg strings
var sameValues = propertyValue.PublishedValue == null ? propertyValue.EditedValue == null : propertyValue.PublishedValue.Equals(propertyValue.EditedValue);
edited |= !sameValues;
if (entityVariesByCulture // cultures can be edited, ie CultureNeutral is supported
&& propertyValue.Culture != null && propertyValue.Segment == null // and value is CultureNeutral
&& !sameValues) // and edited and published are different
if (entityVariesByCulture && !sameValues)
{
editedCultures.Add(propertyValue.Culture); // report culture as edited
}
if (isCultureValue)
{
editedCultures.Add(propertyValue.Culture); // report culture as edited
}
else if (isInvariantValue)
{
// flag culture as edited if it contains an edited invariant property
if (defaultCulture == null)
defaultCulture = languageRepository.GetDefaultIsoCode();
// flag culture as edited if it contains an edited invariant property
if (propertyValue.Culture == null //invariant property
&& !sameValues // and edited and published are different
&& entityVariesByCulture) //only when the entity is variant
{
if (defaultCulture == null)
defaultCulture = languageRepository.GetDefaultIsoCode();
editedCultures.Add(defaultCulture);
editedCultures.Add(defaultCulture);
}
}
}
}
@@ -167,7 +184,7 @@ namespace Umbraco.Core.Persistence.Factories
{
// not publishing = only deal with edit values
if (propertyValue.EditedValue != null)
propertyDataDtos.Add(BuildDto(currentVersionId, property, languageRepository.GetIdByIsoCode(propertyValue.Culture), propertyValue.Segment, propertyValue.EditedValue));
propertyDataDtos.Add(BuildDto(currentVersionId, property, languageRepository.GetIdByIsoCode(propertyValue.Culture), propertyValue.Segment, propertyValue.EditedValue));
}
edited = true;
}
@@ -54,6 +54,7 @@ namespace Umbraco.Core.Persistence.Factories
propertyType.Alias = typeDto.Alias;
propertyType.DataTypeId = typeDto.DataTypeId;
propertyType.DataTypeKey = typeDto.DataTypeDto.NodeDto.UniqueId;
propertyType.Description = typeDto.Description;
propertyType.Id = typeDto.Id;
propertyType.Key = typeDto.UniqueId;
@@ -18,7 +18,8 @@ namespace Umbraco.Core.Persistence.Mappers
DefineMap<AuditItem, LogDto>(nameof(AuditItem.Id), nameof(LogDto.NodeId));
DefineMap<AuditItem, LogDto>(nameof(AuditItem.CreateDate), nameof(LogDto.Datestamp));
DefineMap<AuditItem, LogDto>(nameof(AuditItem.UserId), nameof(LogDto.UserId));
DefineMap<AuditItem, LogDto>(nameof(AuditItem.AuditType), nameof(LogDto.Header));
// we cannot map that one - because AuditType is an enum but Header is a string
//DefineMap<AuditItem, LogDto>(nameof(AuditItem.AuditType), nameof(LogDto.Header));
DefineMap<AuditItem, LogDto>(nameof(AuditItem.Comment), nameof(LogDto.Comment));
}
}
@@ -85,6 +85,17 @@ namespace Umbraco.Core.Persistence.Querying
// I'm just unsure right now due to time constraints how to make it correct. It won't matter right now and has been working already with this bug but I've
// only just discovered what it is actually doing.
// TODO
// in most cases we want to convert the value to a plain object,
// but for in some rare cases, we may want to do it differently,
// for instance a Models.AuditType (an enum) may in some cases
// need to be converted to its string value.
// but - we cannot have specific code here, really - and how would
// we configure this? is it even possible?
/*
var toString = typeof(object).GetMethod("ToString");
var member = Expression.Call(m, toString);
*/
var member = Expression.Convert(m, typeof(object));
var lambda = Expression.Lambda<Func<object>>(member);
var getter = lambda.Compile();
@@ -33,5 +33,7 @@ namespace Umbraco.Core.Persistence.Repositories
Direction orderDirection,
AuditType[] auditTypeFilter,
IQuery<IAuditItem> customFilter);
IEnumerable<IAuditItem> Get(AuditType type, IQuery<IAuditItem> query);
}
}
@@ -100,7 +100,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
/// <inheritdoc />
protected override void PersistNewItem(IAuditEntry entity)
{
((EntityBase) entity).AddingEntity();
entity.AddingEntity();
var dto = AuditEntryFactory.BuildDto(entity);
Database.Insert(dto);
@@ -74,6 +74,18 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
return dtos.Select(x => new AuditItem(x.NodeId, Enum<AuditType>.Parse(x.Header), x.UserId ?? Constants.Security.UnknownUserId, x.EntityType, x.Comment, x.Parameters)).ToList();
}
public IEnumerable<IAuditItem> Get(AuditType type, IQuery<IAuditItem> query)
{
var sqlClause = GetBaseQuery(false)
.Where<LogDto>(x => x.Header == type.ToString());
var translator = new SqlTranslator<IAuditItem>(sqlClause, query);
var sql = translator.Translate();
var dtos = Database.Fetch<LogDto>(sql);
return dtos.Select(x => new AuditItem(x.NodeId, Enum<AuditType>.Parse(x.Header), x.UserId ?? Constants.Security.UnknownUserId, x.EntityType, x.Comment, x.Parameters)).ToList();
}
protected override Sql<ISqlContext> GetBaseQuery(bool isCount)
{
var sql = SqlContext.Sql();
@@ -162,7 +174,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
totalRecords = page.TotalItems;
var items = page.Items.Select(
dto => new AuditItem(dto.Id, Enum<AuditType>.ParseOrNull(dto.Header) ?? AuditType.Custom, dto.UserId ?? Constants.Security.UnknownUserId, dto.EntityType, dto.Comment, dto.Parameters)).ToList();
dto => new AuditItem(dto.NodeId, Enum<AuditType>.ParseOrNull(dto.Header) ?? AuditType.Custom, dto.UserId ?? Constants.Security.UnknownUserId, dto.EntityType, dto.Comment, dto.Parameters)).ToList();
// map the DateStamp
for (var i = 0; i < items.Count; i++)
@@ -69,7 +69,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
/// <inheritdoc />
protected override void PersistNewItem(IConsent entity)
{
((EntityBase) entity).AddingEntity();
entity.AddingEntity();
var dto = ConsentFactory.BuildDto(entity);
Database.Insert(dto);
@@ -80,7 +80,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
/// <inheritdoc />
protected override void PersistUpdatedItem(IConsent entity)
{
((EntityBase) entity).UpdatingEntity();
entity.UpdatingEntity();
var dto = ConsentFactory.BuildDto(entity);
Database.Update(dto);
@@ -512,31 +512,16 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
foreach (var a in allPropertyDataDtos)
a.PropertyTypeDto = indexedPropertyTypeDtos[a.PropertyTypeId];
// prefetch configuration for tag properties
var tagEditors = new Dictionary<string, TagConfiguration>();
foreach (var propertyTypeDto in indexedPropertyTypeDtos.Values)
{
var editorAlias = propertyTypeDto.DataTypeDto.EditorAlias;
var editorAttribute = PropertyEditors[editorAlias].GetTagAttribute();
if (editorAttribute == null) continue;
var tagConfigurationSource = propertyTypeDto.DataTypeDto.Configuration;
var tagConfiguration = string.IsNullOrWhiteSpace(tagConfigurationSource)
? new TagConfiguration()
: JsonConvert.DeserializeObject<TagConfiguration>(tagConfigurationSource);
if (tagConfiguration.Delimiter == default) tagConfiguration.Delimiter = editorAttribute.Delimiter;
tagEditors[editorAlias] = tagConfiguration;
}
// now we have
// - the definitions
// - all property data dtos
// - tag editors
// - tag editors (Actually ... no we don't since i removed that code, but we don't need them anyways it seems)
// and we need to build the proper property collections
return GetPropertyCollections(temps, allPropertyDataDtos, tagEditors);
return GetPropertyCollections(temps, allPropertyDataDtos);
}
private IDictionary<int, PropertyCollection> GetPropertyCollections<T>(List<TempContent<T>> temps, IEnumerable<PropertyDataDto> allPropertyDataDtos, Dictionary<string, TagConfiguration> tagConfigurations)
private IDictionary<int, PropertyCollection> GetPropertyCollections<T>(List<TempContent<T>> temps, IEnumerable<PropertyDataDto> allPropertyDataDtos)
where T : class, IContentBase
{
var result = new Dictionary<int, PropertyCollection>();
@@ -3,10 +3,12 @@ using System.Collections.Generic;
using System.Linq;
using NPoco;
using Umbraco.Core.Cache;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence.Dtos;
using Umbraco.Core.Persistence.Factories;
using Umbraco.Core.Scoping;
using static Umbraco.Core.Persistence.NPocoSqlExtensions.Statics;
namespace Umbraco.Core.Persistence.Repositories.Implement
{
@@ -89,7 +91,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
contentType = ContentTypeFactory.BuildContentTypeEntity(contentTypeDto);
else if (contentTypeDto.NodeDto.NodeObjectType == Constants.ObjectTypes.MemberType)
contentType = ContentTypeFactory.BuildMemberTypeEntity(contentTypeDto);
else throw new Exception("panic");
else throw new PanicException($"The node object type {contentTypeDto.NodeDto.NodeObjectType} is not supported");
contentTypes.Add(contentType.Id, contentType);
// map allowed content types
@@ -188,10 +190,11 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
var groupDtos = Database.Fetch<PropertyTypeGroupDto>(sql1);
var sql2 = Sql()
.Select<PropertyTypeDto>(r => r.Select(x => x.DataTypeDto))
.Select<PropertyTypeDto>(r => r.Select(x => x.DataTypeDto, r1 => r1.Select(x => x.NodeDto)))
.AndSelect<MemberPropertyTypeDto>()
.From<PropertyTypeDto>()
.InnerJoin<DataTypeDto>().On<PropertyTypeDto, DataTypeDto>((pt, dt) => pt.DataTypeId == dt.NodeId)
.InnerJoin<NodeDto>().On<DataTypeDto, NodeDto>((dt, n) => dt.NodeId == n.NodeId)
.InnerJoin<ContentTypeDto>().On<PropertyTypeDto, ContentTypeDto>((pt, ct) => pt.ContentTypeId == ct.NodeId)
.LeftJoin<PropertyTypeGroupDto>().On<PropertyTypeDto, PropertyTypeGroupDto>((pt, ptg) => pt.PropertyTypeGroupId == ptg.Id)
.LeftJoin<MemberPropertyTypeDto>().On<PropertyTypeDto, MemberPropertyTypeDto>((pt, mpt) => pt.Id == mpt.PropertyTypeId)
@@ -290,6 +293,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
{
Description = dto.Description,
DataTypeId = dto.DataTypeId,
DataTypeKey = dto.DataTypeDto.NodeDto.UniqueId,
Id = dto.Id,
Key = dto.UniqueId,
Mandatory = dto.Mandatory,
@@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.Linq;
using NPoco;
using Umbraco.Core.Cache;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Persistence.Dtos;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Persistence.SqlSyntax;
@@ -17,8 +19,8 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
/// </summary>
internal class ContentTypeRepository : ContentTypeRepositoryBase<IContentType>, IContentTypeRepository
{
public ContentTypeRepository(IScopeAccessor scopeAccessor, AppCaches cache, ILogger logger, IContentTypeCommonRepository commonRepository)
: base(scopeAccessor, cache, logger, commonRepository)
public ContentTypeRepository(IScopeAccessor scopeAccessor, AppCaches cache, ILogger logger, IContentTypeCommonRepository commonRepository, ILanguageRepository languageRepository)
: base(scopeAccessor, cache, logger, commonRepository, languageRepository)
{ }
protected override bool SupportsPublishing => ContentType.SupportsPublishingConst;
@@ -55,7 +57,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
{
// the cache policy will always want everything
// even GetMany(ids) gets everything and filters afterwards
if (ids.Any()) throw new Exception("panic");
if (ids.Any()) throw new PanicException("There can be no ids specified");
return CommonRepository.GetAllTypes().OfType<IContentType>();
}
@@ -230,7 +232,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
throw ex;
}
((ContentType)entity).AddingEntity();
entity.AddingEntity();
PersistNewBaseContentType(entity);
PersistTemplates(entity, false);
@@ -270,7 +272,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
ValidateAlias(entity);
//Updates Modified date
((ContentType)entity).UpdatingEntity();
entity.UpdatingEntity();
//Look up parent to get and set the correct Path if ParentId has changed
if (entity.IsPropertyDirty("ParentId"))
@@ -15,6 +15,7 @@ using Umbraco.Core.Persistence.Factories;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using static Umbraco.Core.Persistence.NPocoSqlExtensions.Statics;
namespace Umbraco.Core.Persistence.Repositories.Implement
{
@@ -26,14 +27,15 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
internal abstract class ContentTypeRepositoryBase<TEntity> : NPocoRepositoryBase<int, TEntity>, IReadRepository<Guid, TEntity>
where TEntity : class, IContentTypeComposition
{
protected ContentTypeRepositoryBase(IScopeAccessor scopeAccessor, AppCaches cache, ILogger logger, IContentTypeCommonRepository commonRepository)
protected ContentTypeRepositoryBase(IScopeAccessor scopeAccessor, AppCaches cache, ILogger logger, IContentTypeCommonRepository commonRepository, ILanguageRepository languageRepository)
: base(scopeAccessor, cache, logger)
{
CommonRepository = commonRepository;
LanguageRepository = languageRepository;
}
protected IContentTypeCommonRepository CommonRepository { get; }
protected ILanguageRepository LanguageRepository { get; }
protected abstract bool SupportsPublishing { get; }
public IEnumerable<MoveEventInfo<TEntity>> Move(TEntity moving, EntityContainer container)
@@ -98,6 +100,8 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
protected void PersistNewBaseContentType(IContentTypeComposition entity)
{
ValidateVariations(entity);
var dto = ContentTypeFactory.BuildContentTypeDto(entity);
//Cannot add a duplicate content type
@@ -163,11 +167,11 @@ AND umbracoNode.nodeObjectType = @objectType",
foreach (var allowedContentType in entity.AllowedContentTypes)
{
Database.Insert(new ContentTypeAllowedContentTypeDto
{
Id = entity.Id,
AllowedId = allowedContentType.Id.Value,
SortOrder = allowedContentType.SortOrder
});
{
Id = entity.Id,
AllowedId = allowedContentType.Id.Value,
SortOrder = allowedContentType.SortOrder
});
}
@@ -214,6 +218,8 @@ AND umbracoNode.nodeObjectType = @objectType",
protected void PersistUpdatedBaseContentType(IContentTypeComposition entity)
{
ValidateVariations(entity);
var dto = ContentTypeFactory.BuildContentTypeDto(entity);
// ensure the alias is not used already
@@ -370,7 +376,7 @@ AND umbracoNode.id <> @id",
foreach (var propertyGroup in entity.PropertyGroups)
{
// insert or update group
var groupDto = PropertyGroupFactory.BuildGroupDto(propertyGroup,entity.Id);
var groupDto = PropertyGroupFactory.BuildGroupDto(propertyGroup, entity.Id);
var groupId = propertyGroup.HasIdentity
? Database.Update(groupDto)
: Convert.ToInt32(Database.Insert(groupDto));
@@ -388,7 +394,7 @@ AND umbracoNode.id <> @id",
//check if the content type variation has been changed
var contentTypeVariationDirty = entity.IsPropertyDirty("Variations");
var oldContentTypeVariation = (ContentVariation) dtoPk.Variations;
var oldContentTypeVariation = (ContentVariation)dtoPk.Variations;
var newContentTypeVariation = entity.Variations;
var contentTypeVariationChanging = contentTypeVariationDirty && oldContentTypeVariation != newContentTypeVariation;
if (contentTypeVariationChanging)
@@ -449,7 +455,7 @@ AND umbracoNode.id <> @id",
// via composition, with their original variations (ie not filtered by this
// content type variations - we need this true value to make decisions.
foreach (var propertyType in ((ContentTypeCompositionBase) entity).RawComposedPropertyTypes)
foreach (var propertyType in ((ContentTypeCompositionBase)entity).RawComposedPropertyTypes)
{
if (propertyType.VariesBySegment() || newContentTypeVariation.VariesBySegment())
throw new NotSupportedException(); // TODO: support this
@@ -518,6 +524,25 @@ AND umbracoNode.id <> @id",
CommonRepository.ClearCache(); // always
}
/// <summary>
/// Ensures that no property types are flagged for a variance that is not supported by the content type itself
/// </summary>
/// <param name="entity"></param>
private void ValidateVariations(IContentTypeComposition entity)
{
//if the entity does not vary at all, then the property cannot have a variance value greater than it
if (entity.Variations == ContentVariation.Nothing)
{
foreach (var prop in entity.PropertyTypes)
{
if (prop.IsPropertyDirty(nameof(prop.Variations)) && prop.Variations > entity.Variations)
throw new InvalidOperationException($"The property {prop.Alias} cannot have variations of {prop.Variations} with the content type variations of {entity.Variations}");
}
}
}
private IEnumerable<IContentTypeComposition> GetImpactedContentTypes(IContentTypeComposition contentType, IEnumerable<IContentTypeComposition> all)
{
var impact = new List<IContentTypeComposition>();
@@ -525,12 +550,12 @@ AND umbracoNode.id <> @id",
var tree = new Dictionary<int, List<IContentTypeComposition>>();
foreach (var x in all)
foreach (var y in x.ContentTypeComposition)
{
if (!tree.TryGetValue(y.Id, out var list))
list = tree[y.Id] = new List<IContentTypeComposition>();
list.Add(x);
}
foreach (var y in x.ContentTypeComposition)
{
if (!tree.TryGetValue(y.Id, out var list))
list = tree[y.Id] = new List<IContentTypeComposition>();
list.Add(x);
}
var nset = new List<IContentTypeComposition>();
do
@@ -572,7 +597,7 @@ AND umbracoNode.id <> @id",
// new property type, ignore
if (!oldVariations.TryGetValue(propertyType.Id, out var oldVariationB))
continue;
var oldVariation = (ContentVariation) oldVariationB; // NPoco cannot fetch directly
var oldVariation = (ContentVariation)oldVariationB; // NPoco cannot fetch directly
// only those property types that *actually* changed
var newVariation = propertyType.Variations;
@@ -636,7 +661,7 @@ AND umbracoNode.id <> @id",
var impactedL = impacted.Select(x => x.Id).ToList();
//Group by the "To" variation so we can bulk update in the correct batches
foreach(var grouping in propertyTypeChanges.GroupBy(x => x.Value.ToVariation))
foreach (var grouping in propertyTypeChanges.GroupBy(x => x.Value.ToVariation))
{
var propertyTypeIds = grouping.Select(x => x.Key).ToList();
var toVariation = grouping.Key;
@@ -646,10 +671,12 @@ AND umbracoNode.id <> @id",
case ContentVariation.Culture:
CopyPropertyData(null, defaultLanguageId, propertyTypeIds, impactedL);
CopyTagData(null, defaultLanguageId, propertyTypeIds, impactedL);
RenormalizeDocumentEditedFlags(propertyTypeIds, impactedL);
break;
case ContentVariation.Nothing:
CopyPropertyData(defaultLanguageId, null, propertyTypeIds, impactedL);
CopyTagData(defaultLanguageId, null, propertyTypeIds, impactedL);
RenormalizeDocumentEditedFlags(propertyTypeIds, impactedL);
break;
case ContentVariation.CultureAndSegment:
case ContentVariation.Segment:
@@ -963,6 +990,205 @@ AND umbracoNode.id <> @id",
Database.Execute(sqlDelete);
}
}
/// <summary>
/// Re-normalizes the edited value in the umbracoDocumentCultureVariation and umbracoDocument table when variations are changed
/// </summary>
/// <param name="propertyTypeIds"></param>
/// <param name="contentTypeIds"></param>
/// <remarks>
/// If this is not done, then in some cases the "edited" value for a particular culture for a document will remain true when it should be false
/// if the property was changed to invariant. In order to do this we need to recalculate this value based on the values stored for each
/// property, culture and current/published version.
/// </remarks>
private void RenormalizeDocumentEditedFlags(IReadOnlyCollection<int> propertyTypeIds, IReadOnlyCollection<int> contentTypeIds = null)
{
var defaultLang = LanguageRepository.GetDefaultId();
//This will build up a query to get the property values of both the current and the published version so that we can check
//based on the current variance of each item to see if it's 'edited' value should be true/false.
var whereInArgsCount = propertyTypeIds.Count + (contentTypeIds?.Count ?? 0);
if (whereInArgsCount > 2000)
throw new NotSupportedException("Too many property/content types.");
var propertySql = Sql()
.Select<PropertyDataDto>()
.AndSelect<ContentVersionDto>(x => x.NodeId, x => x.Current)
.AndSelect<DocumentVersionDto>(x => x.Published)
.AndSelect<PropertyTypeDto>(x => x.Variations)
.From<PropertyDataDto>()
.InnerJoin<ContentVersionDto>().On<ContentVersionDto, PropertyDataDto>((left, right) => left.Id == right.VersionId)
.InnerJoin<PropertyTypeDto>().On<PropertyTypeDto, PropertyDataDto>((left, right) => left.Id == right.PropertyTypeId);
if (contentTypeIds != null)
{
propertySql.InnerJoin<ContentDto>().On<ContentDto, ContentVersionDto>((c, cversion) => c.NodeId == cversion.NodeId);
}
propertySql.LeftJoin<DocumentVersionDto>().On<DocumentVersionDto, ContentVersionDto>((docversion, cversion) => cversion.Id == docversion.Id)
.Where<DocumentVersionDto, ContentVersionDto>((docversion, cversion) => cversion.Current || docversion.Published)
.WhereIn<PropertyDataDto>(x => x.PropertyTypeId, propertyTypeIds);
if (contentTypeIds != null)
{
propertySql.WhereIn<ContentDto>(x => x.ContentTypeId, contentTypeIds);
}
propertySql
.OrderBy<ContentVersionDto>(x => x.NodeId)
.OrderBy<PropertyDataDto>(x => x.PropertyTypeId, x => x.LanguageId, x => x.VersionId);
//keep track of this node/lang to mark or unmark a culture as edited
var editedLanguageVersions = new Dictionary<(int nodeId, int? langId), bool>();
//keep track of which node to mark or unmark as edited
var editedDocument = new Dictionary<int, bool>();
var nodeId = -1;
var propertyTypeId = -1;
PropertyValueVersionDto pubRow = null;
//This is a reader (Query), we are not fetching this all into memory so we cannot make any changes during this iteration, we are just collecting data.
//Published data will always come before Current data based on the version id sort.
//There will only be one published row (max) and one current row per property.
foreach (var row in Database.Query<PropertyValueVersionDto>(propertySql))
{
//make sure to reset on each node/property change
if (nodeId != row.NodeId || propertyTypeId != row.PropertyTypeId)
{
nodeId = row.NodeId;
propertyTypeId = row.PropertyTypeId;
pubRow = null;
}
if (row.Published)
pubRow = row;
if (row.Current)
{
var propVariations = (ContentVariation)row.Variations;
//if this prop doesn't vary but the row has a lang assigned or vice versa, flag this as not edited
if (!propVariations.VariesByCulture() && row.LanguageId.HasValue
|| propVariations.VariesByCulture() && !row.LanguageId.HasValue)
{
//Flag this as not edited for this node/lang if the key doesn't exist
if (!editedLanguageVersions.TryGetValue((row.NodeId, row.LanguageId), out _))
editedLanguageVersions.Add((row.NodeId, row.LanguageId), false);
//mark as false if the item doesn't exist, else coerce to true
editedDocument[row.NodeId] = editedDocument.TryGetValue(row.NodeId, out var edited) ? (edited |= false) : false;
}
else if (pubRow == null)
{
//this would mean that that this property is 'edited' since there is no published version
editedLanguageVersions[(row.NodeId, row.LanguageId)] = true;
editedDocument[row.NodeId] = true;
}
//compare the property values, if they differ from versions then flag the current version as edited
else if (IsPropertyValueChanged(pubRow, row))
{
//Here we would check if the property is invariant, in which case the edited language should be indicated by the default lang
editedLanguageVersions[(row.NodeId, !propVariations.VariesByCulture() ? defaultLang : row.LanguageId)] = true;
editedDocument[row.NodeId] = true;
}
//reset
pubRow = null;
}
}
//lookup all matching rows in umbracoDocumentCultureVariation
var docCultureVariationsToUpdate = editedLanguageVersions.InGroupsOf(2000)
.SelectMany(_ => Database.Fetch<DocumentCultureVariationDto>(
Sql().Select<DocumentCultureVariationDto>().From<DocumentCultureVariationDto>()
.WhereIn<DocumentCultureVariationDto>(x => x.LanguageId, editedLanguageVersions.Keys.Select(x => x.langId).ToList())
.WhereIn<DocumentCultureVariationDto>(x => x.NodeId, editedLanguageVersions.Keys.Select(x => x.nodeId))))
//convert to dictionary with the same key type
.ToDictionary(x => (x.NodeId, (int?)x.LanguageId), x => x);
var toUpdate = new List<DocumentCultureVariationDto>();
foreach (var ev in editedLanguageVersions)
{
if (docCultureVariationsToUpdate.TryGetValue(ev.Key, out var docVariations))
{
//check if it needs updating
if (docVariations.Edited != ev.Value)
{
docVariations.Edited = ev.Value;
toUpdate.Add(docVariations);
}
}
else if (ev.Key.langId.HasValue)
{
//This should never happen! If a property culture is flagged as edited then the culture must exist at the document level
throw new PanicException($"The existing DocumentCultureVariationDto was not found for node {ev.Key.nodeId} and language {ev.Key.langId}");
}
}
//Now bulk update the table DocumentCultureVariationDto, once for edited = true, another for edited = false
foreach (var editValue in toUpdate.GroupBy(x => x.Edited))
{
Database.Execute(Sql().Update<DocumentCultureVariationDto>(u => u.Set(x => x.Edited, editValue.Key))
.WhereIn<DocumentCultureVariationDto>(x => x.Id, editValue.Select(x => x.Id)));
}
//Now bulk update the umbracoDocument table
foreach (var editValue in editedDocument.GroupBy(x => x.Value))
{
Database.Execute(Sql().Update<DocumentDto>(u => u.Set(x => x.Edited, editValue.Key))
.WhereIn<DocumentDto>(x => x.NodeId, editValue.Select(x => x.Key)));
}
}
private static bool IsPropertyValueChanged(PropertyValueVersionDto pubRow, PropertyValueVersionDto row)
{
return !pubRow.TextValue.IsNullOrWhiteSpace() && pubRow.TextValue != row.TextValue
|| !pubRow.VarcharValue.IsNullOrWhiteSpace() && pubRow.VarcharValue != row.VarcharValue
|| pubRow.DateValue.HasValue && pubRow.DateValue != row.DateValue
|| pubRow.DecimalValue.HasValue && pubRow.DecimalValue != row.DecimalValue
|| pubRow.IntValue.HasValue && pubRow.IntValue != row.IntValue;
}
private class NameCompareDto
{
public int NodeId { get; set; }
public int CurrentVersion { get; set; }
public int LanguageId { get; set; }
public string CurrentName { get; set; }
public string PublishedName { get; set; }
public int? PublishedVersion { get; set; }
public int Id { get; set; } // the Id of the DocumentCultureVariationDto
public bool Edited { get; set; }
}
private class PropertyValueVersionDto
{
public int VersionId { get; set; }
public int PropertyTypeId { get; set; }
public int? LanguageId { get; set; }
public string Segment { get; set; }
public int? IntValue { get; set; }
private decimal? _decimalValue;
[Column("decimalValue")]
public decimal? DecimalValue
{
get => _decimalValue;
set => _decimalValue = value?.Normalize();
}
public DateTime? DateValue { get; set; }
public string VarcharValue { get; set; }
public string TextValue { get; set; }
public int NodeId { get; set; }
public bool Current { get; set; }
public bool Published { get; set; }
public byte Variations { get; set; }
}
private void DeletePropertyType(int contentTypeId, int propertyTypeId)
@@ -1013,8 +1239,9 @@ AND umbracoNode.id <> @id",
if (propertyType.PropertyEditorAlias.IsNullOrWhiteSpace() == false)
{
var sql = Sql()
.SelectAll()
.Select<DataTypeDto>(dt => dt.Select(x => x.NodeDto))
.From<DataTypeDto>()
.InnerJoin<NodeDto>().On<DataTypeDto, NodeDto>((dt, n) => dt.NodeId == n.NodeId)
.Where("propertyEditorAlias = @propertyEditorAlias", new { propertyEditorAlias = propertyType.PropertyEditorAlias })
.OrderBy<DataTypeDto>(typeDto => typeDto.NodeId);
var datatype = Database.FirstOrDefault<DataTypeDto>(sql);
@@ -1022,6 +1249,7 @@ AND umbracoNode.id <> @id",
if (datatype != null)
{
propertyType.DataTypeId = datatype.NodeId;
propertyType.DataTypeKey = datatype.NodeDto.UniqueId;
}
else
{
@@ -9,6 +9,7 @@ using Umbraco.Core.Events;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Persistence.Dtos;
using Umbraco.Core.Persistence.Factories;
using Umbraco.Core.Persistence.Querying;
@@ -106,7 +107,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
protected override void PersistNewItem(IDataType entity)
{
((DataType)entity).AddingEntity();
entity.AddingEntity();
//ensure a datatype has a unique name before creating it
entity.Name = EnsureUniqueNodeName(entity.Name);
@@ -174,7 +175,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
}
//Updates Modified date
((DataType)entity).UpdatingEntity();
entity.UpdatingEntity();
//Look up parent to get and set the correct Path if ParentId has changed
if (entity.IsPropertyDirty("ParentId"))

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