summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2013-07-08 21:38:31 +0000
committerfisharebest <fisharebest@gmail.com>2013-07-08 21:38:31 +0000
commite543401a2ad1e4ad82d024772109ca8af1ce7709 (patch)
treee05b248ca504ff85d9de5fa61b9a14541bccac84
parent1ee0a4f002d11cc0141cb843df6241d214fc09c1 (diff)
downloadwebtrees-e543401a2ad1e4ad82d024772109ca8af1ce7709.tar.gz
webtrees-e543401a2ad1e4ad82d024772109ca8af1ce7709.tar.bz2
webtrees-e543401a2ad1e4ad82d024772109ca8af1ce7709.zip
Fix: update media object
-rw-r--r--addmedia.php12
1 files changed, 2 insertions, 10 deletions
diff --git a/addmedia.php b/addmedia.php
index 4fc0367534..123d962a58 100644
--- a/addmedia.php
+++ b/addmedia.php
@@ -387,18 +387,10 @@ case 'update': // Save the information from the “editmedia” action
$islink = array_merge(array(0), $islink);
$text = array_merge(array($newFilename), $text);
- if (!empty($pid)) {
- $gedrec=find_gedcom_record($pid, WT_GED_ID, true);
- }
+ $record = WT_GedcomRecord::getInstance($pid);
$newrec = "0 @$pid@ OBJE\n";
$newrec = handle_updates($newrec);
- if (!$update_CHAN) {
- $newrec .= get_sub_record(1, '1 CHAN', $gedrec);
- }
- //-- look for the old record media in the file
- //-- if the old media record does not exist that means it was
- //-- generated at import and we need to append it
- replace_gedrec($pid, WT_GED_ID, $newrec, $update_CHAN);
+ $record->updateRecord($newrec, $update_CHAN);
if ($pid && $linktoid!='') {
$link = linkMedia($pid, $linktoid, 1);