Right so I was attempting to run fago's suggestion on Custom paths for profile pages import /export the profile.

  1. Looked at exporting and reimporting as suggested here Custom paths for profile pages
  2. Realized that it would not import the fields looking at the exportUI: Cloning does not clone the fields
  3. Then took the decision to try cloning the profile instead as I had 14+ views built on top of this profile
  4. Hit the clone button, but then decided hey im still going to miss step 1 and cant change the url
  5. Then decided on the screen to change the profile name on the clone to remove the clone as it wont work. Note did not his save.

BOOM! It then deleted the original profile along with it as well. "insert flamatory remarks here"

Shux, seem to be bumping my head every where with this module.

Here is the exception it threw at the same time.

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT savepoint_1 does not exist in field_read_instances() (line 703 of /var/www/D7/modules/field/field.crud.inc).

Comments

roam2345’s picture

As a side note some of the fields were still there, but others had been removed... (as I added a new profile with the same machine name as the old one)

fago’s picture

Status: Active » Postponed (maintainer needs more info)

I cannot reproduce this, e.g. by cloning the "main" profile and putting in the machine-name "main" in the clone, I get a validation error. Can you reproduce it? If yes, what are the exact steps?

roam2345’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new22.81 KB
new85.48 KB
new53.17 KB
new47.04 KB

Here are the steps.

1. select clone on a profile. (screen shot 1)
2. select delete profile type (screen shot 2)
3. select confirm (screen shot 3 error in that shot off another module ignore that)
4. I then get the error (screen shot 4) with the error below.

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT savepoint_1 does not exist in field_read_instances() (line 703 of /var/www/D7/modules/field/field.crud.inc).

remember what has happened here is I have chosen to clone the form presented is full of the clone information and I have then chosen to delete that (maybe that should be cancel not delete). After getting the error I return to the profile list screen and the profile I have cloned from originally is now removed (this is bug).

also to note is that I am on Drupal 7.2 and dev version of profile.

ericbroder’s picture

Title: Backing out of clone deletes original profile. » Delete button on clone page is confusing
Component: Code » User interface

Hi jucallme, it looks like there are two separate issues you're dealing with here.

First, when you go to clone a profile type, there are two buttons marked "Save profile type" and "Delete profile type". This is confusing because the first button means you will save the new clone-copy profile type, but the second button means you will delete the original cloned-from profile type. Adding to the confusion is that there is no "Cancel" or "Go back" button, which is actually the option you were looking for.

So we may want to consider this issue as a UI bug, and maybe a patch that just clarifies the two buttons better is sufficient. Another option is to add a Cancel button, and/or remove the Delete button.

The second issue you're dealing with is an error message that I can't replicate. I did a quick search though and you may want to look at some related discussions:

- Creating field instance during hook_insert() causes PDOException: http://drupal.org/node/1182010
- #687180: Deleting a taxonomy vocabulary leaves term reference fields still pointing to it, and a PDO Exception when creating content
- #1007830: Nested transactions throw exceptions when they got out of scope

Thanks,
Eric

ericbroder’s picture

Priority: Major » Normal

Given the extra confirmation page that clearly tells you which profile type is going to be deleted, this doesn't seem like a major issue.

ericbroder’s picture

Another option is to just remove the delete button from the clone page, so it's more like the add page:

  if (!$profile_type->isLocked() && $op != 'add') {
    $form['actions']['delete'] = array(
      '#type' => 'submit',
      '#value' => t('testDelete profile type'),
      '#weight' => 45,
      '#limit_validation_errors' => array(),
      '#submit' => array('profile2_type_form_submit_delete')
    );
  }
ericbroder’s picture

Status: Active » Needs review
StatusFileSize
new499 bytes

Here's a patch to remove the delete button from the clone page, so it's more like the add page.

roam2345’s picture

What about a button to cancel the current clone?

ericbroder’s picture

A cancel button would probably be nice too, but it's not necessary. When you add a new profile type, there is no cancel button, you either save the new profile type or you don't. The clone process could be the same way. I think the more important problem is that the delete button is confusing.

fago’s picture

Status: Needs review » Fixed

thanks, committed.

Status: Fixed » Closed (fixed)

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