I don't know anyone who uses this field. It can easily be added with form_alter. I vote for its removal from core.

Do you use Minimum number of words?

Comments

webchick’s picture

Issue tags: +Novice
karschsp’s picture

Assigned: Unassigned » karschsp

assigning to myself.

karschsp’s picture

Status: Active » Needs review
StatusFileSize
new3.85 KB

Removed all mentions of min_word_count.

Status: Needs review » Needs work

The last submitted patch failed testing.

karschsp’s picture

Status: Needs work » Needs review
StatusFileSize
new10.28 KB

re-rolled with cvs diff -up.

webchick’s picture

Status: Needs review » Needs work

Cool! A couple of things:

1. Your patch from #62926: Increase maximum length of the free-tagging textbox to 255 characters got accidentally mixed up in here.
2. We should also drop the min_word_count column from the node_type table. This will require both a change to node_schema() and an update hook for people who were using this before.

This issue isn't quite dead yet, since there's still going to be an open question about what happens to the data that used to be in that column, but once the proper functions are there we can try and figure out what to do next. :)

webchick’s picture

K, scratch that last bit. Just remove the column from node_schema(). We can't write an update hook without users losing data, so people using D6 and earlier will just have an extra column in their database.

Chris Johnson’s picture

Update could:

* check if column has all default values.
If Yes, drop column.

If No, copy values to a new table with just the values and the primary key, for some future contrib module to use.
Then drop the column.

karschsp’s picture

Status: Needs work » Needs review
StatusFileSize
new9.42 KB

OK, I've removed min_word_count from node_type and removed the stuff leftover from my other patch. I didn't (yet) write an update hook...I can if you want me to.

Status: Needs review » Needs work

The last submitted patch failed testing.

karschsp’s picture

Status: Needs work » Needs review
StatusFileSize
new7.79 KB

re-rolling patch. let me know what you want me to do about the hook_update() issue, whether or not we should take the values from the min_word_count and store them as variables so a contrib module can use them, or if you just want to leave the column in the node_type schema.

thanks!

Status: Needs review » Needs work

The last submitted patch failed testing.

dave reid’s picture

Easiest way is to move the column data to variables named 'node_'. $node->type . '_min_word_count'. I'll take up writing the contrib module that should be available for 7.x before D7 is released.

Any ideas on name that should be used for the contrib module?
content_validation? (could be used for more general checks as well)
content_min_word_count?

The contrib module can grab these variables and rename them with the module name if needed.

karens’s picture

Barry Jaspan is writing a patch to make the body into a field using the new Fields in Core, and this would then be a custom validator for that field. There was talk of adding in a way to add plugable validators to fields in core, but that isn't implemented yet.

So if you want to work on the big picture issue ("could be used for more general checks as well"), you could try to figure out how to implement pluggable validators for Fields in Core, with one of them being this one. Otherwise I would just do a really simple module for this specific purpose and no other since it will probably be deprecated by pluggable validators whenever they come into being.

karens’s picture

Or maybe don't add a module at all but work it into the body-to-fields-in-core patch as an optional setting.

dave reid’s picture

That's getting away from the original purpose, which was to remove it, completely from core. :)

There should be nothing wrong with a new contrib module that could have the possibility to 'validate' more than just the minimum word count, but that is the only thing I want to code right now. As people request features, I can add them. Right now I just want to get an opinion on a name. :)

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new9.62 KB

Re-rolled with an update function that dumps the {node_type}.min_word_count data into variables named node_min_word_count_type. I just made a quick contrib module that is ready to commit that imports the variables correctly and enforces the minimum word count successfully.

When node bodies become fields, I can just change the contrib module. This should make converting node bodies to fields easier as well since this will be ripped out.

webchick’s picture

Hm. I actually like what Karen proposes quite a lot. I wonder if this is won't fix, and dump our energy into making body a true field instead.

dave reid’s picture

Had a little extra cruft in last patch, sorry.

karens’s picture

@Dave, I wasn't trying to make more work for you, I was responding to your comment about expanding the new contrib module into a solution to fix other validation issues so you didn't waste time going down the wrong path.

Barry's patch is at #372743: Body and teaser as fields. Assuming that is on its way to getting committed we might want to postpone this issue until after that. This fixes a minor nit, that one is the big kahuna (sp?). Then this postponed issue might become a starting point for optional, pluggable, validators for Fields in Core (or we could go back to the simple solution of just removing this value at that point if that's the consensus).

dave reid’s picture

I'm in complete agreement that fields should be able to have pluggable validators. We should be able to re-use some kind of minimum word count checking against any type of text field.

However, I'm confused if we're not in agreement that the minimum word count checking should be removed from core and put in contrib. I'm volunteering to maintain the contrib module for this, and I just finished writing a basic module to do that.

dave reid’s picture

Pluggable validators should be separate from this issue, because that is just one bigger thing. Let's keep this *just* about removing the minimum word count checking. :)

dave reid’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

Bojhan’s picture

Status: Needs work » Needs review

Was just about to suggest the same, till I found this issue. Can you see why it breaks?

ronia’s picture

We use "minimun number of words" for blog so that there is
substantial text before a posted item is called "blog"

Its very vital. We also need "max number of words" which
is not in Drupal.

If this is removed, this part will be broken for us from
Drupal six to seven urgrade, if we ever need it.

dries’s picture

I'd be OK with removing this feature from core, and have it live on as a contributed module.

Status: Needs review » Needs work

The last submitted patch failed testing.

stborchert’s picture

ugerhard’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

Nordtof’s picture

so guys,

How can I set the minimum word limit for my site's articles?

I need it now.

Nordtof’s picture

How can I set minimum word or character limit to articles in D7, now?

I really need that, but there ise no module or hints in Internet at this moment.

stborchert’s picture

@Nordtof: This feature has been removed from core.
You have to use a custom module for this (e.g. http://drupalcode.org/viewvc/drupal/contributions/sandbox/davereid/conte...).

Nordtof’s picture

I really want to congratulate you Mr. Developers.

Min Word Limit function was a really important function for that "heavily populated social web sites". Because of that function, admins can control the spammers cant publish stupid contents to the spesific article categories.

I dont want to see "ahahahahahah ahahaha ahahah ahahaha ahahhaha" articles in my hot-argued categories, but only qualified articles.

So, word limit functions was making people think twice, before publishing stupid articles.

Now, thank you, We dont have it in Drupal 7.

Nordtof’s picture

Ok. Lets do it through module.

But I cant install that module.

I'm downloading all the files, creating a ZIP file, uploading it to the site. and the answer of the site is : "there is no .info file in taht zip"

But there is a .info file in that zip.

any suggestions to help me?

Nordtof’s picture

Great,

David confimed that this module is useless because of "out of date".

So, anyone experiencing the same problem like me, try somewhere else. Not here.

Any developer to build a new module for "minimum character limit" is welcome.

Nordtof’s picture

drupal community waits a solution to this problem.

How could we add "minimum number of char" limit to the articles?

stevep’s picture

Am I reading this right?

Basically, a bunch of developers decide they're going to remove some functionality that people clearly need.

But these developers do so before any equivalent add-on module is provided????

To those developers who removed this functionality, how about you extend some courtesy to Drupal users who require it, by either putting it back in, or developing a module to address that loss of functionality.

If you don't feel it's your responsibility to develop that module, then leave the minimum character functionality in Drupal.

khanz’s picture

I am against removing this feature from core. This comes quite handy in sites where content is created by users.

bassem’s picture

It is really weird why would you remove this feature, there are a thousand reasons why this feature is needed, if you are using drupal as a platform for news sites, and you are assigning different news templates, minimum and maximum number of characters is central to online publishing, also if you are running a collaborative authoring environment, whether scientific or research driven, documentation etc.. this feature is also central, please try to put this feature back, until a alternative module is provided.

skizzo’s picture

The field_validation module can enforce min/max
number of chars/words (among many other things)

ugers’s picture

thanks skizzo. i was looking for this module. i think that it should have not been removed from core

jaypabs’s picture

Too bad you removed this features. Now I can't control my members from posting few words.

Nordtof’s picture

This was a huge mistake.

We'were using it for stop our members post the "one word or two lenght" spam nodes.