backdrop-contrib / footnotes

Add automatically numbered footnotes to your content.
GNU General Public License v2.0
2 stars 2 forks source link

Error on filter settings #22

Closed herbdool closed 5 years ago

herbdool commented 5 years ago

After first installing, I go to /admin/config/content/formats/filtered_html and get these errors:

Warning: Missing argument 5 for _footnotes_settings(), called in /app/core/modules/filter/filter.admin.inc on line 347 and defined in _footnotes_settings() (line 49 of /app/modules/footnotes/footnotes.module). Warning: Missing argument 6 for _footnotes_settings(), called in /app/core/modules/filter/filter.admin.inc on line 347 and defined in _footnotes_settings() (line 49 of /app/modules/footnotes/footnotes.module).

There's a new format for the function: https://api.backdropcms.org/api/backdrop/core%21modules%21filter%21filter.api.php/function/callback_filter_settings/1

herbdool commented 5 years ago

I think it's as simple as removing the last two parameters:

/**
 * Options for the Footnotes filter.
 *
 * This has currently 1 setting, the feature to collapse together footnotes
 * with identical content is an option.
 */
function _footnotes_settings($form, &$form_state, $filter, $format) {
  $settings['footnotes_collapse'] = array(
    '#type' => 'checkbox',
    '#title' => t('Collapse footnotes with identical content'),
    '#default_value' => $filter->settings['footnotes_collapse'],
    '#description' => t('If two footnotes have the exact same content, they will be collapsed into one as if using the same value="" attribute.'),
  );
  return $settings;

}
olafgrabienski commented 5 years ago

Thanks for the report! Now I remember that I got these errors as well but forgot to file an issue. I'll test your suggestion.

olafgrabienski commented 5 years ago

I've tested the code above, and errors went away. Will file a PR.

olafgrabienski commented 5 years ago

Filed and merged the PR, thank you again @herbdool!