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 |
Jump to:
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
Currently I don't have much time; I'll look into it next week.
#2
I'm seeing the same problem. Not sure what's up.
#3
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
I won't work on the D5 version until the D6 version is stable.
patches are welcome though.
#5
Now that there's a stable version, would you be willing to look at this?
#6
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
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