I just upgraded Views from 6.x-2.12 to 6.x-2.16 (It's a recommended security update) and then found that Custom fields no longer work.
Downgrading just the Views module back to 6.x-2.12 made the custom fields work again.

Custom Markup:
------------------------
Nothing is displayed. There is no column for the field in the resultant view (Formatted as a table, have not tested other styles).

Custom PHP:
-------------------
Existing fields display and render correctly.
Newly created fields *do* get a column in the resultant table but the rows are blank.
I tried:<?php print "Hello"; ?> But saw no output
Then I tried setting the field to be rewritten to an arbitrary value of "Hello" and still saw no output.

Comments

hoZt’s picture

I also am having the same problem with custom markup. Nothing is being displayed.

Rev314159’s picture

Same issue here. Below is the code I entered in the custom field:

print var_export($data, TRUE);

if($data->node_data_field_game_postponed_field_game_postponed_value == 'off') { print $data->node_data_field_game_away_field_game_scorehome_value; } else { 


Here is the output in the views preview:

stdClass::__set_state(array(
'nid' => '16406',
etc...
'vid' => 'node_vid', ), )), ))

but not the actual data I was usually getting after this.

Lloyd’s picture

Same here.

pbosmans’s picture

Same here.

dhakshinait’s picture

Same problem with 6.x-3.0-rc3

alexharries’s picture

Also seeing this issue. Not entirely keen to downgrade but don't have any other option and don't have time to debug. What's changed in Views then I wonder?

cjamesrun’s picture

there was a new checkbox added to Add a Hide Rewriting if field is empty option See the update list here. as soon as I unchecked that, the item was writing properly.

NPC’s picture

@cjamesrun, you are a life-saver, THANK YOU!

druplicate’s picture

A fix was committed to Views back on November 20th, so you'll have to use the dev version of Views to get it.

http://drupalcode.org/project/views.git/commit/3026160

#1341882: 6.x-2.16 breaks customfield??

dhakshinait’s picture

i am facing same issue with views 6.x-3.0 after my updation from 6.x-3.0 dev..any solution for it?

Neha Seth’s picture

I am also facing the same problem. I have unchecked the Hide Rewriting if field is empty field but it still not showing any content.
Please suggest any possible way other than this.... I am using drupal 6.22 and php 5.3

TravisCarden’s picture

Title: Views Custom Field not compatible with Views 6.x-2.16 » Views Custom Field incompatible with new "Do not rewrite if empty" feature in Views 6.x-2.16

As @cjamesrun pointed out in #7, Views added a feature in the 6.x-2.16 release which, if enabled, necessarily conflicts with Views custom field. It is the new "Do not rewrite if empty" checkbox, which (retroactively) defaults to on! (See #1020540: Add a "Hide Rewriting if field is empty" option.) Since Views custom fields don't come from the database—they just have an empty string placeholder in the query—Views always perceives them as being empty. Thus, if that checkbox is checked on a custom field, it will never display. The immediate solution for site builders is to uncheck that checkbox on all their Views custom fields. The permanent solution would be, if possible, to disable that feature on custom fields in the module or, if not possible, to at least make it default to off. In the meantime, a notice should be added to the Views Custom Field project alerting users to the problem and pointing to this issue.