| Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
"=", NULL) which would never find any. It should have been ->where(, "is", NULL)
|
|
|
|
Fixes ticket #916.
|
|
new K24 ORM).
Fix up a bad where tuple in the test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
where clauses and adds them to the existing query. Update all
existing queries that take an additional where clause to use it.
|
|
Convert all open_paren() calls to and_open() or or_open() as appropriate.
|
|
internal rules code.
|
|
|
|
- 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
|
|
orders.
|
|
Was also able to remove the sub-select from the calculation of the current position as we already have the child item containing the sort column value.
Also added a where clause that ignores albums to the get_position, children and children_count method calls in photos.php and movies.php
|
|
|
|
in Item_Model when creating the relative_path_cache.
|
|
to file paths and they are converted back in the file proxy. Fixes ticket #812
|
|
|
|
exist. fixes ticket #694
|
|
Create a helper class called identity to simplify call the Identity Provider. Move the contents of MY_Session.php to the new helper class and remove the MY_Session class
|
|
and group.php. Tried creating a identity helper, but the helper identity.php was confused with the library Identity.php. So got around this by making the methods on Identity static and calling the instance within the static methods. Also temporarily moved the user.php and group.php back into the user module.
|
|
user::lookup_by_name and user_lookup API methods.
Convert the Admin_User controller
Convert the login and password change controller
Change the item model to call user::lookup to get the owner.
On the log model, delete the relationship between the log and user table, and replace with a
call to user::lookup
(cherry picked from commit 194cc3b27a73afe5119da9f09407c1e068dc6fa3)
Create the get_user_list, lookup_by_name, lookup_by_hash and get_group_list api functions
|
|
Make the filename field required for photos/movies.
Fixes ticket #838
|
|
|
|
writes and saves later.
Convert the Admin_User controller
Convert the login and password change controller
Change the item model to call user::lookup to get the owner.
On the log model, delete the relationship between the log and user table, and replace with a
call to user::lookup
|
|
shared images from wind to lib. Deleted unused images in the admin_wind. This will likely break a few ajax features.
|
|
Conflicts:
modules/gallery/controllers/albums.php
|
|
nulls. This time around, do a query to determine whether or not the
sort column has nulls in it. If it doesn't, then use our comparators
as before.
There are NULLs in the sort column, so we can't use MySQL comparators.
Fall back to iterating over every child row to get to the current one.
This can be wildly inefficient for really large albums, but it should
be a rare case that the user is sorting an album with null values in
the sort column.
Fixes #627
|
|
row has a null value in the sort field. Fix for #627
Note: this changes get_position() to take an Item_Model instead of an id!
|
|
relative_url_cache so that they're safe for browser use.
|
|
urlencoded data for ease of use when we're dealing with the data.
This fixes ticket #569 by not allowing the urls that we put into our
RSS feeds to have bad characters in them.
We have to convert a path like var/albums/foo/"quotes"/bar.jpg into
something like var/albums/foo/%22quotes%22/bar.jpg. If we take the
approach of storing native data in the cache, then we have to explode
the path, urlencode the bits, and implode it again to avoid escaping
the / char. By storing it escaped, we avoid this problem. I believe
(but have not tested) that this is more efficient.
|
|
|
|
we're not relying on overriding url::site() to do tricks around item
urls. This means that you won't get item urls by doing
url::site("albums/37"), for example, but it also means that we won't
get pretty urls where we don't expect them (like in the action of a
<form> element).
Incidentally, this will help us move over to using the slug format
because if you've got a bad character in a url, the edit forms will
now work on it since they'll be id based.
|
|
insignificant, in addition to the view_count field. This means that
we won't trigger an event, nor will we adjust the updated field if
*only* those fields are changed.
|
|
2. Fix up an issue where we were crashing if there were no conflicting rows
3. Amend Item_Model so that if you change the slug, it flushes the cache
for all children
|
|
methods actually refer to the url to the file on disk, not the logical
item. That's relative_url(). Perhaps some API renaming is in order?
|
|
component for that given item. Album hierarchies are represented by
nested slugs. By default, we convert the filename to a slug when you
create an album, photo or movie.
|
|
it twice on both sides of a ternary operator.
|
|
is not working.
|
|
helper, so that we can use it else where (i.e. the new organize module)
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
|
|
remove Gallery3 concepts from ORM_MPTT.
The following API methods:
ORM_MPTT::children
ORM_MPTT::children_count
ORM_MPTT::descendants
ORM_MPTT::descendants_count
All now take a $where clause that allow you to pass through additional
field parameters.
old API:
$album->children(10, 0, "photos")
$album->children_count("photos")
new API:
$album->children(10, 0, array("type" => "photos"))
$album->children_count(array("type" => "photos"))
This gives us a more flexible API and simplifies the code. While I
was in there, I changed the way we deal with default orderby values so
that we just assign the default value in the function definition,
which allows us to get rid of all conditionals in the implementation
which results in simpler code.
|
|
specify a type parameter, so tht we can filter the children based
on type (i.e. album, photo, etc).
In addition, expose the sort order, so that we can specify the order
we want to return the children.
|
|
Old API: $obj->original("field_name")
New API: $obj->original()->field_name
This allows us to revert the varous xxx_updated events back to passing
an original ORM as well as the the updated one. This makes for a
cleaner event API.
Old API: comment_updated($comment) { $comment->original("field_name") }
Old API: comment_updated($old, $new) { $old->field_name }
|
|
we're doing an initial install.
|
|
but change it to use Database instead of ORM for a little more
efficiency.
|