We have moved to GitHub Issues
You are viewing the read-only archive of Umbraco's issue tracker. To create new issues, please head over to GitHub Issues.
Make sure to read the blog posts announcing the move for more information.
Created by Shannon Deminick 20 Jun 2012, 15:44:37 Updated by Claus Jensen 14 Apr 2016, 10:59:31
Subtask of: U4-806
There is a TON of reliance on HttpContext.Items in the codebase and using magic strings to get access to these elements. All of this functionality should be wrapped up in the UmbracoContext class which should expose these as properties. Then we replace all calls to the HttpContext.Items to use the UmbracoContext.
We should also have this using an IUmbracoContext so we can unit test everything! Having all reliance on UmbracoContext.Current would be just as bad as having reliance on HttpContext.Current.
I think this task relates to implementing IFileSystem right? As the HttpContext is used to MapPath in various classes.
Well, HttpContext itself is another problem :)
The actual collection HttpContext.Items is used throughout the codebase and there's all sorts of special items that 'need' to be in there or else things will stop working. All of this is based on magic strings so it would be much better to have this collection of special items part of a real class with getters/setters. This class can then wrap HttpContext.Items internally if it wants.
@Shannon could you please update the status of this work item? If there's still a lot of work to be done to bring this to completion we should move it to the 6.0.0 release so it doesn't slow down actual development on 4.10. Thanks!
This is not critical, its just a much nicer way to deal with the substantial amount of untyped calls to the HttpContext.Items with magic strings. The wrapper should be on the UmbracoContext but yes, we can wait till v6 for this or whenevs.
Priority: Task - Pri 1
Type: Task
State: Closed
Assignee:
Difficulty: Very Easy
Category: Architecture
Backwards Compatible: False
Fix Submitted:
Affected versions: 4.5.2
Due in version:
Sprint:
Story Points:
Cycle: