I use cck (or flexinode) for my content. They typically have looong names.

however the 'name' column in variable is only 48 chars long. This results in unsavable forms.

Because Mysql chops the name up after 48 chars, they override eachother.

I am working on a path for this, to shorten the name.

Comments

Coyote’s picture

Argh. That looks like it could be a problem. I'll have to look into this.

RobRoy’s picture

Just ran into this. This needs to be 128 at least right?

Using CCK and per-type settings like 'menu_panel_visibility_defaults_content-before__after' I get errors cause it's too long.

Coyote’s picture

Hmmm... I hate to do it, but rather than something that alters core, perhaps I should just rewrite the module so that it uses its own settings table to store the settings for each node type, that won't be dependent on the variable table in Drupal.

Argh.

Anyone have any other suggestions?

Bèr Kessels’s picture

yes, I do have a suggestion:

Write a "smarter" helper that takes long names and turns them into shorter, unique names. Something of a mapper/hasher:

function make_unique_name($orginal, $length = 255) {
  if(strlen($original) > $length)) {
    return $original;
  }
  $id = db_next_id('unique_name');
  //todo: needs to check for strlen($length) too and see if it is not longer then $length.
 $chop_count =  strlen($id) + 1;
  return substr($original, $chop_count) .'_'. $id;
}

You could make it even smarter, by looking for existing numeral pieces in $original, to avoid names like foo_1234_155, but make them like foo_1389 (=1234+155);

Coyote’s picture

Status: Active » Closed (fixed)

Okay, I believe this one is (at long last) squished.
jjeff submitted a patch for this and a few other issues.

http://drupal.org/node/66189

Coyote’s picture

Status: Closed (fixed) » Fixed

Closing this out, and referring further comments on this to the thread with jjeff's patch, since that's the one I went with.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 50850)