Skip to content

IBX-12460: Fixed external storage data not being deleted for legacy field type identifiers - #827

Open
Sztig wants to merge 2 commits into
5.0from
IBX-12460-external-storage-field-identifier-fix
Open

Sztig wants to merge 2 commits into
5.0from
IBX-12460-external-storage-field-identifier-fix

Conversation

@Sztig

@Sztig Sztig commented Sep 14, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12460

Description:

When field types were renamed in 5.0 (ezimage -> ibexa_image etc.), the old names are still in use and kept in the data_type_string column for the content that already existed (given that the ibexa instance was upgraded from 4.x to 5.0).

Deletion of content has a bug - it does not recognize old data types registered storage types giving them all NullStorage, in consequence when deleting content the external data is not being processed.

Fix: FieldHandler now runs the gateways result through FieldTypeAliasResolver before handing anything to the storage handler. We are running same values with just updated keys to match new filed types naming.

Regarding the tests - FieldHandlerTest cover the resolution and merging for all seven affected types. Two integration tests cover the actual flow when deleting the content: they publish content, put the legacy identifier back in the database to reproduce an unmigrated installation, delete the content and then check if the external data is really gone.

Additional note - this only fixes the deletion mechanism, no cleanup of old data was addressed here.

For QA:

Documentation:

@Sztig
Sztig requested a review from a team September 14, 2026 11:52
@Sztig
Sztig force-pushed the IBX-12460-external-storage-field-identifier-fix branch from b0c62e4 to f4d462a Compare September 16, 2026 08:18
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
36.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@Sztig

Sztig commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Code analysis fails due to the tests already being marked for code duplication before my additions, to fix that I would need to completely refactor these 3 test classes

$this->assertImageExists(false, $ioService, $content);
}

private function downgradeFieldTypeIdentifierToLegacyAlias(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downgradeFieldTypeIdentifierToLegacyAlias() is duplicated in UserIntegrationTest.php (only the hardcoded value differs). It might be worth hoisting it to BaseIntegrationTestCase, but not blocking if you'd rather keep it local.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants