Hi guys,
I've included an "edit" function in the bodyInsertItem widget, which
adds an "edit" link to the widget, popping up the library upload page,
passing the objectID of the currently selected item.
it was randomly killing off files which seemed very unreasonable, on
investigation I came across the following in libraryupload.cfm:
<cfset oType = createobject("component",
application.types[librarytype].typePath)>
<!--- allow the upload to hanlde plp steps --->
<cfset stProps=structNew()>
<cfif isDefined("plpObjectID") AND plpObjectID NEQ "">
<!--- grab data from db --->
<cfset stProps.objectid = plpObjectID>
<cfelse>
<cfset stProps.objectid = createUUID()>
</cfif>
<cfset stProps.label = "(incomplete)">
<cfset stProps.title = "">
<cfset stProps.lastupdatedby = session.dmSec.authentication.userlogin>
<cfset stProps.datetimelastupdated = Now()>
<cfset stProps.createdby = session.dmSec.authentication.userlogin>
<cfset stProps.datetimecreated = Now()>
<cfset stProps.documentDate = Now()>
<!--- dmHTML specific props --->
<cfset stProps.displayMethod = "display">
<cfset stProps.status = "draft">
<!--- dmNews specific props --->
<cfset stProps.publishDate = now()>
<cfset stProps.expiryDate = now()>
<cfset oType.createData(stProperties=stProps)>
<cfset stObj = oType.getData(stProps.objectid)>
<cfparam name="bPLPStorage" default="no">
<cfscript>
// TODO THIS IS SO DODGE! quick and dirty fix,
// to delete records if the for is not submitted but still have the
default values stored in the stobj
// for use on the form
if(NOT isDefined("form.submit") AND bPLPStorage EQ "yes")
oType.deleteData(stProps.objectid);
</cfscript>
to try resolve the random deletion, i've moved the <cfset stProps.XXX>
into the <cfelse> statement above it - so at least we're not creating
unnecessary db records every time this page is hit..
now, regarding the "THIS IS SO DODGE" area (haha!) is it going to
cause me any problem to just remove that piece of code? is my
understanding correct in that it's only there to attempt to clean up
the unnecessary db records created by the "createData" above it?
Cheers, any insight appreciated,
B.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---