Commit Graph

52 Commits

Author SHA1 Message Date
bwdutton
cdc4e97c7e Make queries work with sql_mode = 'ONLY_FULL_GROUP_BY' enabled in mysql 2018-02-25 10:14:30 -08:00
shadlaws
6f922ca427 Follow-on to #2069 - Decrease stack size of MPTT rebuild task.
This reduces the likelihood that we'll hit a limit with gargantuan galleries.

--HG--
extra : source : c4a118d43145a2a4ec9b934d3aebe8f9458bcf07
2013-05-15 11:16:46 +02:00
shadlaws
2ebe38b148 #2069 - Change "Fix your Gallery" task go faster and be more comprehensive.
- optimize MPTT pointer rebuilding for leaf nodes (i.e. non-albums).
- reverse order_by to try and preserve existing tree ordering.
- reset item level while we're here.
- use "$stack[] = 123" instead of array_push($stack, 123) since it's faster.

--HG--
extra : source : 297e4c0eccc5a7940224ff8e908b366e83017354
2013-05-14 13:35:09 +02:00
Bharat Mediratta
96ad7789c8 Follow-on to 7bdccade98 to exclude
directories for now.
2013-02-15 19:17:34 -05:00
Bharat Mediratta
0dd12caa6f Follow-on to 7bdccade98 - point out that there's
duplicated code in gallery_event.
2013-02-15 19:12:08 -05:00
Bharat Mediratta
b06c0f4890 Merge pull request #104 from shadlaws/fix_1966
#1966 - "Fix your Gallery" shows 60/59 items completed.
2013-01-26 11:00:56 -08:00
shadlaws
603db40459 #1966 - "Fix your Gallery" shows 60/59 items completed.
- Fixed counter in gallery_task::fix that was often one too many.

For FIX_STATE_RUN_MISSING_ACCESS_CACHES, changed this:
$stack = explode(" ", $task->get("stack"));
To this:
$stack = array_filter(explode(" ", $task->get("stack")));
2013-01-26 09:08:03 +01:00
shadlaws
cc2aed656c #1946, 1947 - Make altered names/slugs more user-friendly, make 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.
2013-01-26 08:38:31 +01:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
a98afdb32c Refill the path and url caches in the item model at the end of this task. Fixes #1896. 2012-07-21 11:12:51 -07:00
Bharat Mediratta
f9e77c4c14 Fix the access_cache rebuilding code to not load all missing access caches into the stack, if you're missing
enough it'll blow the stack (like, if you truncate the access_caches table).  Fixes #1895.
2012-07-21 10:38:23 -07:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
065dd32f31 Add tags for all Cache::instance()->set calls that don't have one.
Fixes #1818.
2012-02-06 19:48:52 -08:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
b42fcb9cda Use db::expr instead of "new Database_Expression". Resolves #1560. 2010-12-28 23:10:05 -08:00
Bharat Mediratta
5f4ab7fd76 Shuffle up the way we figure out which image to rebuild next so that
multiple concurrent tasks actually work in parallel and don't stomp
on each other.  Fixes #1498.
2010-11-21 13:03:02 -08:00
Bharat Mediratta
a153ca0829 Detect the case where there are no more broken images and skip to the end. Fixes #1414. 2010-10-02 17:04:37 -07:00
Bharat Mediratta
1a0d76c43e When moving a single item, just copy its permissions from its parent
album.  This is totally legal since an items permissions must be the
same as its parent's, and it's much faster for large installs where
a complete recalculation can be very costly.  Should fix #1360.
2010-09-13 22:23:09 -07:00
Bharat Mediratta
a98841613a LOWER() the slug and name in the find_dupes functions since DISTINCT
is case sensitive, but our dupe validation is not.  Fixes ticket #1367.
2010-09-12 14:30:25 -07:00
Bharat Mediratta
2c717b18d3 Don't concatenate two strings together as an argument for t() or t2();
the l10n_scanner cannot parse it properly and drops those from the
localization list.  Fixes ticket #1284.
2010-08-29 20:04:02 -07:00
Bharat Mediratta
d9f8c8a295 Rebuild access_caches rows if they're missing, as necessary. Fixes ticket #1289. 2010-08-14 14:56:28 -07:00
Bharat Mediratta
8559cdb5b6 Add docs reflecting that we may skip some items that have invalid parent_ids 2010-08-04 21:30:48 -07:00
Bharat Mediratta
ca54cdd644 While we're cleaning up albums, also find any cases where we have an
album_cover_item_id that points to an invalid item.
2010-08-01 21:44:24 -07:00
Bharat Mediratta
c33b24c9fa Make maintenance mode a variable instead of a config. Then create
links on the Admin > Maintenance page to allow you to turn it on and
off.  This should be efficient since we cache all vars and look them
up on every request anyway.

This also allows us to have the Fix task enable maintenance mode while
it's running which greatly reduces the chances that somebody will come
along and hork the database while we're tinkering with MPTT pointers.

Fixes ticket #1259.
2010-08-01 21:00:30 -07:00
Bharat Mediratta
7b8ed10796 Add recovery code for dupe slugs and dupe names to the general purpose Fix
task.  Fixes ticket #1260.
2010-07-29 21:49:29 -07:00
Bharat Mediratta
b3c1b4633c Combine the Fix MPTT and Fix Permissions tasks into one magical fix-it
task.
2010-07-28 22:42:04 -07:00
Bharat Mediratta
5be9ae3250 Add a new maintenance task that resyncs album .htaccess files with
database access intents.  Use this to fix up .htaccess files after you
relocate your Gallery. Fixes ticket #1252.
2010-07-25 11:10:42 -07:00
Bharat Mediratta
2cf5198353 Null out relative_path_cache and relative_url_cache after we update
the pointers in case the hierarchy was adversely affected by actions
when the MPTT pointers were desynced.  Fixes ticket #1235.
2010-07-21 11:34:19 -07:00
Bharat Mediratta
2657d08586 Move the "Fix MPTT" task from the rescue module into the main Gallery
module.
2010-04-04 14:46:44 -07:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Andy Staudacher
334cd2368d Performance improvement: Load all translations of a locale as one serialized array from the Cache.
Until now, we loaded hundreds of translation messages row by row, and unserializing one by one at bootstrap time. That amounted to a significant percentage of the complete request time. This approach is more than 10x faster.
2010-02-21 23:50:01 -08:00
Tim Almdal
43985ea2fb Update the description to reflect we are only removing "expired" files. 2010-02-01 08:35:23 -08:00
Tim Almdal
64e014203c Correct the internationalization of the status message. 2010-02-01 08:15:49 -08:00
Bharat Mediratta
c050acf30a Fix lots of warnings that pop up when we're in E_STRICT mode. They're
mostly issues around uninitialized variables, calling non-static
functions in a static context, calling Session functions directly
instead of on its singleton, passing non-variables by reference, and
subclasses not using the same interface as the parent class.
2010-01-31 16:07:41 -08:00
Bharat Mediratta
cfbbf9ef60 Convert __toString() to use (string) cast instead. 2010-01-27 21:58:06 -08:00
Tim Almdal
accd00464e Add a maintenance task that will clear the expired files (older than 2 weeks) from var/logs and var/tmp. Fixes ticket #982 2010-01-26 07:03:14 -08:00
Andy Staudacher
120c9c749e Change "fetch translations" task to fetch them in batches.
The request limit was in place already, but the client didn't respect it before, leading to unhappy users in case they had lots of 3rd party modules installed, or more than 2-3 locales enabled. This is all taken care of now.
2010-01-22 01:16:16 -08:00
Bharat Mediratta
d2cb217e20 Convert more database calls over to the new format
- admin/maintenance page loads, the rebuild thumbs/resizes task works
- Fixed up some conversion bugs in the Cache driver
2009-12-02 00:34:34 -08:00
Bharat Mediratta
2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Tim Almdal
bf4c518bb5 Store the directory, files and translation cache in the gallery3 cache instead of trying to store it in the task. It is possible with lots of modules and lots of incoming translations to go beyond the 64K limit in the task context. Possible fix for #886. 2009-11-16 14:25:25 -08:00
Tim Almdal
ca37221337 When rebuilding dirty images, start a batch on initialization and stop it when the task is complete. Fixes ticket #670 2009-10-27 07:35:33 -07:00
Tim Almdal
ab5e680265 Clean up the task initialization for rebuild thumbs and resizes. 2009-09-27 20:31:56 -07:00
Tim Almdal
cd240ebaad Refactored the rebuild_dirty_images handler to simplify the counting and end processing. It was getting all confused with trying to figure out the completed and remaining. Now on initiation it sets the total images that are dirty and then counts the completed until it equals the total, then exits. Fixes ticket #771 2009-09-24 20:06:14 -07:00
Bharat Mediratta
9237ab9bc1 Change graphics::generate() API so that it doesn't return a boolean,
instead it throws an exception if there's a problem.  The normal case
for graphics::generate is that it's going to succeed.  It'll only fail
if something un-handleable went wrong, so just use the resulting
exception.
2009-09-02 15:29:00 -07:00
Andy Staudacher
b9bd1681a3 Update all code to use helper method html::clean(), html::purify(), ... instead of SafeString directly. 2009-08-29 22:54:20 -07:00
Andy Staudacher
c01ac42c46 Refactor all calls of p::clean() to SafeString::of() and p::purify() to SafeString::purify().
Removing any p::clean() calls for arguments to t() and t2() since their args are wrapped in a SafeString anyway.
2009-08-29 12:48:40 -07:00
Bharat Mediratta
b3f91167c1 Remove excess success logging. In the rebuild images case, it can
make a huge log file.  In the l10n_client case, it's not really
necessary to know that level of detail and it makes for a weird API.
2009-07-19 13:55:22 -07:00
Tim Almdal
ac797e609c Add task logging to the Update translations 2009-07-08 09:08:15 -07:00
Tim Almdal
47fbb56fa2 Added task logging to the Rebuild Images task. 2009-07-08 08:22:40 -07:00
Andy Staudacher
fb472da0ba Ignore lib/ folders in l10n_scanner task.
1. Because it makes sense.
2. As a quick fix - For some reason it wouldn't work properly anymore now with the HTMLPurifier lib
2009-07-03 16:11:17 -07:00