Problem/Motivation

filter_list_format uses an internal cache identifier called "all". A user can create a filter with a machine name of "all" which when used will cause repeated warnings as follows:

Notice: Trying to get property of non-object in check_markup() (line 749 of modules/filter/filter.module).
Notice: Trying to get property of non-object in check_markup() (line 757 of modules/filter/filter.module).

Proposed resolution

There are two possible solutions.

1. stop users being able to create filter with a machine name of "all".
2. change the internal cache identifier so that it is not a valid machine name.

Option 2 is preferred as it has no user visible impact. As the cache identifier is a machine name changing it from "all" to "ALL" is sufficient to resolve the problem.

Remaining tasks

I have a patch attached which implements option 2.

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

applicity_sam’s picture

Patch to resolve the issue by changing the internal cache identifier to upper case.

applicity_sam’s picture

Status: Active » Needs review
applicity_sam’s picture

Version: 7.9 » 8.x-dev
FileSize
2.82 KB

Issue is also in D8 so here is a patch for it. Test to follow.

applicity_sam’s picture

Attached patch has a fix for the problem in 8 as well as a test that tests that we have fixed the problem,

kscheirer’s picture

kscheirer’s picture

Retesting against latest HEAD since it has been over a year.

Status: Needs review » Needs work

The last submitted patch, filter-name-all-with-test-1352636-4.patch, failed testing.

Wim Leers’s picture

Version: 8.x-dev » 7.x-dev
Issue summary: View changes
Status: Needs work » Closed (cannot reproduce)

This must've been fixed in the meantime in Drupal 8.

Thus, this must be a D7-only bug. Moving back to D7.

Wim Leers’s picture

Title: Filter format with machine name of all causes errors in check_markup. » Filter format with machine name of 'all' causes errors in check_markup.
Status: Closed (cannot reproduce) » Active

Oops.