If you try to create a context with the same name as an existing one, you get a PDO Exception error, rather than a clean UI error indicating that the context name exists.

Message I got:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'background-home' for key 1: INSERT INTO {context} (name, description, tag, conditions, reactions, condition_mode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => background-home [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => background [:db_insert_placeholder_3] => a:1:{s:4:"path";a:1:{s:6:"values";a:1:{s:7:"contact";s:7:"contact";}}} [:db_insert_placeholder_4] => a:1:{s:8:"bg_image";a:4:{s:21:"bg_image_node_ref_nid";s:2:"18";s:15:"bg_image_weight";s:1:"0";s:21:"override_css_settings";i:0;s:12:"css_settings";a:7:{s:17:"bg_image_selector";s:4:"body";s:14:"bg_image_color";s:4:"#CCC";s:10:"bg_image_x";s:6:"center";s:10:"bg_image_y";s:3:"top";s:19:"bg_image_attachment";s:5:"fixed";s:15:"bg_image_repeat";s:9:"no-repeat";s:18:"bg_image_important";i:1;}}} [:db_insert_placeholder_5] => 0 ) in drupal_write_record() (line 6975 of /includes/common.inc).

Comments

tekante’s picture

The following patch appears to resolve the PDO exception, needs to be tested to ensure it doesn't cause issues in other import areas.

tekante’s picture

Status: Active » Needs review
tekante’s picture

Adding tag for tracking

tekante’s picture

Status: Needs review » Fixed

This has been corrected with commit b14405c21498a1a2704522ebe08e036488987a58.

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

Anonymous’s picture

Issue summary: View changes

Changed description