Bug introduced with the API revamp. Currently this data is not required, but could be in further follow-ups.

The attached patch fixes it by saving to {filter}.module the module that provide the filter.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dropcube’s picture

Title: The module that provide the filters is not being saved to the {filter} database » {filter}.module is not saved

Status: Needs review » Needs work

The last submitted patch failed testing.

lilou’s picture

Status: Needs work » Needs review
sun’s picture

As with #562932: {filter_format}.cache is not saved, we want to add tests for Filter API CRUD functions, ensuring required data is properly created, loaded, updated, deleted.

sun’s picture

Issue tags: +API clean-up

Introducing a new tag for feature freeze: API clean-up.

Dries’s picture

This looks like a valid patch, but it would be good to have tests, especially in this stage of the code freeze.

Status: Needs review » Needs work

The last submitted patch failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
8.61 KB

Here is a starting point - I've to leave now, so please go ahead.

Status: Needs review » Needs work

The last submitted patch failed testing.

blackdog’s picture

Status: Needs work » Needs review
FileSize
7.59 KB

A try to re-roll this. The roles part of filter_format_save is no longer there, so I removed that.

Status: Needs review » Needs work

The last submitted patch failed testing.

sun’s picture

Assigned: dropcube » sun
Status: Needs work » Needs review
FileSize
10.87 KB

Now including a full test suite for CRUD operations.

RTBC if bot passes.

dropcube’s picture

Status: Needs review » Reviewed & tested by the community

RTBC as far as I can see.

Dries’s picture

- After a ":", we really should start using a small letter instead of a capital letter. This is minor and I won't hold up the patch for it at this stage -- I will after slush.

- CRUD is not 100% accurate here, we're not testing 'Delete' (yet). Maybe we should add a small @todo? Maybe testTextFormatCRUD() should be renamed to testTextFormatLoadAndSave() or something?

sun’s picture

1) Actually, I discussed exactly this issue with some texters/writers/grammar experts in IRC some time ago, because, you know, I'm nitpicky and eager to know the proper rules. ;)

What I learned about proper English grammar is that one starts with a lowercase letter after a colon when a sentence is continued before and after the colon. As in

What you always wanted to do: patch core.

One starts with a capital letter when the terms or phrases before and after the colon are "detached" and do not form a full sentence together, and the term/phrase after the colon forms a full sentence on its own. For example, as in

And that is Drupal: It's not like we're nitpicky, but we take things seriously.

The latter also applies to the case of PHPDoc key definitions like this, and I specifically asked them about the proper capitalization by examining some examples in core. My understanding is that the above can be continued as pattern:

And that is Drupal: It's not like we're nitpicky, but we take things seriously.

Drupal: It's not like we're nitpicky, but we take things seriously.

'name': The title of the text format.

Interestingly, they mentioned that the same rule should also be applied to semicolons - e.g. like here:

/**
 * Menu callback; Show a page with long filter tips.
 */
function filter_tips_long() {

2) Instead of renaming the test, we want to complete the CRUD by also testing text format deletion. :)

sun’s picture

*bump*

sun’s picture

This issue blocks #562932: {filter_format}.cache is not saved, #573852: Rename {filter_format}.name to .title and replace .format with machine-readable .name, as well as some other issues in the queue.

Two options:

1) We proceed with the current approach, fixing all step by step.

2) We close down all issues and merge the patches into one new, larger FilterSystemRevamp patch.

Thus far, 1) has also been easier for me to follow and validate all changes we apply. However, I can see the (perfectly possible) point that these issues may feel like a never-ending swarm of patches, where every single one takes a certain amount of time to review. Either one is fine with me (though I definitely prefer the former).

webchick’s picture

While not strictly on-topic, as a native English speaker with grammar nerd tendencies, I can confirm the format of the colon / capital separation that's currently in the patch feels "right" to me.

Tests look great, and I'm cool with committing this. But why are you removing over-arching documentation about the filter system?

sun’s picture

Yay! webchick is back! :)

The doxygen "group" is a left-over from times when filter_xss() and related functions were in filter.module. Those have been moved to common.inc, so the "group" basically wraps around check_markup() now. In addition it was using the @name directive, which is not even parsed on api.d.o. :)

sun’s picture

Please?

sun’s picture

Priority: Normal » Critical
Issue tags: +D7 API clean-up

Do not touch this tag.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

OK cool. Committed to HEAD!

Status: Fixed » Closed (fixed)
Issue tags: -FilterSystemRevamp, -API clean-up, -D7 API clean-up

Automatically closed -- issue fixed for 2 weeks with no activity.

gisle’s picture

Issue summary: View changes
Issue tags: -D7 API clean-up

Removed non-canonical tag. See #2426171: Multiple tags similar to 'API clean-up' for background.