Movable Type with Class::Trigger 0.12

| No Comments | No TrackBacks
In developing my extensions, I kept getting the following error:
Got an error: mutiple trigger registration in one add_trigger() call is deprecated. at lib/MT/Entry.pm line 282
Compilation failed in require at lib/MT/Compat/v3.pm line 12.
BEGIN failed--compilation aborted at lib/MT/Compat/v3.pm line 12.
Compilation failed in require at lib/MT.pm line 1210.

The code in MT/Entry.pm is incompatible with Class::Trigger 0.12, which comes with recent versions of perl. If you have set up your paths incorrectly (like $ENV{'MT_HOME'}) or you have plugins that require a version later than the Class::Trigger 0.10 that comes with Movable Type, you will encounter this problem. In my case, I'm linking in external libraries that use the later version.

To fix this, I'm using this patch:
--- lib/MT/Entry.pm     (revision 3196)
+++ lib/MT/Entry.pm     (working copy)
@@ -279,8 +279,12 @@
     );
 }

+# Must use separate statements from Class::Trigger 0.12
 MT::Placement->add_trigger(
     post_save   => \&flush_category_cache,
+);
+
+MT::Placement->add_trigger(
     post_remove => \&flush_category_cache
 );
Issue raised with Six Apart!
http://bugs.movabletype.org/default.asp?85080_etup

No TrackBacks

TrackBack URL: http://www.glorat.net/mt-tb.cgi/7

Leave a comment

About this Entry

This page contains a single entry by Glorat published on November 22, 2008 9:39 PM.

Writing a letter to My Lord was the previous entry in this blog.

Rocket Science Problem is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.21-en