- node title can be 255 characters long.
- adding [nid: $nid] to node title result in a string longer than 255
- form validation will fail if node_reference_autocomplete can be only 255 long..

Comments

yched’s picture

Status: Active » Fixed
StatusFileSize
new820 bytes

Makes sense. Committed the attached patch.

fgm’s picture

Status: Fixed » Active

I think this rather means that the lenght limit should be raised, not removed.

On a 64-bit PHP, max length would be 255 + strlen('[nid: ]') + ceil(log10(2^64)), i.e. 255 + 7 + 20 = 282, would it not ? And 272 on a 32-bit. Assuming unsigned nids.

yched’s picture

The value that we store from the widget is a nid anyway, so I'm not sure what's the point of settings a #maxlength on the textfield form input anyway ? FWIW, the autocomplete widget for userref doesn't have any.

fgm’s picture

Status: Active » Fixed

Good point.

Status: Fixed » Closed (fixed)

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

scor’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new2.64 KB
new3.44 KB

Patch #1 reintroduced #1064544: Node reference doesn't work when title exceeds 128 characters. you need to override #maxlength on the textfield element which is otherwise set to 128 by default by the form API. including a test so we don't ever have to deal with this again. the test_only patch should fail.

Status: Needs review » Needs work

The last submitted patch, 1183300_6_maxlength_test_only.patch, failed testing.

tempo22’s picture

this patch still didn't made it to release ?

scor’s picture

Status: Needs work » Needs review
StatusFileSize
new3.44 KB

#6 remains to be reviewed/committed. I'm reuploading it here so the testbot does not get confused.

@tempo22 please test this patch and if it works for you, RTBC this issue please :)

yched’s picture

Yup, this dropped off my radar when rolling the release, sorry about that.
Committed. Thanks !

scor’s picture

smclernon’s picture

Status: Fixed » Reviewed & tested by the community

I have implemented this patch recently and can confirm it works.

yched’s picture

Status: Reviewed & tested by the community » Fixed

@smclernon: the patch has been committed already. It will be in forthcoming 2.1 release

Status: Fixed » Closed (fixed)

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

Alex Andrascu’s picture

What happened with this ?

scor’s picture

@Alex Andrascu: it was committed and should be in the latest release. is it not working for you?

Alex Andrascu’s picture

I haven't tried dev tbh but i've seen last message from February and still no stable release. Plus the issue queue is crammed. I'm on a critical project near the deadline and not sure if to go with dev or not. It'll require additional testing time.

Thanks for getting back @scor

scor’s picture

not sure this project will get a new release, since http://drupal.org/project/entityreference is the recommended way of doing node/user references now. dev snapshot should work.

Alex Andrascu’s picture

I know about entityreference but... it's way to late to switch to that unfortunatelly. I guess all that's left is to give dev a go. Thanks again.