Fixed AbstractFieldMap doesn't handle entities with string IDs

Shinka

Member
Affected version
2.0.9
I have created an entity Atom, which has a varbinary primary key. In attempting to integrate custom fields behavior into my entity, I encountered an issue where AbstractFieldMap#updateFieldAssociations only accounts for numeric primary keys.

PHP:
$emptyKey = array_search(0, $contentIds);
if ($emptyKey !== false)
{
    unset($contentIds[$emptyKey]);
}

For a workaround, I have added a value of 0 to the beginning of my $contentIds.

For a permanent solution, I don't see why setting array_search to strict mode wouldn't work.

PHP:
$emptyKey = array_search(0, $contentIds, true);
if ($emptyKey !== false)
{
    unset($contentIds[$emptyKey]);
}
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.4).

Change log:
Handle string IDs in the abstract field map class when updating field associations.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Back
Top Bottom