#16 ✓invalid
TomJoyal

Plugin Configuration Not Working

Reported by TomJoyal | January 15th, 2010 @ 08:56 AM

I am having a problem passing configuration information for plugins, and I believe I have isolated the problem.

My "plugins" configuration contains:

plugins: insertdatetime

The configuration for it is supposed to be:

plugin_insertdate_dateFormat : %m/%d/%Y

I believe the problem is occurring in OptionValidator.valid? The statement:

@@valid_options.include?(option) ||
  (plugins && plugins.include?(option.split('_')[0])) ||
  option =~ /^theme_advanced_container_\w+$/

The value passed in "option" is "plugin_insertdate_dateFormat", so the [0] index of the split is returning "plugin", which does NOT exist in the plugins array. Unfortunately, even if this were changed to grab the [1] index entry, it still would not work since "insertdatetime" did not create its configuration entry as "plugin_insertdatetime_???"

The only solution I can see (easily) would be to add the plugin configuration parms to valid_tinymce_options.yml but I honestly do not see how that would be maintainable. Otherwise, just blanket accept any configuration that starts with "plugin_"

Hopefully, you can see a better way to handle this standard plugin specifically, and this problem in general. THANKS!

Comments and changes to this ticket

  • Kieran P

    Kieran P January 18th, 2010 @ 12:49 PM

    • State changed from “new” to “open”

    Hey Tom,

    There has been some recent changes to tiny_mce that might have fixed this.

    If you could install this as a plugin and test, I'd appreciate it.

    script/plugin install git://github.com/kete.tiny_mce.git
    

    If it doesn't solve the problem, we accept patches on this tracker, or more preferably, fork the plugin on github, make the change, and post back here with the commit link. I'll review, test, and pull in.

    Regards
    Kieran

  • Kieran P

    Kieran P February 27th, 2010 @ 10:14 PM

    • State changed from “open” to “invalid”

    Hey Tom,

    After further investigation, it would seem the plugin is not following standard conventions for plugin setting values. Most, if not all other plugins, prefix all config options with the full plugin name.

    In the case of that plugin, plugin_insertdate_dateFormat really should be insertdatetime_dateFormat. You should bring this issue up with the author of the plugin.

    I won't be changing anything in the plugin, but you can simply add this to the end of the valid? method:

    option =~ /^plugin_insertdate/
    

    Regards
    Kieran

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A Ruby on Rails plugin that allows easy implementation of the TinyMCE editor into your applications.

People watching this ticket

Pages