Skip to content

Commit 78d93bd

Browse files
author
Blair McKenzie
committed
fixes to post mode, related to deleting and teaser display in webtop
1 parent 0a84318 commit 78d93bd

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/formtools/image.cfc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@
276276
<!--- Copy the source into the new field --->
277277
<cfif len(sourcefilename) and refindnocase("//res.cloudinary.com/",sourcefilename)>
278278
<!--- source=xxx => original file for this image; _source=xxx => temporary variable used for dependant cuts --->
279-
<cfif refind("\?(source|_source)=",sourcefilename)>
280-
<cfreturn passed(rereplace(sourcefilename,"\?_?source=[^&]+","") & "?_source=" & application.fc.lib.cloudinary.getSource(sourcefilename)) />
281-
</cfif>
279+
<cfset sourcefilename = replace(sourcefilename,"?source=","?_source=") />
282280
<cfelseif len(sourcefilename) and application.fc.lib.cdn.ioFileExists(location="images",file=sourcefilename)>
283281
<cfset sourcefilename = application.fc.lib.cdn.ioCopyFile(source_location="images",source_file=sourcefilename,dest_location="images",dest_file=arguments.destination & "/" & listlast(sourcefilename,"\/"),nameconflict="makeunique",uniqueamong="images") />
284282
</cfif>
@@ -446,7 +444,7 @@
446444
<cfif arguments.admin and refindnocase("\?source=",arguments.stObject[arguments.stMetadata.name])>
447445
<cfset stResult = application.fc.lib.cdn.ioGetFileLocation(location="images",file=application.fc.lib.cloudinary.getSource(arguments.stObject[arguments.stMetadata.name])) />
448446
<cfelseif refindnocase("//res.cloudinary.com/",arguments.stObject[arguments.stMetadata.name])>
449-
<cfset stResult.path = rereplace(arguments.stObject[arguments.stMetadata.name],"\?_?source=[^&]+","") />
447+
<cfset stResult.path = rereplace(arguments.stObject[arguments.stMetadata.name],"\?.*","") />
450448
<cfelse>
451449
<cfset stResult = application.fc.lib.cdn.ioGetFileLocation(location="images",file=arguments.stObject[arguments.stMetadata.name],admin=arguments.admin,bRetrieve=arguments.bRetrieve) />
452450
</cfif>

packages/lib/cloudinary.cfc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ component {
196196
stResult["template"] = rereplace(stResult.untransformed, "/fetch/", "/fetch/{transformation}/");
197197
}
198198

199-
else if (refindnocase(reAuto, arguments.file)){
199+
else if (len(autoUploadFolder) and refindnocase(reAuto, arguments.file)){
200200
stResult["type"] = "auto";
201201
stResult["source"] = rereplacenocase(arguments.file, reAuto, "\2");
202202
stResult["transformation"] = rereplace(arguments.file, reAuto, "\1")
@@ -214,8 +214,14 @@ component {
214214
if (refindnocase("\?source=", arguments.file)){
215215
stResult["dependant"] = false;
216216
}
217+
else {
218+
stResult["dependant"] = true;
219+
}
217220
}
218221
stResult["transformation"] = rereplace(arguments.file, rePost, "\1");
222+
if (len(stResult.source)){
223+
stResult["transformation"] = stResult["transformation"] & "?" & (stResult.dependant ? "_" : "") & "source=" & stResult.source;
224+
}
219225
if (len(stResult["transformation"])){
220226
stResult["untransformed"] = apiURLPrefix & "/upload" & rereplace(arguments.file, rePost, "\2") & rereplace(arguments.file, rePost, "\3");
221227
};

0 commit comments

Comments
 (0)