Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Fix urls by converting virtual paths to absolute #63

Merged
merged 1 commit into from
Feb 21, 2017

Conversation

0Neji
Copy link

@0Neji 0Neji commented Jan 27, 2017

I ran into a problem using Doc Type Grid Editor in a child application - currently the paths simply point to the root of the site/application. This should fix that by using umbRequestHelper.convertVirtualToAbsolutePath to specify a virtual path and have it converted to the correct absolute path that umbraco is actually using.

Ensures that urls are relative to the current project (instead of
pointing to the root) - this fixes 404s when using Doc Type Grid Editor
in an Umbraco project set up as a child application in IIS.
@@ -2,14 +2,14 @@
function ($q, $http, umbRequestHelper) {
return {
getContentTypeAliasByGuid: function (guid) {
var url = "/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeAliasByGuid?guid=" + guid;
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeAliasByGuid?guid=" + guid);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0Neji Sorry to sound picky, any chance you can correct the whitespacing - tab to spaces? Thanks.

@leekelleher
Copy link
Collaborator

@0Neji Thanks for the PR & fix, very much appreciated!

@mattbrailsford Does this look good for you?

@leekelleher leekelleher self-assigned this Feb 19, 2017
@leekelleher
Copy link
Collaborator

Just checked when umbRequestHelper.convertVirtualToAbsolutePath was introduced, it was Umbraco v7.3.0 (commit: umbraco/Umbraco-CMS@6cf25f0).

We're currently compiling against Umbraco v7.2.0 (as that's the version the Grid was released). I'm happy to bump the minimum version up to v7.3.0. // @mattbrailsford Cool with you?

@leekelleher leekelleher added this to the 0.4.0 milestone Feb 21, 2017
leekelleher added a commit that referenced this pull request Feb 21, 2017
Upgraded UmbracoCms.Core NuGet package reference to v7.3.0
This is to accommodate PR #63
@mattbrailsford
Copy link
Collaborator

mattbrailsford commented Feb 21, 2017 via email

@leekelleher leekelleher merged commit a3605e8 into skttl:develop Feb 21, 2017
@leekelleher
Copy link
Collaborator

Merged in. Thanks @0Neji!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants