summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/helpers/item.php5
-rw-r--r--modules/gallery/libraries/Gallery_View.php9
-rw-r--r--modules/gallery/models/item.php10
-rw-r--r--modules/gallery/tests/Controller_Auth_Test.php4
-rw-r--r--modules/gallery/tests/controller_auth_data.txt1
5 files changed, 15 insertions, 14 deletions
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index bbbc81d6..1330482f 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -63,11 +63,6 @@ class item_Core {
break;
}
}
-
- // If the target has no cover item, make this it.
- if ($target->album_cover_item_id == null) {
- item::make_album_cover($source);
- }
}
static function make_album_cover($item) {
diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php
index 3f59db6a..d98da83a 100644
--- a/modules/gallery/libraries/Gallery_View.php
+++ b/modules/gallery/libraries/Gallery_View.php
@@ -157,7 +157,7 @@ class Gallery_View_Core extends View {
// 7 == size, 9 == mtime, see http://php.net/stat
$key[] = "$path $stats[7] $stats[9]";
}
- $key = md5(join(" ", $key));
+ $key = md5(join(" ", $key)) . (($type=="css") ? ".css" : ".js");
if (gallery::allow_css_and_js_combining()) {
// Combine enabled - if we're at the start of the buffer, add a comment.
@@ -206,11 +206,12 @@ class Gallery_View_Core extends View {
}
} else {
// Don't combine - just return the CSS and JS links (with the key as a cache buster).
+ $key_base = substr($key, 0, (($type == "css") ? -4 : -3)); // key without extension
foreach (array_keys($this->combine_queue[$type][$group]) as $path) {
if ($type == "css") {
- $buf .= html::stylesheet("$path?m=$key", "screen,print,projection", false);
+ $buf .= html::stylesheet("$path?m=$key_base", "screen,print,projection", false);
} else {
- $buf .= html::script("$path?m=$key", false);
+ $buf .= html::script("$path?m=$key_base", false);
}
}
}
@@ -262,4 +263,4 @@ class Gallery_View_Core extends View {
return $css;
}
-} \ No newline at end of file
+}
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 1d4f35da..2dbd99bb 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -498,11 +498,6 @@ class Item_Model_Core extends ORM_MPTT {
@rename($original->resize_path(), $this->resize_path());
@rename($original->thumb_path(), $this->thumb_path());
}
-
- if ($original->parent_id != $this->parent_id) {
- // This will result in 2 events since we'll still fire the item_updated event below
- module::event("item_moved", $this, $original->parent());
- }
}
// Changing the name, slug or parent ripples downwards
@@ -526,6 +521,11 @@ class Item_Model_Core extends ORM_MPTT {
$this->resize_dirty = 1;
}
+ if ($original->parent_id != $this->parent_id) {
+ // This will result in 2 events since we'll still fire the item_updated event below
+ module::event("item_moved", $this, $original->parent());
+ }
+
module::event("item_updated", $original, $this);
if ($this->data_file) {
diff --git a/modules/gallery/tests/Controller_Auth_Test.php b/modules/gallery/tests/Controller_Auth_Test.php
index e1ca0a7b..6551decb 100644
--- a/modules/gallery/tests/Controller_Auth_Test.php
+++ b/modules/gallery/tests/Controller_Auth_Test.php
@@ -47,6 +47,10 @@ class Controller_Auth_Test extends Gallery_Unit_Test_Case {
$function = null;
for ($token_number = 0; $token_number < count($tokens); $token_number++) {
$token = $tokens[$token_number];
+ if (self::_token_matches(array(T_CURLY_OPEN), $tokens, $token_number)) {
+ // Treat this just like a normal open curly brace
+ $token = "{";
+ }
// Count braces.
// 1 open brace = in class context.
diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt
index 4cd9f047..4f0b6ca5 100644
--- a/modules/gallery/tests/controller_auth_data.txt
+++ b/modules/gallery/tests/controller_auth_data.txt
@@ -37,6 +37,7 @@ modules/tag/controllers/admin_tags.php index
modules/tag/controllers/tag.php __call DIRTY_CSRF|DIRTY_AUTH
modules/tag/controllers/tag_name.php __call DIRTY_AUTH
modules/tag/controllers/tags.php autocomplete DIRTY_CSRF|DIRTY_AUTH
+modules/tag/helpers/tag_rss.php feed DIRTY_AUTH
modules/user/controllers/admin_users.php index DIRTY_CSRF
modules/user/controllers/password.php reset DIRTY_AUTH
modules/user/controllers/password.php do_reset DIRTY_CSRF|DIRTY_AUTH