Commit Graph

66 Commits

Author SHA1 Message Date
Bharat Mediratta
4828db003f Remove 'ENGINE=InnoDB' specification from tables that we create. Use
the system's default table specification.  Fixes ticket #597.
2009-08-27 15:47:54 -07:00
Bharat Mediratta
7863aa16f9 Update tags module to notify modules when items related to a tag are
affected.  Practically speaking this means that we'll reindex items
when tags are added or removed from them.

API change:
  Remove item_related_updated_batch event.

Rationale:
  While this is an efficient event, it requires module developers to
  support two event APIs for staying up to date and increases the
  likelihood that they'll forget one and have data corruption.  Force
  them all through the slower but more reliable pipe, for now.  We
  can always try to improve efficiency by using the batch_start and
  batch_stop events.
2009-08-08 14:30:21 -07:00
Bharat Mediratta
7ad0808a11 Change the API for getting to the original state of an ORM.
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 }
2009-08-02 12:09:00 -07:00
Tim Almdal
eb90fc9e63 Remove debugging print statement in search.php
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-07-30 01:32:24 +08:00
Bharat Mediratta
44bc74edb9 Change search callbacks to use the event system, so move them out of
xxx_search helpers and into xxx_event helpers.
2009-07-28 20:30:34 -07:00
Romain LE DISEZ
350c1b0267 Use BOOLEAN instead of integer to describe the permissions :
- DENY = false
 - ALLOW = true
 - UNKNOW = null  (for intent only)
 - INHERIT = null (for cache)

Upgrade is not included for now.
(cherry picked from commit 719c59e040)
2009-07-23 09:11:55 -07:00
Bharat Mediratta
788a458a11 Remove success logging. Only log on errors, otherwise the log is huge. 2009-07-19 13:43:06 -07:00
Bharat Mediratta
5b3b675b6d Non-trivial changes to the event handling code:
1) The item_updated event no longer takes the old and new items.
   Instead we overload ORM to track the original data and make
   that available via the item.  This will allow us to move event
   publishing down into the API methods which in turn will give us
   more stability since we won't require each controller to remember
   to do it.

2) ORM class now tracks the original values.  It doesn't track
   the original relationships (no need for that, yet)

3) Added new events:
     item_deleted
     group_deleted
     user_deleted
2009-07-16 11:19:34 -07:00
Bharat Mediratta
e2a9a1d284 Add quotes around all values that contain spaces in them, and add a
test to make sure that we continue to do so.

This makes sure that we don't have problems with 5.3 which treats the
literal "on" as a boolean.
2009-07-13 10:36:55 -07:00
Tim Almdal
863deab3d3 Fix a bug where the task message was not being set 2009-07-10 12:54:25 -07:00
Tim Almdal
e7e2d99255 Revert "Revert "Add task logging to the "Update Search Index" task""
This reverts commit 5118afc959.
2009-07-09 08:43:42 -07:00
Tim Almdal
5118afc959 Revert "Add task logging to the "Update Search Index" task"
This reverts commit 6ac5238b83.
2009-07-09 08:39:00 -07:00
Tim Almdal
6ac5238b83 Add task logging to the "Update Search Index" task 2009-07-08 09:27:37 -07:00
Tim Almdal
e5cd7052e8 Revert "Forgot this when i was cleaning up for ticket #519"
This reverts commit 31969a1d82.
2009-07-07 12:25:19 -07:00
Tim Almdal
31969a1d82 Forgot this when i was cleaning up for ticket #519 2009-07-07 12:09:55 -07:00
Tim Almdal
d6648c0aff Fix for ticket #477. Use nl2br method when rendering comment::text and
item::description.  In addition add p::clean or p::purify to places that
xss cleaning had missed (i.e. rss feeds)
2009-07-04 08:17:12 -07:00
Tim Almdal
54ffea2419 Split the clean method into two clean and purify. clean is a light weight
approach using html::specialchars and purify uses HTMLPurifier to intelligently
cleanse the output fields. Use purifier for text and title fields where it is
likely that a user would enter html to format their data.
2009-07-03 21:44:10 -07:00
Romain LE DISEZ
da09185a4b SQL is case insensitive
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-06-24 06:05:56 +08:00
Romain LE DISEZ
297ac6ebd1 Improve compatibility with other RDBMS
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-06-24 06:05:48 +08:00
Bharat Mediratta
bfca0c7903 Refactor the install/upgrade code to be more flexible.
Add xxx_installer::upgrade($version) method so that upgrade stanzas
are separate from install stanzas.  In the old code, to do an upgrade
meant that you had to re-evolve everything from the initial install
because we'd step through each version's changes.  But what we really
want is for the initial install to start off in the perfect initial
state, and the upgrades to do the work behind the scenes.  So now the
install() function gets things set up properly the first time, and the
upgrade() function does any work to catch you up to the latest code.
See gallery_installer.php for a good example.
2009-06-23 12:00:49 -07:00
Tim Almdal
0f987880e6 Fix for ticket #320 2009-06-02 12:08:47 -07:00
Bharat Mediratta
708f27f483 Run p::clean() on any variables that contain data entered by users. 2009-05-31 00:11:48 -07:00
Bharat Mediratta
88a3d43ba9 Update all references to the core application to now point to the
gallery module.  This type of mass update is prone to some small bugs.
2009-05-27 16:17:29 -07:00
Bharat Mediratta
7e5e70548b clean up whitespace errors introduced in last commit 2009-05-26 06:01:04 +00:00
Bharat Mediratta
7aed923908 Restructure the module lifecycle.
Install: <module>_installer::install() is called, any necessary tables
are created.

Activate: <module>_installer::activate() is called.  Module
controllers are routable, helpers are accessible, etc.  The module is
in use.

Deactivate: <module>_installer::deactivate() is called.  Module code
is not accessible or routable.  Module is *not* in use, but its tables
are still around.

Uninstall: <module>_installer::uninstall() is called.  Module is
completely removed from the database.

Admin > Modules will install and activate modules, but will only
deactivate (will NOT uninstall modules).
2009-05-26 05:28:59 +00:00
Bharat Mediratta
774e0b3737 Avoid complex inserts in available_tasks() to make admin/maintenance
run faster.  This fixes ticket #235.

Incidentally, refactor exif and search to use the same patterns
overall so that if you understand one, you understand the other and
they generally use the same strings for localization.
2009-05-20 06:10:14 +00:00
Bharat Mediratta
5495037a3d Gee it's May already. Update copyright to 2009. 2009-05-13 20:04:58 +00:00
Bharat Mediratta
8b33371e99 Index photos as they're added 2009-05-11 05:18:23 +00:00
Bharat Mediratta
cc0fcc8961 Use a clearer query syntax for deleting extra search and exif records (thanks Romain LE DISEZ) 2009-05-10 18:44:03 +00:00
Tim Almdal
0fdc4639c3 Remove duplicate word from status message 2009-04-21 14:41:06 +00:00
Bharat Mediratta
6c911d2d7c Make the task iteration duration 1 second instead of 500ms. 2009-04-21 04:16:30 +00:00
Bharat Mediratta
ace6335e64 Add a key on item_id for the search_records table so that when we left
join it against the item table to find missing ids it's fast.
2009-04-21 03:12:14 +00:00
Bharat Mediratta
1d6554764c Make the update_index task continue until it has used half a second
before stopping.  This is *way* more efficient than just doing 2 per
request.
2009-04-17 10:02:13 +00:00
Bharat Mediratta
d7719a7e72 Gracefully deal with the case where we resume a stalled task but there
was no work left to be done.  This fixes a divide by zero error.
2009-03-26 20:26:06 +00:00
Andy Staudacher
ed7175092c Refactor all translation strings that have ambiguous placeholders.
E.g. "%link_startClick here%link_end" is now '<a href="%url">Click here</a>'.

Note: This isn't always the best solution. E.g. consider "Foo <a href='%url' class='gDialogLink'>bar</a>." Now the translator has to deal with 
preserving CSS classes too...
2009-03-21 07:44:46 +00:00
Tim Almdal
938bca7601 Remove back ticks from sql 2009-03-18 03:35:08 +00:00
Tim Almdal
8e1817d4e4 Couple of sql statements that had incorrect prefix handling or no
prefix handling.
2009-03-18 01:20:30 +00:00
Tim Almdal
7dae7dc510 Strip down the loin page (not sure if this is what bharat had in mind) 2009-03-12 03:54:17 +00:00
Bharat Mediratta
f32f1697c9 Get rid of Task_Definition types: they're not necessary. This
incidentally fixes the the problem that admin/maintenance tasks have
been broken.
2009-03-09 07:02:09 +00:00
Bharat Mediratta
23937ff135 Avoid using default task types. Require task::get_definitions() to
specify a single type and ask for it appropriately in
admin_maintenance.  Specify a type for every existing task.
2009-03-05 06:38:11 +00:00
Tim Almdal
7bcab31f5d Fix issue identified by security review... some table names where not
being translated.
2009-03-03 03:52:21 +00:00
Tim Almdal
c04ff8e02f Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
2009-02-28 06:37:28 +00:00
Tim Almdal
bd15853708 This implements table prefix for all the queries in core, user, exif,
tag, search, comment and notification modules (Ticket #68)
2009-02-27 21:07:18 +00:00
Chad Kieffer
5dad40b1ae Ticket #2. Tighten up search results UI. 2009-02-13 03:21:19 +00:00
Tim Almdal
0836f507f2 Corrected indentation 2009-02-12 16:17:20 +00:00
Tim Almdal
2df75c11fb Correct typo in variable name 2009-02-12 14:02:11 +00:00
Chad Kieffer
67d551d5e3 jQuery-based buttons! Form updates, short form updates. Need to fix add user/group buttons and search form on search results page. 2009-02-06 06:34:47 +00:00
Tim Almdal
a70f3bf386 Have the quick delete file "item_before_delete" so that search and
notification modules can do their thing.  In addition, correct search
so it works properly and doesn't try to create an Item_id_Model class.
2009-02-02 04:58:19 +00:00
Bharat Mediratta
51f13f0ca2 Reconcile search_records and items when we list the tasks so that we can tell if there're any out of date records that need updating 2009-02-02 01:24:13 +00:00
Bharat Mediratta
d728e274f6 First time running search maintenance task, remove any search_records
that are missing matching items.
2009-02-02 01:13:52 +00:00