- Issue created by @joachim
- 🇬🇧United Kingdom joachim
I've hit a bit of a problem with this, as a redirect processor needs the remote entity ID in order to assemble a canonical URI for the entity on the server, which it can then use to query for the relevant redirect entities.
However, by the time we get to processEntity() in the processor, DefaultDataProcessor::prepareImportableEntityData() has already removed the "drupal_internal__id" key from the attributes array, so we've lost the remote entity ID!
Could a copy of the original incoming JSON data be set in the JSON array, say at '_attributes_original'?
- 🇫🇷France Grimreaper France 🇫🇷
Hi,
Can a redirect processor implements prepareImportableEntityData method and execute it before DefaultDataProcessor so it can store needed data for a later stage execution?
- 🇬🇧United Kingdom joachim
Oh yeah, good point!
I did that with the PathAliasProcessor too.
But TBH it's pretty messy -- plugins shouldn't be storing state data like this.
Also, the 'prepare_importable_entity_data' stage is the same one in which DefaultDataProcessor removes the remote IDs, so it means that the RedirectProcessor **must** run before it -- that's pretty brittle.