Age | Commit message (Collapse) | Author |
|
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.
|
|
- added extra $var_subdir argument to item::find_by_path.
- changed item::find_by_path to use $var_subdir to detect if we should look for a jpg-converted item or not (e.g. movie thumbs)
- moved the album thumb detection to item::find_by_path to ensure it knows to look for an exact album match.
- added more sanity checks to item::find_by_path (now has fewer false positive possibilities).
- updated file_proxy to remove the need to guess different movie files.
- updated File_Proxy_Controller - new sanity checks catch previously undetected bug.
- added additional unit tests for item::find_by_path.
|
|
- Added missing_album_cover.jpg placeholder image.
- Modified the graphics helper to use it. Calling graphics::generate will copy it.
- Modified item::remove_album_cover and gallery_event::item_created to run graphics::generate.
- Added unit test to Graphics_Helper_Test.
|
|
Restrict which album cover ids we swap over to the hierarchy of the
current album, otherwise we can wind up in sticky situations with
hierarchical album cover chains.
Eg, you have a hierarchy like this:
root -> A1 -> A2 --> A3 -> P1
A4 -> P2
P1 is the album cover for its entire hierarchy. But then you
swap A2's album cover for A3 making this:
root -> A1 -> A2 + A3 -> P1
\-> A4 -> P2
Since A1, A2 and A3 all had P1 as their album cover item id. Now
we're swapping it over to P2 but we want to leave P1 as A3's album
cover item id. So only look at A4's hierarchy and ignore its peers.
|
|
using the old item as their album cover. Fixes #1978.
|
|
- Added stanza to Item_Model::save that handles when cover id is null.
- Added logic to graphics::generate to copy/convert album cover thumbs from their item thumbs to ensure they're always jpg, and eliminate the possibility that we copy/convert a dirty thumb.
- Redirected other places in code where we want to do one of the above two things to use these two functions instead (gallery_event::item_updated_data_file, item::make_album_cover, item::remove_album_cover).
- Improved validation in Item_Model so only albums can have covers and all covers must be non-albums.
- Added unit tests to Graphics_Helper_Test.
|
|
conflict-finding code check filenames with no extensions
- Reduced from four places that alter names/slugs to two (one to populate empty slugs, one to handle conflicting names/slugs).
- For empty slugs, fill with generic human-readable name (e.g. "photo") instead of random value.
- For conflicting names/slugs, add suffix that's sequential (e.g. "-01"), only using random after 99 conflicts.
- Made conflict-finding code check filenames with no extensions.
- Renamed _randomize_name_or_slug_on_conflict to _check_and_fix_conflicts.
- Added unit tests. Also cleaned up existing unit tests to reflect new logic and removed a redundant test.
- Added installer logic to correct existing items now considered in conflict.
- Revised gallery_task to look for duplicate names based on new criteria.
|
|
item::reweight_all_children as an API and write a test for it. Work
in progress on #1914.
|
|
|
|
found in the search results. Fixes #1923.
|
|
|
|
|
|
Fixes #1818.
|
|
Fixes #1812.
|
|
|
|
1) Move the display context code into the controller themselves so that it's
more logically a continuation callback from the original controller
rendering code.
2) Simplify the display context set/get code and put it in the item helper,
it's just a couple of lines of code now.
3) Add more descriptive breadcrumb strings
|
|
to see if the transliteration module is available and use a more complex
transliteration if possible. Fixes #1668.
|
|
|
|
|
|
the viewable() method on every query.
|
|
|
|
and only fall back the name/level comparison if there's no cached
entry. Update tests accordingly.
|
|
|
|
special characters in the file name ("+" is an edge case differentiator
between rawurlencode and urlencode).
|
|
|
|
|
|
random::hash()
random::string()
random::percent()
random::int()
So that we don't have lots of different ways to get random values all
over the code. Follow-on to #1527.
|
|
|
|
clean thumbnail; we can just copy it over. Should be a decent perf
improvement in many cases. Fixes ticket #1255.
|
|
see if we're deleting the album we're inside in quick::delete. If we
delete the album we're currently viewing, redirect to the parent.
This fixes ticket #1185.
|
|
the end which triggers .gallery_show_loading(). Not a complete fix
for #817 but it's a start and it takes care of one place where we have
a long running process.
|
|
item::move(source, target) helper when the parent member has changed.
Using the move method insures that names and slugs that could conflict
in the target album are resolved properly. Changed the item::move
method so it returns a message to be displayed if the caller chooses.
And changed the move controller to display the message returned by the
move if the item name was renamed as part of the move."
Rolling this back for a couple of reasons:
1) Bug in move.php ("message.info" is not a function name)
2) Having the message come back from the API call as a side-effect is
sloppy. We should find a cleaner way to do this checking.
3) having item::move() call save() on any changed values in the ORM
is counter-intuitive. Move should move, save should save.
I think the right approach here is to roll the move() code properly into
save().
This reverts commit 2492280cc0ec9eb64a8daeccc7b5698ece7fea66.
|
|
method, which encapsulates saving an item and handling name and slug
conflicts. Call this instead of doing a save directly."
Rolled this back because it fails KISS. We already have an API for
saving models with Item_Model::save() that's consistent with all of
our other model code. Adding a new way to save items is confusing and
inconsistent.
This reverts commit 9504f71efcadc7ed27f6f09e5d663e8025bf3b86.
|
|
encapsulates saving an item and handling name and slug conflicts. Call this instead of doing a save directly.
|
|
target) helper when the parent member has changed. Using the move method insures that names and slugs that could conflict in the target album are resolved properly. Changed the item::move method so it returns a message to be displayed if the caller chooses. And changed the move controller to display the message returned by the move if the item name was renamed as part of the move.
|
|
|
|
it's returning a query, so the caller can add the where clause
himself. This makes for a cleaner API.
|
|
|
|
move photos. Fixes ticket #957.
|
|
1) Don't call ORM_MPTT::move_to() directly. Use the new
model-based-validation approach of changing the parent_id and saving.
2) Item_Model::parent() can return null; check for it.
|
|
permissions for it.
|
|
now only Albums_Controller::update() supports the pattern. All
form and controller based validation happening when editing an
album has been moved over.
Model based validation means that our REST controllers share the
same validation as web controllers. We'll have consistency
enforced at the model level, which is a Good Thing.
The basic pattern is now:
1) Rules are in the model
2) ORM::validate() (which is called by ORM::save() but you can
call it directly, too) checks the model for all the rules and
throws an ORM_Validation_Exception if there are failures
3) Actions are no longer taken when you call Item_Model::__set().
Instead, they're all queued up and executed when you call
Item_Model::save().
Notes:
- item::validate_xxx() functions are now in Item_Model::
- We still call $form->validate() because the form can have
rules (and forms triggered by events will likely continue to
have rules.
|
|
choosing a random image is essentially a function on an item collection.
Also implemented a bunch of other query filters for item collections.
Created item::random_query() as a way of generating a reasonable
starting point for random queries.
|
|
|
|
|
|
refactoring for check for commits
|
|
converting the rest API to Kohana 2.4
|
|
|
|
Conflicts:
modules/gallery/controllers/albums.php
modules/gallery/controllers/movies.php
modules/gallery/controllers/photos.php
|
|
or_where() for compatibility and convenience. Caught by failing unit
tests.
|