Drag and Drop import causes problems with file paths

This forum is for all Flare issues related to importing files or projects.
Post Reply
wclass
Propellus Maximus
Posts: 1238
Joined: Mon Feb 27, 2006 5:56 am
Location: Melbourne, Australia

Drag and Drop import causes problems with file paths

Post by wclass »

We have spotted an issue with the new drag and drop import feature - have reported it as a bug, though there was some discussion about whether it was desired behaviour or not.
My current work around is to use copy/paste of files in Windows rather than drag/drop.

In our style sheets and master pages we have some relative paths for images, or urls, similar to the following example from the Flare sample Top Navigation template.

Code: Select all

div.topic-hero
{
	padding: 8% 0;
	background-image: url('../Images/Hero-Image.png');
	background-size: cover;
	background-attachment: scroll;
}
This example text is stored in the stylesheet called Styles.css. Note that the url to the image is a relative path name. This stylesheet is stored on a file server as part of a global project so that all projects can import common files when they are updated.
 
I updated another feature in the global stylesheet (Styles.css) – for example, the color of the H1 tag – did not change anything with a path in it.
The templates are stored on our file server with a path something like the following:

Code: Select all

\\servername\techwriters\Projects\examples.flprj
Usually I import the stylesheet when updates are made but I thought I would try the new drag and drop feature. So I dragged the stylesheet in and then looked at the code - here is what that portion of code looks like now:

Code: Select all

div.topic-hero
{
	padding: 8% 0;
	background-image: url('file://servername/techwriters/Projects/examples.flprj/Content/Resources/Images/Hero-Image.png');
	background-size: cover;
	background-attachment: scroll;
}
 
The URL to the image now has the file server path hard coded instead of a relative reference to the local image.
I don't think drag and drop should change the code like this - I want the file to come in as is.
When reading the help, there is an implication that you have a choice of importing (where processing might occur) or just copy/paste. In this instance I wanted to copy/paste but I did not get a choice.

This happened to URLs in style sheets and in master pages. I spotted the error when I was working remotely - it slowed the build down as it was constantly going back to the server to grab image files.
Margaret Hassall - Melbourne
Jeong
Propeller Head
Posts: 25
Joined: Wed Jan 01, 2020 12:05 am

Re: Drag and Drop import causes problems with file paths

Post by Jeong »

Apologies if I didn't understand something 100%, but I think that drag-and-drop behaviour (updating links) is desired. If that's turned off, then when moving a topic or any other file in your project from one location to another (within the project), the links will be broken. But I'm guessing this is only when you drag and drop from within Flare? Do the links still get updated if you drag and drop using Windows Explorer? (I assumed it wouldn't).

Working within Flare... if the Import process seems like there's too many steps involved to update, I've submitted a bug report that's on the 'opposite side of the fence', so to speak, which you might be able to exploit. I've found that when creating a copy of a file in a different location by using the File > Save As method in Flare, this causes Flare to skip the link updating routine. For me, this resulted in broken links, which I reported as a bug. For you, instead of being forced to used the Import process, you could use File > Save As to intentionally bypass link updating (although - if this is "fixed" later on, this method will break).

Also, that UNC path (\\servername\blah)... I'm not 100% on how your company has set everything up, but my current understanding is that non-local paths should not be visible from within Flare. You can use other methods to get remote files into your local project directory (source control, Windows Explorer, some file-sync tool... as long as one understands the implications of each), but Flare should be made to think only about what's in its local project directory (with the exception of "push to remote" in source control | or "publish" |... oh and I haven't explored what "External Resources" is all about yet, so my advice here might be wrong - please take with a grain of salt!).
wclass
Propellus Maximus
Posts: 1238
Joined: Mon Feb 27, 2006 5:56 am
Location: Melbourne, Australia

Re: Drag and Drop import causes problems with file paths

Post by wclass »

Thanks for your thoughts. There are a few different use cases around link updating – I think that I have just hit one instance where it doesn’t work. I agree that when moving within a project the links need to be updated – and this works fine.

The traditional import process works OK too – I was testing the new drag and drop as it seems much quicker when you just want to re-import one file (so I will go back to import if needed).

I think the bug is that I don’t get asked if I want to “copy” or “import” – it just “imports”, thereby automatically updating the links. In my case, a copy is sufficient but I don’t get that option.
We have used UNC paths for ages and they work. I have them set up as a location for project templates, and we use them for publishing destinations. Sometimes Flare has a problem with network paths if you haven’t opened the folder in Windows File Explorer first, but otherwise it works well.

We have tested with external resources but that is not really suitable for our needs. Would be useful if we were sharing images and things like that with other departments, but we have no need.
Margaret Hassall - Melbourne
Post Reply