From fe40dadd5c487b5d4d64097a72bb123ffed1e30c Mon Sep 17 00:00:00 2001 From: shadlaws Date: Wed, 26 Jun 2013 23:49:48 +0200 Subject: Fix Controller_Auth_Test - T_CURLY_OPEN not parsed as "{". Update golden file. --HG-- extra : source : 816294dd5f6fe23160baf9f516e49c66ea8fcb6c --- modules/gallery/tests/Controller_Auth_Test.php | 4 ++++ modules/gallery/tests/controller_auth_data.txt | 1 + 2 files changed, 5 insertions(+) (limited to 'modules') 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 -- cgit v1.2.3 From 2d20af76f9a46575d77438b00e307739ab57e218 Mon Sep 17 00:00:00 2001 From: Daniel Muller Date: Sat, 6 Jul 2013 13:08:51 +0800 Subject: #2078 Missing file type extension on combined css/js --- modules/gallery/libraries/Gallery_View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index 3f59db6a..de282ac9 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. @@ -262,4 +262,4 @@ class Gallery_View_Core extends View { return $css; } -} \ No newline at end of file +} -- cgit v1.2.3 From d0aef95a657c9e50fe255ca912bb01b7c3b74c2e Mon Sep 17 00:00:00 2001 From: shadlaws Date: Mon, 8 Jul 2013 09:39:54 +0200 Subject: Move "item_moved" event later in the item update process. Fixes #2077. Before, this was before the children's caches were cleared, so if the "item_moved" set an album cover, it would fail with an invalid path. For the same reason, we move it after the data file update, too. Lastly, get we get rid of duplicated code in item::move() since the "item_moved" event already does this. --- modules/gallery/helpers/item.php | 5 ----- modules/gallery/models/item.php | 10 +++++----- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'modules') 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/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) { -- cgit v1.2.3 From e8752f60b8442b2daf6c8569c74e25057259922b Mon Sep 17 00:00:00 2001 From: shadlaws Date: Tue, 9 Jul 2013 11:19:20 +0200 Subject: Remove extension from cache busters of non-combined JS/CSS links (follows 2078). --- modules/gallery/libraries/Gallery_View.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index de282ac9..d98da83a 100644 --- a/modules/gallery/libraries/Gallery_View.php +++ b/modules/gallery/libraries/Gallery_View.php @@ -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); } } } -- cgit v1.2.3