summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-06-17 16:21:50 -0400
committerRobin Millette <millette@controlyourself.ca>2009-06-17 16:21:50 -0400
commit1505e3a4c3dda7030bb92a2071ec58af2972bed7 (patch)
tree6bd3477e5257df27b97315f70c13c8159d874524 /classes
parentbefbfc9c73a75bac9d7dac4a4b7a21bd515ce1b4 (diff)
Fixed recent attachment bug that required URLs to be posted twice to be taken into account.
Diffstat (limited to 'classes')
-rw-r--r--classes/File.php2
-rw-r--r--classes/Notice.php8
2 files changed, 6 insertions, 4 deletions
diff --git a/classes/File.php b/classes/File.php
index 24ab11b8e..08320faf8 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -79,7 +79,6 @@ class File extends Memcached_DataObject
&& ('text/html' === substr($redir_data['type'], 0, 9))
&& ($oembed_data = File_oembed::_getOembed($given_url))
&& isset($oembed_data['json'])) {
-
File_oembed::saveNew($oembed_data['json'], $file_id);
}
return $x;
@@ -98,7 +97,6 @@ class File extends Memcached_DataObject
if ($redir_url === $given_url) {
$x = File::saveNew($redir_data, $given_url);
$file_id = $x->id;
-
} else {
$x = File::processNew($redir_url, $notice_id);
$file_id = $x->id;
diff --git a/classes/Notice.php b/classes/Notice.php
index 770b5d78b..e0bb90ba6 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -218,6 +218,12 @@ class Notice extends Memcached_DataObject
$notice->addToInboxes();
$notice->saveGroups();
$notice->saveUrls();
+ $orig2 = clone($notice);
+ $notice->rendered = common_render_content($final, $notice);
+ if (!$notice->update($orig2)) {
+ common_log_db_error($notice, 'UPDATE', __FILE__);
+ return _('Problem saving notice.');
+ }
$notice->query('COMMIT');
@@ -237,8 +243,6 @@ class Notice extends Memcached_DataObject
* follow redirects and save all available file information
* (mimetype, date, size, oembed, etc.)
*
- * @param class $notice Notice to pull URLs from
- *
* @return void
*/
function saveUrls() {