Hi

I upgraded from 6.x-2.8 to 6.x-2.10 with no errors but I have a view that is now empty. I'm using Postgres 8.3.

datalib=# \d views_display;
Table "public.views_display"
Column | Type | Modifiers
-----------------+-----------------------+----------------------------------------
vid | int_unsigned | not null default 0
id | character varying(64) | not null default ''::character varying
display_title | character varying(64) | not null default ''::character varying
display_plugin | character varying(64) | not null default ''::character varying
position | integer | default 0
display_options | text |
Indexes:
"views_display_pkey" PRIMARY KEY, btree (vid, id)
"views_display_vid_idx" btree (vid, "position")

here is the views_display field of the problem view:

datalib=# select views_display from views_display where vid = 1 and id = 'default';

(1,default,Defaults,default,1,"a:11:{s:9:""arguments"";a:2:{s:4:""name"";a:36:{s:14:""default_action"";s:6:""ignore"";s:12:""style_plugin"";s:15:""default_summary"";s:13:""style_options"";a:0:{}s:8:""wildcard"";s:3:""all"";s:21:""wildcard_substitution"";s:3:""All"";s:5:""title"";s:2:""%1"";s:10:""breadcrumb"";s:2:""%1"";s:21:""default_argument_type"";s:5:""fixed"";s:16:""default_argument"";s:0:"""";s:13:""validate_type"";s:4:""none"";s:13:""validate_fail"";s:9:""not found"";s:8:""glossary"";i:0;s:5:""limit"";s:1:""0"";s:4:""case"";s:4:""none"";s:9:""path_case"";s:4:""none"";s:14:""transform_dash"";i:0;s:9:""add_table"";i:0;s:13:""require_value"";i:0;s:2:""id"";s:4:""name"";s:5:""table"";s:9:""term_data"";s:5:""field"";s:4:""name"";s:27:""validate_user_argument_type"";s:3:""uid"";s:19:""validate_user_roles"";a:1:{i:2;i:0;}s:12:""relationship"";s:4:""none"";s:26:""default_options_div_prefix"";s:0:"""";s:21:""default_argument_user"";i:0;s:22:""default_argument_fixed"";s:0:"""";s:20:""default_argument_php"";s:0:"""";s:27:""validate_argument_node_type"";a:3:{s:9:""catalogue"";i:0;s:4:""page"";i:0;s:5:""story"";i:0;}s:29:""validate_argument_node_access"";i:0;s:26:""validate_argument_nid_type"";s:3:""nid"";s:28:""validate_argument_vocabulary"";a:1:{i:1;i:0;}s:22:""validate_argument_type"";s:3:""tid"";s:27:""validate_argument_transform"";i:0;s:28:""validate_user_restrict_roles"";i:0;s:21:""validate_argument_php"";s:0:"""";}s:18:""field_region_value"";a:33:{s:14:""default_action"";s:6:""ignore"";s:12:""style_plugin"";s:15:""default_summary"";s:13:""style_options"";a:0:{}s:8:""wildcard"";s:3:""all"";s:21:""wildcard_substitution"";s:3:""All"";s:5:""title"";s:7:""%1 | %2"";s:10:""breadcrumb"";s:2:""%2"";s:21:""default_argument_type"";s:5:""fixed"";s:16:""default_argument"";s:0:"""";s:13:""validate_type"";s:4:""none"";s:13:""validate_fail"";s:9:""not found"";s:9:""add_table"";i:0;s:13:""require_value"";i:0;s:17:""reduce_duplicates"";i:0;s:2:""id"";s:18:""field_region_value"";s:5:""table"";s:22:""node_data_field_region"";s:5:""field"";s:18:""field_region_value"";s:27:""validate_user_argument_type"";s:3:""uid"";s:19:""validate_user_roles"";a:1:{i:2;i:0;}s:8:""override"";a:1:{s:6:""button"";s:8:""Override"";}s:12:""relationship"";s:4:""none"";s:26:""default_options_div_prefix"";s:0:"""";s:21:""default_argument_user"";i:0;s:22:""default_argument_fixed"";s:0:"""";s:20:""default_argument_php"";s:0:"""";s:27:""validate_argument_node_type"";a:4:{s:6:""sparql"";i:0;s:9:""catalogue"";i:0;s:4:""page"";i:0;s:5:""story"";i:0;}s:29:""validate_argument_node_access"";i:0;s:26:""validate_argument_nid_type"";s:3:""nid"";s:28:""validate_argument_vocabulary"";a:0:{}s:22:""validate_argument_type"";s:3:""tid"";s:27:""validate_argument_transform"";i:0;s:28:""validate_user_restrict_roles"";i:0;s:21:""validate_argument_php"";s:144:""//$view->page_title = ""My new view title"";
//$args[0] = 'Scotland';
//$handler->options['title'] = strtolower($handler->argument);

return TRUE;"";}}s:6:""fields"";a:1:{s:5:""title"";a:9:{s:5:""label"";s:0:"""";s:5:""alter"";a:15:{s:10:""alter_text"";i:0;s:4:""text"";s:0:"""";s:9:""make_link"";i:0;s:4:""path"";s:0:"""";s:10:""link_class"";s:0:"""";s:3:""alt"";s:0:"""";s:6:""prefix"";s:0:"""";s:6:""suffix"";s:0:"""";s:4:""help"";s:0:"""";s:4:""trim"";i:0;s:10:""max_length"";s:0:"""";s:13:""word_boundary"";i:1;s:8:""ellipsis"";i:1;s:10:""strip_tags"";i:0;s:4:""html"";i:0;}s:12:""link_to_node"";i:1;s:7:""exclude"";i:0;s:2:""id"";s:5:""title"";s:5:""table"";s:4:""node"";s:5:""field"";s:5:""title"";s:8:""override"";a:1:{s:6:""button"";s:8:""Override"";}s:12:""relationship"";s:4:""none"";}}s:7:""filters"";a:2:{s:4:""type"";a:10:{s:8:""operator"";s:2:""in"";s:5:""value"";a:1:{s:9:""catalogue"";s:9:""catalogue"";}s:5:""group"";s:1:""0"";s:7:""exposed"";b:0;s:6:""expose"";a:2:{s:8:""operator"";b:0;s:5:""label"";s:0:"""";}s:2:""id"";s:4:""type"";s:5:""table"";s:4:""node"";s:5:""field"";s:4:""type"";s:8:""override"";a:1:{s:6:""button"";s:8:""Override"";}s:12:""relationship"";s:4:""none"";}s:6:""status"";a:10:{s:8:""operator"";s:1:""="";s:5:""value"";s:1:""1"";s:5:""group"";s:1:""0"";s:7:""exposed"";b:0;s:6:""expose"";a:2:{s:8:""operator"";b:0;s:5:""label"";s:0:"""";}s:2:""id"";s:6:""status"";s:5:""table"";s:4:""node"";s:5:""field"";s:6:""status"";s:8:""override"";a:1:{s:6:""button"";s:8:""Override"";}s:12:""relationship"";s:4:""none"";}}s:14:""items_per_page"";i:0;s:6:""offset"";i:0;s:5:""title"";s:0:"""";s:6:""header"";s:733:""

 $view = views_get_current_view();
 $category = str_replace("" "", ""%20"", $view->args[0]);
 $region = $view->args[1];
 $url = base_path() . ""catalogue/"" . $category . ""/"";
 
 if ($region == ''){
   $all = 'All';
 }
 else {
   $all = ""<a href="" . $url . "">All</a>"";
 }
 
 if ($region == 'Scotland'){
   $scot = 'Scotland';
 }
 else {
   $scot = ""<a href=\\"""" . $url . ""Scotland\\"">Scotland</a>"";
 }
 
 if ($region == 'United Kingdom') {
   $uk = 'United Kingdom';
 }
 else{
   $uk = ""<a href=\\"""" . $url . ""United%20Kingdom\\"">United Kingdom</a>"";
 }
 
 if ($region == 'International'){
   $int = 'International';
 }
 else{
   $int = ""<a href=\\"""" . $url . ""International\\"">International</a>"";
 }
 
 print $all . "" | "" . $scot . "" | "" . $uk . "" | "" . $int;
 
 

"";s:13:""header_format"";s:1:""3"";s:12:""header_empty"";i:0;s:5:""sorts"";a:1:{s:5:""title"";a:5:{s:5:""order"";s:3:""ASC"";s:2:""id"";s:5:""title"";s:5:""table"";s:4:""node"";s:5:""field"";s:5:""title"";s:12:""relationship"";s:4:""none"";}}s:6:""access"";a:1:{s:4:""type"";s:4:""none"";}}")
(1 row)

Advice would be very much appreciated.

Comments

dawehner’s picture

Status: Active » Closed (duplicate)

Did you upgraded to 2.9 and runned the update.php?

There is a bug in the pqsql dbtng thing, which leads to removing the views 2.9 thing

[#http://drupal.org/node/793544]

gmh04’s picture

No I skipped the 2.9 upgrade. I was aware of the Postgres issue as I had a problem with another site using on older Postgres version. The thing is the views_display data exists, its just not being displayed. I think I will work around this problem by exporting the view (I have restored the database to before the upgrade) and re-importing it after the upgrade.

gmh04’s picture

Actually the php mode in the header was causing me to loose the view. For example saving the line:

$all = "<a href=\"" . $url . "\">All</a>"";

resulted in the view appearing empty (actually it wasn't empty in the database). Removing all the escapes and using single quotes, e.g.

$all = '<a href="' . $url . '">All</a>';

fixed my problem.

Do other people see the same thing? I wonder if this is specific to postgres? It is still a problem because you loose your view when editing a field in php mode.