An attached patch for CVS changes the number from 100 to 255, since very often I ran up against the limit when tagging posts.

Comments

webchick’s picture

Status: Active » Needs review
drumm’s picture

Status: Needs review » Fixed

Committed to HEAD.

The field itself does not appear to be saved directly to the database (only split and saved), so reopen if you confirm and want more than 255 characters.

Anonymous’s picture

Status: Fixed » Closed (fixed)
nutkenz’s picture

Version: x.y.z » 6.6
Status: Closed (fixed) » Active

I'm running into the 255 character limit...

drumm’s picture

Version: 6.6 » 7.x-dev

This is the same 255 in HEAD. It should be patched there and then backported.

webchick’s picture

Issue tags: +Novice
karschsp’s picture

Assigned: Unassigned » karschsp

It's at 255 now. What should the max length be? 512?

karschsp’s picture

Status: Active » Needs review
StatusFileSize
new314 bytes

Patch is attached. The max length is now 512.

drumm’s picture

The DB's maximum is per-tag, so the field maximum can effectively be unlimited for tags.

karschsp’s picture

Hmmm...If I remove the '#maxlength' altogether, the field defaults to a maxlength of 128. I'm not sure where this is being set though. It looks like it's in system_elements() in system.module. I can certainly re-roll a patch that sets the maxlength of the tags field to some arbitrary length like 10,000 or something!

webchick’s picture

Status: Needs review » Needs work

@karschp: Hmmm. Could you try unset($form['...']['#maxlength']) maybe, after the definition?

Also, make sure that you're rolling patches with cvs diff -up because that gives a bit of context and makes them easier to read.

karschsp’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB

OK, I'm sure I implemented this incorrectly, but here's a patch that adds a function _taxonomy_set_maxlength that basically takes the "tags" element on #after_build and unsets the #maxlength attribute. We're nearing the limits of my drupal knowledge...I'm trying not to screw things up too much.

webchick’s picture

Status: Needs review » Needs work

Ah, no, I'm sorry. That was my fault for giving a crappy explanation because I was rushed. But um. Neat! I had no idea you could do that. :D

What I meant was:

        $form['taxonomy']['tags'][$vocabulary->vid] = array(
          '#type' => 'textfield',
          '#title' => $vocabulary->name,
          '#description' => $help,
          '#required' => $vocabulary->required,
          '#default_value' => $typed_string,
          '#autocomplete_path' => 'taxonomy/autocomplete/' . $vocabulary->vid,
          '#weight' => $vocabulary->weight,
          # Note: I removed #maxlength because we don't need it.
        );
        // Unset the #maxlength attribute on the text field, since the database maximum is per-tag.
        unset($form['taxonomy']['tags'][$vocabulary->vid]['#maxlength']);
      }
      else {

Mind you, I don't know if this will actually work, because I haven't tested it. If it doesn't, then we should probably go back to setting maxlength to something like 512 or 1024, because that's a bit more straight-forward use of the property than the solution in #12.

karschsp’s picture

Status: Needs work » Needs review
StatusFileSize
new714 bytes

Yeah, I tried it that way first and it wasn't working so I did the #after_build thing. I didn't think that was the right way of doing things but it's interesting. Here's a patch that just sets the maxlength to 1024.

Status: Needs review » Needs work

The last submitted patch failed testing.

karschsp’s picture

Status: Needs work » Needs review
StatusFileSize
new698 bytes

Not sure what was wrong with the last patch. I rolled that one on Windows so it's possible my line-endings were messed up?? And I used "cvs diff -up"...Anyway, here's another one rolled on OS X. All it does is change the maxlength on the tags textfield from 255 to 1024.

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Needs review » Reviewed & tested by the community

That's very bizarre. I'm not sure why it got hung up on that.

But cool! Committed to HEAD. Moving to 6.x for consideration.

gábor hojtsy’s picture

Version: 6.x-dev » 5.x-dev

Committed to 6.x, thanks! Looks like this can be backported to 5.x as well.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x.

Status: Fixed » Closed (fixed)
Issue tags: -Novice

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