Setting the sanitize source format to a text format that the user doesn't have permission to causes the error:

Notice: Undefined index: [myfilter] in _filter_tips() (line 1011 of [mysite]/modules/filter/filter.module).
Notice: Trying to get property of non-object in _filter_tips() (line 1015 of  [mysite]/modules/filter/filter.module).
Notice: Trying to get property of non-object in _filter_tips() (line 1016 of  [mysite]/modules/filter/filter.module).

The error disappears when I add permission to use [myfilter] to the user's role.

Comments

RobW’s picture

Yep, problem is calling theme('filter_tips', ...) on filters that a user's role doesn't have permission to use in _sanitizable_tips.

I don't know how you'd get around the permission system here, so I can't roll a good patch to fix. For now I'm just killing the filter tips and forgetting about it.

function _sanitizable_tips($filter, $format, $long = FALSE) {
  return t('The text will be formatted before storage using the following settings.')
    // Commenting this guy out removes the error (and the filter tips)
    //. theme('filter_tips', array('tips' => _filter_tips($filter->settings['format'], FALSE)))
    ;
}
RobW’s picture

Title: Error "Undefined index... in _filter_tips()" when user input is sanitized by an text format they don't have permission to use. » Error "Undefined index... in _filter_tips()" when user input is sanitized by a text format they don't have permission to use.
maurizio.ganovelli’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta1
Status: Active » Needs review
StatusFileSize
new1.36 KB

This patch works for me (for 7.x-1.0-beta1 version).

mariusz.slonina’s picture

Issue summary: View changes

works fine, thank you!