Just ran the upgrade from 7.x-1.0-rc2 to the new full 7.x-1.0 and found all field_groups from all content types wiped out. I saw an earlier ticket marked as fixed for this but thought it best to start a new ticket since this is related to the new full release version.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

boringtao’s picture

got the same problems.

sachbearbeiter’s picture

the same

Stalski’s picture

Did you run update.php?
(7001 and ) 7002 should have fixed this problem. Thx in advance.

Stalski’s picture

Hey all.

For people who did not have the field group depending on ctools before, some bigger work is needed to save time. See #1095002: Upgrading removes all existing field groups. (http://drupal.org/node/1095002#comment-4241778).

For the majority coming from rc2, the update hook 7002 should be the only thing needed. However, as some problems were logged here, you might consider setting the heartbeat entry in the system table to a lower version so 7001 and 7002 can be run. This should create identifiers (new field in the database) for each field group row.

Stalski’s picture

Status: Active » Postponed (maintainer needs more info)

bumping this to get feedback as this is very critical and could even mean a new release is needed.

andreicio’s picture

Feedback:
I upgraded from rc2 to 1.0.
I ran update.php, but can't tell you what updates were applied or how many had to do with field_group.
I checked field_group table: `identifier` exists, all values are empty.
Set schema_version=7001 in the system table, re-ran update.php, 7002 was applied, succesfully generated identifiers.
All OK.

If there are 2 pending updates for a module, do they all run in sequence, or only the first one? Because in my case it's clear that the identifiers generation didn't work.

Stalski’s picture

Status: Postponed (maintainer needs more info) » Needs review

They do apply both, however, I detected a problem where I once at the beginning had an update hook called 7001, however it did make sense so removed it. Later on, I did add the first update hooks and it's possible people had 7001 already ran :(

Sorry for that. I do know that it's the identifiers that go wrong somehow (or the update hook creating them). I am investigating this a little further.

Thank you very much for the feedback! It's the answer I hoped for. (with a solution)

bryancasler’s picture

I can confirm that the solution in #6 works

molave’s picture

subscribe

Stalski’s picture

@molave: It should be fixed as the issue reads, however if you do still have problems, please provide steps for us to reproduce it.

jeffrey.dalton’s picture

Just an update... I took a fresh copy of our dev site and ran this again locally and it worked fine. Then I ran it on the dev site and it failed as described in #6 at which point I followed the steps in #6 and fixed the issue. I would say there is definitely still something amiss in the update script.

Thanks to andreicio for posting the fix steps

molave’s picture

@Stalski - Thanks, I appreciate the prompt reply. My issue is slightly different and only minor at this point (those warning messages that start with "Notice: Undefined property: stdClass::$identifier..."). I am already subscribed to the correct thread, but am subscribing anyway to related issues, too, as a precaution. Cheers...

scott.whittaker’s picture

Whoa, same issue here. The fix in #6 did seem to work, except that afterwards fieldsets inside vertical tabs are no longer rendered. I'm not referring to the CSS bug I identified earlier (http://drupal.org/node/1127988) - this time the fieldset markup is not even rendered into the page any more.

Have reverted back to rc2.

Mamouri’s picture

I had the same problem, and solution #6 works fine for me too.

ankur’s picture

Found the culprit.

function field_group_schema() in field_group.install incorrectly declares "identifier" as the key to ctools. It should be "id".

The attached patch (followed by a clearing of the cache) fixed the problem for me.

-Ankur

Stalski’s picture

Status: Needs review » Needs work

Well actually ctools suggest the unique string name and that is identifier. What I should do, i guess, is get rid of the primary key 'id' as it is a auto-increment integer that is not of real use here.

alex_ustinov’s picture

Solution #6 worked for me, thank you! You saved my day - have so many field groups on our site.

scottrouse’s picture

Nice. #6 worked perfectly for me. I was looking at quite a bit of work to rebuild all of those field groups. Thanks!

dboulet’s picture

Thanks for the pointer in #6, worked for me.

Stalski’s picture

Status: Needs work » Fixed

Hey all. the problem is that the update hook 7001 and 7002 will fix the problem. Appearantly there are still people who have already ran that function without having the identifiers.
I don't know for all cases what's the cause, but I'll create a 7003 update hook that also will invoke this identifier function. It is a reasonably harmless function that only recreates the identifiers. I really hope this problem is finally fixed for everyone.

astra’s picture

I got the same problem and want to try this way of #6. But I don't know What's the meaning for:

Set schema_version=7001 in the system table

How to do it? Anyone can help?

Thanks!

dboulet’s picture

Hi astra, try instead to upgrade to the latest dev release and make sure to run update.php, should fix the problem.

astra’s picture

It works now with the latest dev release. Thnaks!

Stalski’s picture

Status: Fixed » Closed (fixed)
Agileware’s picture

Status: Closed (fixed) » Active

Using 7.x-1.0-rc2 and upgrading to 7.x-1.1. All fieldgroups deleted upon running update.php.

nils.destoop’s picture

When you check your field_group table? Are the identifiers filled in?

If not, update hook 7002 or 7003 did not ran. If you can't select this update anymore in update.php, you can manually run it by calling '_field_group_recreate_identifiers();'

nils.destoop’s picture

Status: Active » Closed (works as designed)
Nephele’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Priority: Critical » Normal
Status: Closed (works as designed) » Needs review
FileSize
480 bytes

Unfortunately, this bug does still not appear to be truly fixed. I'm upgrading from 7.x-1.0-rc1 to 7.x-1.1, and still getting this problem -- field groups deleted, 'identifier' column in field_group table is empty, etc. Because the workaround in #6 works, I've downgraded the priority, but the fact is that the update code is still broken.

Furthermore, I subsequently retried the upgrade with the 7.x-1.x-dev code.. Not only did the identifiers fail to get created, but in addition 7.x-1.x-dev gives a nasty runtime error on the 7004 update: Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'identifier': ALTER TABLE {field_group} ADD UNIQUE KEY `identifier` (`identifier`); Array ( ) in db_add_unique_key() (line 2883 of drupal7/includes/database/database.inc). I was going to start a separate issue for this PDOException, but it turns out it's caused by the same underlying problem -- and more importantly is fixed by the same patch.

When I started testing the update with some debugging, I confirmed that during the original update, update_7001, update_7002, and update_7003 are all being called; _field_group_recreate_identifiers() is being called three separate times during the single update. So the problem is not that the updates are being skipped; the "fix" in #20 did not accomplish anything.

The actual problem is that after calling db_add_field() in update_7001, drupal's cached schema is never updated. Arguably, there's a core problem here -- either a bug or documentation failure (EDIT: #1617006: drupal_write_record() should say NOT to use it during hook_update_N added documentation stating that drupal_write_record() should not be used during update functions). Nevertheless, as far as current drupal code is concerned, the field_group table does not yet contain an identifier column -- and calling _field_group_recreate_identifiers a hundred times won't fix this problem. Instead, the schema has to be rebuilt.

The attached patch takes care of this. Based on my tests, update_7002 and update_7003 can also be eliminated now that the real source of the problem has been fixed, but I've left in them in place for now. The patch was rolled and tested on 7.x-1.x-dev, but it can also be applied to 7.x-1.1 if there are other people who need the fix but don't want to install dev code on their production site.

nils.destoop’s picture

Status: Needs review » Fixed

A little late, but this one is now committed. Nice catch

Status: Fixed » Closed (fixed)

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

  • Commit cff4e02 on 7.x-1.x, 8.x-1.x authored by Nephele, committed by zuuperman:
    Issue #1169146 by ankur, Nephele | jeffrey.dalton: Fixed upgrade from 7....