summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wolanin2010-06-17 19:37:17 (GMT)
committerPeter Wolanin2010-06-17 19:37:17 (GMT)
commit6d3740d70384a259b11a8d349bb0c6777c83b270 (patch)
tree7e29c857d4d8ca4d84514072404e8fda3348ca6b
parent99c88e0d636502958213bf50dd68f973db6a3b76 (diff)
#829920 by YesCT, mieg, and pwolanin check for tags existing, avoid dividing by zero6.x-3.5
-rw-r--r--filefield_meta/filefield_meta.install9
1 files changed, 7 insertions, 2 deletions
diff --git a/filefield_meta/filefield_meta.install b/filefield_meta/filefield_meta.install
index fea9489..25a8497 100644
--- a/filefield_meta/filefield_meta.install
+++ b/filefield_meta/filefield_meta.install
@@ -147,8 +147,13 @@ function filefield_meta_update_6100(&$context) {
$context['sandbox']['progress'] = 0;
$context['sandbox']['total'] = db_result(db_query("SELECT COUNT(*) FROM {files} f INNER JOIN {filefield_meta} fm ON f.fid = fm.fid WHERE fm.audio_format <> ''"));
$context['sandbox']['current_fid'] = 0;
-
- db_add_field($ret, 'filefield_meta', 'tags', array('type' => 'text'));
+ if (!db_column_exists('filefield_meta', 'tags')) {
+ db_add_field($ret, 'filefield_meta', 'tags', array('type' => 'text'));
+ }
+ // We are done if there are none to update.
+ if ($context['sandbox']['total'] == 0) {
+ return $ret;
+ }
}
// Select and process 200 files at a time.