Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have exported my views to code. However, whe I try to override them (Edit and Save), the following error appears:
PDOException: in views_db_object->save_row() (line 2224 of \views\includes\view.inc)
In the 'recent log messages', the same error appears twice at the same time: once as type 'php', once as type 'views'.
I can't circumvent by cloning and saving the view, either.
Comments
Comment #1
johnvComment #2
johnvI saw there was an update call and an insert call, hence the 2 messages.
After updating to current dev-version (7.x-3.7+14), the error has gone.
Comment #3
johnvNope. still occurs.
When I clone a view with 3 displays (including master display), all goes well: 1xinsert views_view (without field vid), 3xinsert views_display (with field vid)
When I edit & save an 'view in code', I get 1xinsert views_view (without field vid), 1xupdate views_display(with field vid).
The update generates the PDOxception.
Sometimes I get 1xinsert views_view + 1x
insertviews_display (which seems OK), but still generates the error.Comment #4
flocondetoileHi,
I met the same issue in exactly the same conditions. Have you found the reason of this ?
I have to delete my views in code and import them in views UI to be able to update them.
Comment #5
johnvHi flocondetoile, no, I haven't found reason or solution, yet.
Comment #6
johnvIMO the problem is with the cache_views table, which is a copy/add-on of views_view and views_display. Apparently, cache_views is not properly emptied on cache flush. (Normally I use 'Flush all caches' from admin_menu. An alternative is /admin/config/development/performance )
One of my sites is now working properly after leaving it untouched for the holidays.
#1123198: Error message when modifying filter criteria/saving View contains code to circumvent this.