The 'view_php' field will never be used. It existed as a field before displays were a concept. It should be removed, no harm will come of it.

The' is_cacheable' field is not in use and I am not sure if it will be removed. It was originally a hold over for the 'query' caching, but query caching never got implemented. It's possible that we will implement query caching, but we may do it differently. With plugins, though, there is more UI choice, so marking an overall 'is_cacheable' field seems unnecessary.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
FileSize
7.25 KB

Here the patch comes.

merlinofchaos’s picture

Ok, this is going to be kind of annoying.

We're not supposed to actually modify views_schema_1() -- note that the very first update in the 6.x series loads views_schema_1() and creates it. So if we modify it, then someone updating from 5.x is going to end up going through an invalid path.

We already have an issue about that, in fact, but nothing's actually been done with it because it hasn't gotten high enough on my TODO list to actually do. So we're probably going to need to address that either before or while we address this. I'm not sure offhand what that issue nid is, but you can duplicate the issue by upgrading a drupal 5 site directly to a very recent version of Views.

dawehner’s picture

Status: Needs review » Needs work
dawehner’s picture

Status: Needs work » Needs review
FileSize
6.15 KB
merlinofchaos’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Needs review » Patch (to be ported)

Committed to 6.x branches.

dawehner’s picture

Status: Patch (to be ported) » Fixed

and fixed.

Status: Fixed » Closed (fixed)

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

calefilm’s picture

Trying to fix my empty text dilemma after upgrading (see: http://drupal.org/node/1330148 ) I went back down to 6.14 and now get this warning:

user warning: Unknown column 'view_php' in 'field list' query: UPDATE views_view SET name = 'rmp_promo_reviews_per_employer', description = 'employer promo reviews', tag = 'employer promo reviews', view_php = '', base_table = 'node', is_cacheable = 0 WHERE vid = 354 in /Users/Cale/Sites/acquia-drupal/sites/all/modules/views/includes/view.inc on line 1722.

I can't get rid of it. I'm getting the same type of message when I save other views.

merlinofchaos’s picture

You need to clear caches to ensure the schema cache is rebuilt, I think.

calefilm’s picture

I tried doing that. I think the problem was upgrading to 6.x-3.x-dev from 2.16 and then back down to 2.12. I upgraded my system every time but that must have confused things.

I will restore my system back to yesterday when I had 2.16 -- the only problem is I lose my empty text output when I overwrite my field in views.

calefilm’s picture

Okay. Restored back to 2.16 and error disappears. Now I just need to figure out how to get the empty text output working again..

kentr’s picture

Trying to fix my empty text dilemma after upgrading (see: http://drupal.org/node/1330148 ) I went back down to 6.14 and now get this warning:

user warning: Unknown column 'view_php' in 'field list' query: UPDATE views_view SET name = 'rmp_promo_reviews_per_employer', description = 'employer promo reviews', tag = 'employer promo reviews', view_php = '', base_table = 'node', is_cacheable = 0 WHERE vid = 354 in /Users/Cale/Sites/acquia-drupal/sites/all/modules/views/includes/view.inc on line 1722.

You need to clear caches to ensure the schema cache is rebuilt, I think.

I've had success with putting the schema reset into the update function.

Example:

/**
 * Remove the view_php and is_cacheable field
 */
function views_update_6010() {
  $ret = array();

  db_drop_field($ret, 'views_view', 'view_php');
  db_drop_field($ret, 'views_view', 'is_cacheable');

  $schema = drupal_get_schema('views_view', TRUE);

  if (!empty($schema)) {
    $ret[] = array(
    'success' => TRUE,
    'query' => "Schema successfully reset for {views_view}."
    );
  }
  else {
    $ret[] = array(
        'success' => FALSE,
        'query' => "Schema not reset for {views_view}."
    );
  }

  return $ret;
}

In any event, running this code drupal_get_schema('views_view', TRUE); eliminates the 'view_php' error for me.

emallove’s picture

Issue summary: View changes

What's the alternative to is_cacheable for disabling caching on an individual view?