Age | Commit message (Collapse) | Author |
|
In MySQL queries, _ and % characters are treated as wildcards (similar to ? and *, respectively).
- Added escape_for_like function to MY_Database.php
- Added unit test to Database_Test
- Corrected the five unescaped instances in the code using this function.
|
|
|
|
|
|
|
|
|
|
|
|
data_rest::put() altogether; it's no longer necessary.
|
|
Instead of overwriting Kohana_Exception::handle() (which we were doing
in MY_Kohana_Exception) we instead use their existing template system.
gallery/views/kohana/error.php overrides system/views/kohana/error.php
and is the standard error template for all exceptions. Our version of
error.php figures out the appropriate view based on context (cli,
authenticated admin, guest viewing a 404, guest viewing a system
error) and delegates appropriately. Each delegated view has a narrow
responsibility.
This paves the way for us to add new error views per module. For
example, the rest module will define its own template in
Rest_Exception and then its exceptions can be rendered the way that it
wants (json encoded, in that case).
|
|
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.
|
|
to weight.
|
|
itemm::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. Also, only change the weights of the album children if the item sort_column is set to weight."
This reverts commit 603d4640141a43350f50da747d747456b28fdd93.
|
|
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. Also, only change the weights of the album children if the item sort_column is set to weight.
|
|
part of a REST request. Format the exception as a json encoded text string so the client can extract the fault information if they so choose.
|
|
|
|
to $entity based params.
|
|
exception before trying to create the item.
|
|
increment the weight count (even if it is equal to the weight of the current child)
|
|
This makes it consistent to the rest client that collections will have a members element.
|
|
just entity.
TESTS ARE NOT UPDATED YET.
- Fix item_rest::get() to maintain the proper sort order, which
requires duplicating some Item_Model code.
- Elide "weight" from the REST version of item
- Adjust the weight of members according to the order they're returned
from the client. You can't add or remove members here, you can only
reorder them.
- Changed the wire protocol to handle more complex values.
Now "entity" and "members" are JSON encoded. The Gallery3
helper does this correctly.
- Changed the wire protocol for tag_item -- now it stores the
tag and item urls in the entity, not as members. This is more
consistent.
- Added missing security for renaming and deleting tags.
- Got rid of vestigial tag_rest::post(). We add/remove tags
via the relationship.
|
|
|
|
This reverts commit 3439671bcfb99c1884285e4b4e53295f044e688f.
|
|
2) Standardize the structure of members so that client programs can consistently
parse the return information.
3) Added a summary parameter so that client programs can easily determine if the
information returned is summary (item type, item title) or the full meal deal
|
|
|
|
|
|
|
|
resources, but we differentiate resources as collections and entities.
|
|
Don't try to access ORM::$changed -- it's protected.
|
|
relationships. Now when you view a resource, it has 4 top level
elements:
url: the url of this resource
resource: array of key value pairs describing the resource
members: array of urls to members of this collection
relationships: array of array of members.
Relationships are a special type of collection that links two
different resources together. To remove a relationship, just
DELETE its url. To create a relationship, POST to its
collection.
Individual modules can add their own relationships to any
resource via a callback mechanism.
Example:
Array(
[url] => http://g3.com/rest/item/1
[resource] => Array (
[id] => 1
[album_cover_item_id] => 4
[captured] =>
[created] => 1264056417
[description] =>
[height] =>
...
)
[members] => Array(
[0] => http://g3.com/rest/item/2
[1] => http://g3.com/rest/item/3
[2] => http://g3.com/rest/item/4
[3] => http://g3.com/rest/item/5
...
)
[relationships] => Array(
[tags] => Array (
[0] => http://g3.com/rest/tag_item/2,1
[1] => http://g3.com/rest/tag_item/23,1
)
)
)
|