Permalink
Browse files

fixed bug with duplicate things beings posted

  • Loading branch information...
Nuno Job
Nuno Job committed Apr 15, 2010
1 parent 63ba6f5 commit cc4521b894eac9f86a6f410fd6914e749ef326ed
Showing with 9 additions and 1 deletion.
  1. +9 −1 new.xqy
View
10 new.xqy
@@ -47,7 +47,15 @@ xdmp:set-response-content-type( "application/xhtml+xml" ),
let $path := fn:concat("/", $dir, "/", $title[1], "-", $salt ,".xml")
let $xpaths := xdmp:get-request-field-names()
let $values := for $field in $xpaths
return xdmp:get-request-field($field)
return xdmp:get-request-field($field)[1]
let $_ := xdmp:log($salt)
let $_ := xdmp:log($title)
let $_ := xdmp:log($dir)
let $_ := xdmp:log($path)
let $_ := xdmp:log(fn:string-join($xpaths, ", "))
let $_ := xdmp:log(fn:string-join($values, ", "))
return (xdmp:document-insert( $path,
gen:process-fields( $xpaths, $values ) ),
<p>New Post created</p>)

0 comments on commit cc4521b

Please sign in to comment.