Deal with fixme in Umbraco.Web

This commit is contained in:
Stephan
2019-01-21 15:57:48 +01:00
parent 4a0b969777
commit 9522ee826f
63 changed files with 84 additions and 153 deletions

View File

@@ -15,7 +15,7 @@ namespace Umbraco.Web.Models
[DebuggerDisplay("Content Id: {Id}, Name: {Name}")]
public abstract class PublishedContentBase : IPublishedContent
{
private string _url; // fixme - cannot cache urls, they depends on the current request
private string _url; // fixme/task - cannot cache urls, they depends on the current request
#region ContentType
@@ -79,12 +79,12 @@ namespace Umbraco.Web.Models
/// The url of documents are computed by the document url providers. The url of medias are, at the moment,
/// computed here from the 'umbracoFile' property -- but we should move to media url providers at some point.
/// </remarks>
public virtual string GetUrl(string culture = null) // fixme - consider .GetCulture("fr-FR").Url
public virtual string GetUrl(string culture = null) // todo - consider .GetCulture("fr-FR").Url
{
switch (ItemType)
{
case PublishedItemType.Content:
// fixme - consider injecting an umbraco context accessor
// todo - consider injecting an umbraco context accessor
if (UmbracoContext.Current == null)
throw new InvalidOperationException("Cannot compute Url for a content item when UmbracoContext.Current is null.");
if (UmbracoContext.Current.UrlProvider == null)
@@ -103,7 +103,7 @@ namespace Umbraco.Web.Models
var propType = ContentType.GetPropertyType(Constants.Conventions.Media.File);
// fixme - consider implementing media url providers
// todo - consider implementing media url providers
// note: that one does not support variations
//This is a hack - since we now have 2 properties that support a URL: upload and cropper, we need to detect this since we always
// want to return the normal URL and the cropper stores data as json