Hi,

I'm using the latest stable of both CCK and Views. I created a field and exposed it via views, and then deleted the field. Now, when I view the view, I get the following error:

"user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC LIMIT 0, 10' at line 1 query: SELECT node.nid, node.created AS node_created_created, field_year_value FROM node node WHERE (node.type IN ('pinchin_newsletter')) ORDER BY node_created_created DESC, DESC LIMIT 0, 10 in /usr/local/www/vhosts/pinchin.com/subdomains/drupal/httpdocs/includes/database.mysql.inc on line 172."

field_year is the field I deleted.

When I edit, I get: function warning: Invalid argument supplied for foreach() in /usr/local/www/vhosts/pinchin.com/subdomains/drupal/httpdocs/includes/form.inc on line 948.

Where the invalid argument contains field_year.

When I delete references to the field within view_exposed_filter, view_filter, and view_sort, everything works. But obviously that's not very user-friendly.

Thanks,
--Andrew

Comments

karens’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Component: Code » Views Integration
Status: Active » Closed (works as designed)

At the moment there is no easy way to clean up views that use your fields when you delete the fields and you have to pull each view up and remove the field manually.

I have proposed a possible fix at http://drupal.org/node/186220.