Bharat Mediratta
71a8375554
Whitespace.
2010-01-18 22:52:58 -08:00
Bharat Mediratta
dc570aaca9
Switch from ORM_MPTT::$db_builder to db::build().
2010-01-18 22:52:23 -08:00
Bharat Mediratta
efa4e230da
in move_to(), move the lock to before we do any calculations so that we have the latest data.
2010-01-18 21:40:00 -08:00
Bharat Mediratta
f20fa2cfed
Change IdentityProvider::create_user() to take $email as well, since that's a required
...
parameter for the Gallery driver.
2010-01-17 20:37:25 -08:00
Bharat Mediratta
f0a290fc76
If we call original() and there's no $original yet, then consider this
...
to be the original. That should be safe because we're already
guarding __set, __unset and save.
2010-01-17 13:29:36 -08:00
Bharat Mediratta
39ad9fa9a0
Get rid of add_rules_from() -- it's no longer necessary now that we're doing model based validation.
2010-01-16 21:25:17 -08:00
Bharat Mediratta
434d351b2f
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
...
Conflicts:
modules/gallery/models/item.php
2010-01-16 00:15:23 -08:00
Bharat Mediratta
00c73a4b07
Revert "Fix for ticket #978 . Don't reset the original property as part of the save processing, because that will overwrite the original values with all the new values. The problem with the original approach is that when changed event handlers used ->original(), it had already been reset as part of the save processing. Went back and forth on either leaving this alone and forcing callers to save the original prior to calling the save function, but there were a few event handlers that used ->original(). This seemed the easier change. So to reset the original you need to call reload() or clear(). There is now an optional parameter on the reload to only reload the original."
...
This reverts commit daeaca110d .
2010-01-15 23:53:43 -08:00
Bharat Mediratta
99073c3e20
Revert "Did the old commit then save trick"
...
This reverts commit e41ad23a8e .
2010-01-15 23:53:35 -08:00
Bharat Mediratta
916da15cbb
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
2010-01-15 13:36:16 -08:00
Bharat Mediratta
1066e64354
Call parent::save() before releasing the lock to make creating the hole and filling it an atomic operation.
2010-01-15 12:41:22 -08:00
Bharat Mediratta
50e3cc5837
Move model business logic out of album::create() and into
...
Item_Model::save(). This makes creating albums similar to editing
them and makes it difficult to create an album poorly. I expect to be
able to remove a lot of code from the photo and movie helper because
it's duplicated here.
In order to do this, I refactored ORM_MPTT::add_to_parent() into
ORM_MPTT::save() so we now add it to the parent when we do save. This
allows us to call save() only once which saves a database call per
add.
The Albums_Controller logic is roughly the same as before.
Haven't updated the tests yet, they're going to fail miserably since
many of them depend on album::create() which is now gone.
2010-01-15 12:15:20 -08:00
Tim Almdal
e41ad23a8e
Did the old commit then save trick
2010-01-13 11:47:27 -08:00
Tim Almdal
daeaca110d
Fix for ticket #978 . Don't reset the original property as part of the save processing, because that will overwrite the original values with all the new values. The problem with the original approach is that when changed event handlers used ->original(), it had already been reset as part of the save processing. Went back and forth on either leaving this alone and forcing callers to save the original prior to calling the save function, but there were a few event handlers that used ->original(). This seemed the easier change. So to reset the original you need to call reload() or clear(). There is now an optional parameter on the reload to only reload the original.
2010-01-13 11:27:09 -08:00
Bharat Mediratta
5a8d48a869
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
2010-01-08 15:37:24 -08:00
Bharat Mediratta
ad3e003e48
Remove stray semicolons.
2010-01-08 14:04:41 -08:00
Tim Almdal
bd9f945e3f
Remove the display of the "body_attributes" div when in debug mode. debug mode is by default set up to add new div's to display the location of the content. "body_attributes" are attributes on the body tag and trying to add content introduces an extra > in the html stream.
2010-01-08 12:49:16 -08:00
Bharat Mediratta
3fc6dab7ac
Expect merge_where and merge_or_where to handle empty tuples.
2010-01-08 11:49:01 -08:00
Bharat Mediratta
fc5d1e5d74
Fix a bug where we weren't replacing table names when there's no
...
prefix. This is wrong because even when there's no prefix we have to
get rid of the {curly} braces.
2009-12-27 12:41:52 -08:00
Bharat Mediratta
63fd9622c0
Don't use as_array() on the result from db::build()->execute() -- it's no longer necessary.
2009-12-22 16:50:15 -08:00
Bharat Mediratta
a6da027aad
The default value for $offset should always be null (according to the
...
new K24 ORM).
Fix up a bad where tuple in the test.
2009-12-22 16:22:24 -08:00
Bharat Mediratta
8b9a02084a
Updates for the latest version of Kohana 2.4:
...
1) Controller::$input is gone -- use Input::instance() now
2) Handle new 'database.<default>.connection.params' parameter
3) Handle new 'cache.<default>.prefix' parameter
2009-12-21 21:27:43 -08:00
Bharat Mediratta
5df1dc135b
Fix some bugs in the cache database driver, and update the tests for K24.
2009-12-21 12:13:25 -08:00
Bharat Mediratta
0cd03c8883
Add Database::set_default_instance() for tests
2009-12-21 11:30:26 -08:00
Bharat Mediratta
2aba8c4bff
Simplify add_table_prefixes. In Kohana 2.4, it returns the bare table
...
name, not the prefixed one so this makes our logic easier.
2009-12-17 21:05:47 -08:00
Bharat Mediratta
c22bf27cc2
Add the current file/line at the top of the trace.
2009-12-06 21:02:30 -08:00
Bharat Mediratta
2be72bb1c3
Overload Kohana_Exception::text() to dump out the complete stack trace
...
so that we have useful data in the logs.
2009-12-06 20:42:38 -08:00
Bharat Mediratta
112aafe513
Oops, removed the overload for query() before, we need this back so
...
that we can prefix table names properly.
2009-12-06 19:51:00 -08:00
Bharat Mediratta
62693db037
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
2009-12-05 17:56:31 -08:00
Bharat Mediratta
5c107be903
Reload relevant models after acquiring a lock so that we don't make
...
database calls based on obsolete data, which can lead to data corruption.
Fixes ticket #926 .
2009-12-04 11:13:20 -08:00
Bharat Mediratta
c9e6869c68
Rename the "upload_limit" variable to "simultaneous_upload_limit" for
...
clarity, since it only limits concurrency not the number of actual uploads.
Move the default-setting code into the upgrader so that we avoid
creating the variable as a side-effect of the view (personal
preference to avoid side-effect code since it's led to problems in the
past).
2009-12-02 19:08:13 -08:00
Tim Almdal
1ab8ac305b
Allow users to override the number of simulatenous uploads. This setting won't appear until after they have attempted to upload at least once and have issues.
2009-12-02 12:09:34 -08:00
Bharat Mediratta
87bc32345f
Use select() instead of select("*")
2009-12-02 10:42:49 -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
3f63e1c521
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
...
Conflicts:
modules/gallery/helpers/theme.php
modules/gallery/libraries/Admin_View.php
modules/gallery/libraries/Theme_View.php
2009-11-29 02:45:39 -08:00
Bharat Mediratta
3d4672ba88
Give the theme a chance to handle theme function callbacks as well.
2009-11-28 23:48:38 -08:00
Bharat Mediratta
22149b52c3
Move the theme fallback checking into theme::load_themes() so that
...
we're calling it once per request.
2009-11-27 17:12:13 -08:00
Bharat Mediratta
96b00d6cfe
Convert some more Database::instance() calls to db::build() form.
2009-11-26 21:14:54 -08:00
Bharat Mediratta
a3d904bcba
ORM::find_all() now uses null as the default value for offset.
2009-11-26 19:36:57 -08:00
Bharat Mediratta
54be15191b
Overload Database_Builder to add merge_where() which takes predefined
...
where clauses and adds them to the existing query. Update all
existing queries that take an additional where clause to use it.
2009-11-26 18:47:40 -08:00
Bharat Mediratta
1fd0e14359
Convert all DB where() calls to take 3 arguments.
...
Convert all open_paren() calls to and_open() or or_open() as appropriate.
2009-11-26 12:09:04 -08:00
Bharat Mediratta
2ee38b3d8e
ORM::$rules now has a special meaning. Use $form_rules for our
...
internal rules code.
2009-11-26 11:36:09 -08:00
Bharat Mediratta
4b2e1344b4
Move the CSRF initialization into the constructor, I don't see why we
...
need it also in render().
2009-11-25 20:05:38 -08:00
Bharat Mediratta
ccb0ea3d30
Make globals work if you access the the variables directly with
...
$v->foo instead of doing it in a rendered template.
2009-11-25 19:24:50 -08:00
Bharat Mediratta
7eacc465d5
Fix set_global() to be more elegant and preserve local trumping
2009-11-25 14:50:29 -08:00
Bharat Mediratta
daedadda75
Switch from stdClass to arrays for global data.
2009-11-25 14:27:06 -08:00
Bharat Mediratta
7c9bd9e8e8
Call execute() after upate() and insert().
2009-11-25 13:59:01 -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
Bharat Mediratta
01e10d1708
K2.4 has its own parentheses support
2009-11-24 19:24:38 -08:00
Bharat Mediratta
3ed7a5af46
Rename I18n to Gallery_I18n to avoid conflict with Kohana 2.4
2009-11-24 19:24:02 -08:00