Deleting a profile type with fields in it leads to:

Error message
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT savepoint_1 does not exist: RELEASE SAVEPOINT savepoint_1; Array ( ) in variable_set() (line 805 of includes/bootstrap.inc).

Even if profile2 or entity do not want to handle that case and prefer to let the user delete the fields, it should say so instead of attempting to delete the profile type and crash.

Comments

fago’s picture

DamienMcKenna’s picture

Seeing this too.

joachim’s picture

Me too. Patch over at that issue fixes the problem.

Jerome F’s picture

I also tested it and can confirm it fixes the problem.

Jon Pugh’s picture

The patch seems to have fixed deleting a profile, but REVERTING an exported profile causes the following error:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT savepoint_1 does not exist in field_read_instances() (line 706 of /var/aegir/platforms/foodfeed/web/modules/field/field.crud.inc).

Jon Pugh’s picture

I should also mention, that the profile gets totally deleted when reverting...

geerlingguy’s picture

Subscribe. It looks like that patch was committed, so... will this be fixed when people upgrade to 7.8 or whatever's next? Because I'm still getting the error with 7.7.

fago’s picture

I can confirm the error still exists with Drupal 7.7 if entity-deletion transactions are re-enabled (see #1236814: entity-deletion does not make use of transactions)

I get:

Error message
DatabaseTransactionNoActiveException: in DatabaseConnection->popTransaction() (line 1100 of /home/user/web/drupal-7/includes/database/database.inc).

Steps to reproduce:
* Create a new profile type
* Create a *new* field for this type
* Delete the type
* Bingo!

geerlingguy’s picture

Reconfirming fago's findings. I'm using migrate to import 'networks', each of which has an attached profile, and each profile has a few fields in it. When I try rolling back, I get errors... so instead of being able to import and roll back at-will, I'm stuck having to import, then revert the db, then import, etc... very annoying :-/

If I don't delete the network profiles on hook_node_delete(), the errors go away... but then I still need to delete created profiles, which is impossible in the interface as well (actually, I can sometimes delete a profile a few times, and it will eventually go away).

fago’s picture

Update - see #1007830-103: Nested transactions throw exceptions when they got out of scope. There is finally a patch with which it works.

fago’s picture

Status: Active » Postponed

With http://drupal.org/node/1007830#comment-5048304 committed this should be solved now once you are running the latest dev version of core.