valera

Unknown tag found and run-periodic-tasks script

Vote 0 Votes

Hi,

I have a problem with publish queue and run-periodic-tasks script. When i publish page within edit template - everything ok. But when page is rebuiled by run-periodic-tasks script i see this messege in the logs:

Error rebuilding file /var/www/mov/anekdot/widgets/novinki.html: Publish error in template 'widget novinki': Error in tag: error in module anekdoty list 8: Publish error in template 'anekdoty list 8': Error in tag: Error in tag: error in module mainblock inner: Publish error in template 'mainblock inner': Unknown tag found: AjaxRater

How it is possible and why?

Reported on Movable Type 4.3

10 Replies

| Add a Reply
  • Hi Valera.

    Which plugin are you using? this one?
    http://mt-hacks.com/20070906-ajax-rating-v11-full-support-for-mt4.html

    Anyway, one way that is possible is that the plugin author made this tag application specific by mistake, and not global.
    For being sure, I will need to see the config.yaml file of that plugin.

    Shmuel.

  • Thanks, Shmuel

    It has only one config.yaml in folder "default_templates"

    template_sets:
    ajax_rating_templates:
    index:
    ajax_rating_javascript:
    label: Ajax Rating Javascript
    outfile: ajaxrating.js
    rebuild_me: 0
    ajax_rating_styles:
    label: Ajax Rating Styles
    outfile: ajaxrating.css
    rebuild_me: 0
    widget:
    ajax_rating:
    label: Ajax Rating

    But i found in AjaxRating.pl file :

    MT->add_plugin($plugin);

    if (MT->version_number require MT::Template::Context;
    MT::Template::Context->add_tag(AjaxRating => \&AjaxRating::ajax_rating);
    MT::Template::Context->add_tag(AjaxRatingAverageScore => \&AjaxRating::ajax_rating_avg_score);
    MT::Template::Context->add_tag(AjaxRatingAvgScore => \&AjaxRating::ajax_rating_avg_score);
    MT::Template::Context->add_tag(AjaxRatingTotalScore => \&AjaxRating::ajax_rating_total_score);
    MT::Template::Context->add_tag(AjaxRatingVoteCount => \&AjaxRating::ajax_rating_vote_count);

    MT::Template::Context->add_tag(AjaxRater => \&AjaxRating::rater);
    MT::Template::Context->add_tag(AjaxStarRater => \&AjaxRating::star_rater);
    MT::Template::Context->add_tag(AjaxThumbRater => \&AjaxRating::thumb_rater);
    MT::Template::Context->add_tag(AjaxRaterOnclickJS => \&AjaxRating::rater_onclick_js);

    MT::Template::Context->add_tag(AjaxRatingEntryMax => \&AjaxRating::entry_max);
    MT::Template::Context->add_tag(AjaxStarRaterWidth => \&AjaxRating::star_rater_width);
    MT::Template::Context->add_tag(AjaxStarRaterAverageScoreWidth => \&AjaxRating::star_rater_avg_score_width);
    MT::Template::Context->add_tag(AjaxStarUnitWidth => \&AjaxRating::star_unit_width);

    # Callbacks that remove VoteSummary records when objects get deleted
    MT::Entry->add_callback('pre_remove', 5, $plugin, \&AjaxRating::entry_delete_handler);
    MT::Blog->add_callback('pre_remove', 5, $plugin, \&AjaxRating::blog_delete_handler);

    # Callbacks that change the obj_type column when objects are published or unpublished
    MT::Entry->add_callback('post_save', 5, $plugin, \&AjaxRating::entry_post_save);
    }

  • well, the whole code block that you gave here works only for MT3.
    Can you paste the whole AjaxRating.pl file?

    (maybe using some code pasting site, like http://paste.bradleygill.com/, or use the utility offered above the comment box)

  • ok. this is the whole code

    #########################################################
    # Changes:
    # 1.02 -- Fix for points="0" raters with MTAjaxRaterOnclickJS tag - thanks Arvind!
    # 1.03 -- Added advanced use MTAjaxStarRaterAvergaeScoreWidth tag to output pixel width of current score
    # 1.04 -- Added AjaxRatingAvgScore as alias for AjaxRatingAverageScore
    # 1.05 -- Fix for Relative CGI Path in report comment email link
    # 1.06 -- Fix listings with sort_order = "ascend"
    # 1.1  -- MT4 Support
    # 1.11 -- Bug fixes for tables not be installed and dynamic publishing issue with stars not showing
    # 1.12 -- Bug fix for issue of settings not showing at the blog level in MT3.3x
    # 1.13 -- Fix for warning about unitialized value in eq
    # 1.14 -- Fix for tables not being installed on claen install on MT 4.01
    # 1.15 -- New Pro feature - scheduled task for deleting recent votes on same object with same subnets (24.123.456)
    # 1.16 -- Basic Fix only, update templates to include only basic features and tags
    
    

    package MT::Plugin::AjaxRating;
    use base qw(MT::Plugin);
    use strict;

    use MT;
    use AjaxRating;

    use vars qw($VERSION);
    $VERSION = '1.16';
    my $plugin = new MT::Plugin::AjaxRating({
    name => "AJAX Rating",
    description => "AJAX rating plugin for entries and comments and more.",
    doc_link => "http://mt-hacks.com/ajaxrating.html",
    plugin_link => "http://mt-hacks.com/ajaxrating.html",
    author_name => "Mark Carey",
    author_link => "http://mt-hacks.com/",
    object_classes => [ 'AjaxRating::Vote','AjaxRating::VoteSummary'],
    schema_version => "1.21",
    version => $VERSION,
    blog_config_template => \&AjaxRating::template,
    settings => new MT::PluginSettings([
    ['entry_mode', { Default => 0 }],
    ['entry_max_points', { Default => 5 }],
    ['comment_mode', { Default => 0 }],
    ['comment_max_points', { Default => '5' }],
    ['comment_threshold', { Default => 'all' }],
    ['unit_width', { Default => 30 }],
    ['rebuild', { Default => 0 }],
    ['ratingl', { Default => 1 }],
    ['hot_days', { Default => 7 }],
    ['enable_delete_fraud', { Default => 0 }],
    ['check_votes', { Default => 25 }],
    ]),
    });
    MT->add_plugin($plugin);

    if (MT->version_number < 4.0) {
    require MT::Template::Context;
    MT::Template::Context->add_tag(AjaxRating => \&AjaxRating::ajax_rating);
    MT::Template::Context->add_tag(AjaxRatingAverageScore => \&AjaxRating::ajax_rating_avg_score);
    MT::Template::Context->add_tag(AjaxRatingAvgScore => \&AjaxRating::ajax_rating_avg_score);
    MT::Template::Context->add_tag(AjaxRatingTotalScore => \&AjaxRating::ajax_rating_total_score);
    MT::Template::Context->add_tag(AjaxRatingVoteCount => \&AjaxRating::ajax_rating_vote_count);

    MT::Template::Context->add_tag(AjaxRater => \&AjaxRating::rater);
    MT::Template::Context->add_tag(AjaxStarRater => \&AjaxRating::star_rater);
    MT::Template::Context->add_tag(AjaxThumbRater => \&AjaxRating::thumb_rater);
    MT::Template::Context->add_tag(AjaxRaterOnclickJS => \&AjaxRating::rater_onclick_js);

    MT::Template::Context->add_tag(AjaxRatingEntryMax => \&AjaxRating::entry_max);
    MT::Template::Context->add_tag(AjaxStarRaterWidth => \&AjaxRating::star_rater_width);
    MT::Template::Context->add_tag(AjaxStarRaterAverageScoreWidth => \&AjaxRating::star_rater_avg_score_width);
    MT::Template::Context->add_tag(AjaxStarUnitWidth => \&AjaxRating::star_unit_width);

    # Callbacks that remove VoteSummary records when objects get deleted
    MT::Entry->add_callback('pre_remove', 5, $plugin, \&AjaxRating::entry_delete_handler);
    MT::Blog->add_callback('pre_remove', 5, $plugin, \&AjaxRating::blog_delete_handler);

    # Callbacks that change the obj_type column when objects are published or unpublished
    MT::Entry->add_callback('post_save', 5, $plugin, \&AjaxRating::entry_post_save);
    }

    sub instance {
    return $plugin;
    }

    sub init_app {
    my $plugin = shift;
    my ($app) = @_;
    return unless $app->isa('MT::App::CMS');
    $app->add_methods(
    ajaxrating_install_templates => sub { AjaxRating::install_templates($plugin, @_); },
    );
    }

    ## init_registry used only by MT4+ ##

    sub init_registry {
    my $component = shift;
    my $reg = {
    'applications' => {
    'cms' => {
    'methods' => {
    'ajaxrating_install_templates' => sub { AjaxRating::install_templates($plugin, @_); },
    }
    }
    },
    object_types => {
    'ajaxrating_vote' => 'AjaxRating::Vote',
    'ajaxrating_votesummary' => 'AjaxRating::VoteSummary',
    },
    'callbacks' => {
    'MT::Entry::pre_remove' => \&AjaxRating::entry_delete_handler,
    'MT::Blog::pre_remove' => \&AjaxRating::blog_delete_handler,
    'MT::Entry::post_save' => \&AjaxRating::entry_post_save,
    },
    tags => {
    function => {
    AjaxRating => \&AjaxRating::ajax_rating,
    AjaxRatingAverageScore => \&AjaxRating::ajax_rating_avg_score,
    AjaxRatingAvgScore => \&AjaxRating::ajax_rating_avg_score,
    AjaxRatingTotalScore => \&AjaxRating::ajax_rating_total_score,
    AjaxRatingVoteCount => \&AjaxRating::ajax_rating_vote_count,
    AjaxRater => \&AjaxRating::rater,
    AjaxStarRater => \&AjaxRating::star_rater,
    AjaxThumbRater => \&AjaxRating::thumb_rater,
    AjaxRaterOnclickJS => \&AjaxRating::rater_onclick_js,
    AjaxRatingEntryMax => \&AjaxRating::entry_max,
    AjaxStarRaterWidth => \&AjaxRating::star_rater_width,
    AjaxStarRaterAverageScoreWidth => \&AjaxRating::star_rater_avg_score_width,
    AjaxStarUnitWidth => \&AjaxRating::star_unit_width,
    },
    },
    };
    $component->registry($reg);
    }


    1;

  • I'm sorry, but I don't see any obvious cause.

    Shmuel.

  • maybe try sending an email to the plugin writer?

  • Thanks, Shmuel

    i'll try

  • Have you tried restarting your run-periodic-tasks daemon? It looks like the daemon doesn't recognize the plugin as installed so it can't use any of the tags it adds.

    Often this is caused by a long-running run-periodic-tasks daemon that was started before the plugin was even installed.

    If this is not the issue, check if the user running run-periodic-tasks (i.e. the user in whose crontab it is called) can actually read everything in the plugins folder. It also doesn't hurt cd'ing to the mt folder before starting run-periodic-tasks, just to make sure it can find all the folders etc. it needs.

  • Many thanks, Maarten!!!

    I'v restarted run-periodic-tasks daemon and then republished index page - and.... it works!!!

  • You are welcome, and thanks for the inspiration: I just wrote up a longer version of this solution with some more info on my blog at http://www.movabletips.com/2012/08/dealing-with-error-rebuilding-file-publish-error-in-template-unknown-tag-found.html

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

code.sixapart.com

137 479

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

238 797

Last Topic: Manifest Schema Compatibility Issue When Restoring Blog by Matt on Oct 17, 2012

1858 6594

Last Topic: Categories and Basename Publishing Issues by e21media on Oct 25, 2012

88 307

Last Topic: absolute publish date in Manage Entries screen by .mau. on Apr 18, 2012

1488 5347

Last Topic: Anti-cloning by .mau. on Oct 29, 2012

732 3093

Last Topic: Blog moved server - now users cannot access blog? by mowgs on Oct 30, 2012

89 317

Last Topic: How to "pretify" a url in htaccess with a few wildcards by Caio on May 30, 2012

183 771

Last Topic: Commenting with TypePad by Rob Ferrara on Oct 17, 2012

212 680

Last Topic: Does MT-Approval work in MT5? by DLpres on Sep 25, 2012

27 100

Last Topic: Upgrading MT by Caio on Oct 15, 2012

49 224

Last Topic: Movable Type 6 Ideas by Caio on May 28, 2012

65 248

Last Topic: Expanding new rich text editor and implementing table function by Takeshi Nick Osanai on Jul 30, 2012