Merge pull request #3463 from friendica/develop

Update 3.5.2rc with latest develop
This commit is contained in:
Michael Vogel 2017-05-14 21:08:08 +02:00 committed by GitHub
commit 9f62dd8627
2 changed files with 8 additions and 8 deletions

View File

@ -845,7 +845,7 @@ class dba {
} }
/** /**
* @brief Insert a row into a table * @brief Delete a row from a table
* *
* @param string $table Table name * @param string $table Table name
* @param array $param parameter array * @param array $param parameter array
@ -918,7 +918,9 @@ class dba {
if (!$in_process) { if (!$in_process) {
// Now we finalize the process // Now we finalize the process
if (!self::$in_transaction) { $do_transaction = !self::$in_transaction;
if ($do_transaction) {
self::transaction(); self::transaction();
} }
@ -932,7 +934,7 @@ class dba {
logger(dba::replace_parameters($sql, $command['param']), LOGGER_DATA); logger(dba::replace_parameters($sql, $command['param']), LOGGER_DATA);
if (!self::e($sql, $command['param'])) { if (!self::e($sql, $command['param'])) {
if (!self::$in_transaction) { if ($do_transaction) {
self::rollback(); self::rollback();
} }
return false; return false;
@ -962,7 +964,7 @@ class dba {
logger(dba::replace_parameters($sql, $field_values), LOGGER_DATA); logger(dba::replace_parameters($sql, $field_values), LOGGER_DATA);
if (!self::e($sql, $field_values)) { if (!self::e($sql, $field_values)) {
if (!self::$in_transaction) { if ($do_transaction) {
self::rollback(); self::rollback();
} }
return false; return false;
@ -970,7 +972,7 @@ class dba {
} }
} }
} }
if (!self::$in_transaction) { if ($do_transaction) {
self::commit(); self::commit();
} }
return true; return true;

View File

@ -485,9 +485,7 @@ function notification($params) {
); );
if ($p && (count($p) > 1)) { if ($p && (count($p) > 1)) {
for ($d = 1; $d < count($p); $d ++) { for ($d = 1; $d < count($p); $d ++) {
q("DELETE FROM `notify` WHERE `id` = %d", dba::delete('notify', array('id' => $p[$d]['id']));
intval($p[$d]['id'])
);
} }
// only continue on if we stored the first one // only continue on if we stored the first one