infojunkie / MantisBT-Slack

Slack integration for Mantis bug tracker
GNU General Public License v2.0
48 stars 38 forks source link

new version of slack #11

Closed claytonsilva closed 9 years ago

claytonsilva commented 9 years ago

Hi,

I adjust the config, you only need webhook url now to integrate slack with incoming webhooks

infojunkie commented 9 years ago

Thanks for submitting this. The patch as is does not work for me under Mantis 1.2.8. No configuration setting can be called url because of the following entry in config_defaults_inc.php:

/**
 * The following list of variables should never be in the database.
 * These patterns will be concatenated and used as a regular expression
 * to bypass the database lookup and look here for appropriate global settings.
 * @global array $g_global_settings
 */
$g_global_settings = array(
    '_table$', 'cookie', '^db_', 'hostname', 'allow_signup', 'database_name', 'show_queries_', 'admin_checks', 'version_suffix', 'global_settings',
    '_path$', 'use_iis', 'language', 'use_javascript', 'minimal_jscss', 'display_errors', 'show_detailed_errors', 'stop_on_errors', 'login_method', '_file$',
    'anonymous', 'content_expire', 'html_valid_tags', 'custom_headers', 'rss_key_seed', 'plugins_enabled', 'session_', 'form_security_',
    'compress_html', '_page$', '_url$',
);

The config url gets renamed to plugin_Slack_url, which matches the last disallowed entry. when I renamed the configuration setting to a name that does not match _url$, your patch worked.

claytonsilva commented 9 years ago

Ops, sorry :(

I will rename to webhook_url ok?

infojunkie commented 9 years ago

Mantis appends plugin_Slack_ to any configuration name you use. I suggest url_webhook instead of url.

claytonsilva commented 9 years ago

changing :D

infojunkie commented 9 years ago

Thanks!