Use the item_created event instead of add_photos_form_completed. Also, fix up the installer to upgrade the module to version 2.
This commit is contained in:
parent
daf1d8a66c
commit
8161f72f6b
|
@ -21,7 +21,7 @@ class autorotate_event_Core {
|
||||||
// The assumption is that the exception was logged at a lower level, but we
|
// The assumption is that the exception was logged at a lower level, but we
|
||||||
// don't want to screw up the processing that was generating the notification
|
// don't want to screw up the processing that was generating the notification
|
||||||
// so we don't pass the exception up the call stack
|
// so we don't pass the exception up the call stack
|
||||||
static function add_photos_form_completed($item, $form) {
|
static function item_created($item) {
|
||||||
try {
|
try {
|
||||||
autorotate::rotate_item($item);
|
autorotate::rotate_item($item);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
|
@ -19,12 +19,12 @@
|
||||||
*/
|
*/
|
||||||
class autorotate_installer {
|
class autorotate_installer {
|
||||||
static function install() {
|
static function install() {
|
||||||
module::set_version("autorotate", 1);
|
module::set_version("autorotate", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function upgrade($version) {
|
static function upgrade($version) {
|
||||||
if ($version == 1) {
|
if ($version == 1) {
|
||||||
module::set_version("autorotate", $version = 1);
|
module::set_version("autorotate", $version = 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user