Skip to content
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

Replace usage of in_array() in MigrateExecutable::handleMissingSourceRows #5766

Open
wants to merge 2 commits into
base: 12.x
Choose a base branch
from

Conversation

mdolnik
Copy link

@mdolnik mdolnik commented Sep 25, 2023

PR to fix #5765

…urceRows().

Adds a new method getSourceIdKey() to serialize the source ID data into a unique key for retrieval later.

Refer to drush-ops#5765
*/
protected function getSourceIdKey(array $source_id): string
{
return implode('-', $source_id);
Copy link
Member

Choose a reason for hiding this comment

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

I wonder how safe is this

Copy link
Author

Choose a reason for hiding this comment

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

I don't know the full extent of what is possible to appear in the $source_id array values, but from my investigation it is mostly entity IDs, revision IDs, and simple strings. Of which, most cases involve one or two values.

I am open to alternate ways of serializing the array values into a unique key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace usage of in_array() in MigrateExecutable::handleMissingSourceRows
3 participants