-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade from v3.4.4 to v3.6.2 loses data on the address table #103
Comments
@bruno-canada There were several updates to addresses between these two releases. We did have a scenario where some draft entries were orphaned in the address table after the Drafts were deleted. It's not clear from your question but can you confirm if you are seeing all the addresses you expect to see in the CP or if the discrepancy is indicative that several addresses you expect to be able to see have been deleted? For reference, the most significant migration was this one m200102_000000_remove_address_field_content_column_sproutfields And the new public function deleteUnusedAddresses()
{
$addressIdsWithDeletedElementIds = (new Query())
->select('addresses.id')
->from('{{%sproutfields_addresses}} addresses')
->leftJoin('{{%elements}} elements', '[[addresses.elementId]] = [[elements.id]]')
->where(['elements.id' => null])
->column();
Craft::$app->db->createCommand()
->delete('{{%sproutfields_addresses}}', [
'id' => $addressIdsWithDeletedElementIds
])
->execute();
} Please let me know if you feel any content has been incorrectly deleted and we can dig in more. If so, can you please send a copy of your db over to sprout@barrelstrengthdesign.com to help troubleshoot? |
@BenParizek Thank you for taking the time to reply. Your information is very valuable. Here are my finding.
|
@bruno-canada My apologies for the delay here. I just release a blocking update that I was working on and will be taking a closer look at this shortly. I believe you've identified the issue and we'll need to update that migration to address matrix blocks as well. |
@BenParizek It has been 14 days since we heard from you. This is creating unnecessary stress with the client. Please, advise. |
@bruno-canada I've just released Sprout Fields v3.8.1 which should address the bug in this migration. You'll need to re-run the update as the fix had to happen in the original migration. Thanks for your detailed report. It helped identify the issue and figure out what was going on. This latest release adds support for both Matrix Fields and SuperTable fields. This will also address the logic with multiple fields using the same handle. The code here is not dropping the field itself but the old table column for each field as each of these use field contexts (global, matrixBlock, superTableBlock) all use different content tables (previously, some address data was stored in the content table column but that is no longer necessary). |
Description
We have upgraded the package from 3.4.4 to 3.6.2. Before the upgrade, our table craft_sproutfields_addresses had 932 records, after the upgrade 47 in the new table craft_sprout_addresses.
Any idea what is the reason?
Additional info
Front conversations
The text was updated successfully, but these errors were encountered: