All code in long custom field is discarded

rfay - December 12, 2008 - 14:15
Project:Views Custom Field
Version:5.x-1.0-beta1
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs work
Description

If I put a largish block of code in a views_customfield element, then save the view, the entire block of code is silently discarded. No error message is given. I can demonstrate this in any view. (Drupal 5.13, Views 5.x-1.6)

For example, this piece of code results in the discard behavior. If I click save after putting this in the field, the field will be empty when I edit the view.

<?php

print "hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";
print
"hi there";

?>

#1

casey - December 13, 2008 - 16:57

Currently I don't have much time; I'll look into it next week.

#2

L0rne - December 16, 2008 - 01:54

I'm seeing the same problem. Not sure what's up.

#3

incognito - December 19, 2008 - 18:44
Category:bug report» task

The PHP code is saved to the Options field of view_tablefield database table in the serialized manner.
The Options field is defined as varchar(255), this means that it has maximum length of 255 characters.

So, the problem is due to limitation of the length of database field, in which evaluated PHP code is stored.

#4

casey - January 9, 2009 - 18:47
Status:active» postponed

I won't work on the D5 version until the D6 version is stable.

patches are welcome though.

#5

infernix - June 23, 2009 - 02:52

Now that there's a stable version, would you be willing to look at this?

#6

rfay - June 23, 2009 - 21:13

The D5 version on drupal.org is still the same as when this was submitted (5.x-1.0-beta1), and it still fails the exact same test.

@infernix: I don't understand what you mean "now that's there's a stable version". It's the same version.

D6 (6.x-1.0) seems to work fine. It does not exhibit this bug.

#7

chris55 - October 11, 2009 - 11:24
Status:postponed» needs work

The introduction to this says "largish block of code". The limit is actually around 225 bytes which is about 3 lines of code.

This makes the module of limited value for those of us tied to Drupal 5 for whatever reason.

Chris

 
 

Drupal is a registered trademark of Dries Buytaert.