From 9b69a0ce56ea5e04f003202ff71c4eb6b6afbda5 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Wed, 10 Sep 2008 12:04:30 +0000 Subject: [PATCH] MDL-16406 - trying to mitigate box.net problems slightly. --- portfolio/type/boxnet/lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/portfolio/type/boxnet/lib.php b/portfolio/type/boxnet/lib.php index d7c8843a9b..b4cf4e5235 100644 --- a/portfolio/type/boxnet/lib.php +++ b/portfolio/type/boxnet/lib.php @@ -227,7 +227,13 @@ class portfolio_plugin_boxnet extends portfolio_plugin_push_base { } while (true) { if (!array_key_exists('file_name', $this->accounttree) || !in_array($newname, $this->accounttree['file_name'])) { - return $this->boxclient->renameFile($fileid, $newname); + for ($i = 0; $i < 2; $i++) { + if ($this->boxclient->renameFile($fileid, $newname)) { + return true; + } + } + debugging("tried three times to rename file and failed"); + return false; } $newname = $prefix . '(' . $count . ')' . $suffix; $count++; -- 2.39.5