Needs review
Project:
Default Content
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Jan 2017 at 15:58 UTC
Updated:
26 May 2022 at 20:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andypostThat's needs more discussion about is this really needed and a way to do that
Comment #3
cweagansLooks like there was some advice on the linked PR for how to handle this. If I re-do this with the suggested method, would the patch be accepted? We need this for our D8 distro.
Comment #4
piggito commentedI created a patch for current dev branch based in the PR mentioned in issue summary
Comment #5
andypostplease move usage of \Drupal:: out of loop, also I suggest to use early return if config sync happening
Also todo looks pointless
Please don't use reflection here, there's \Drupal\Core\Entity\EntityTypeInterface::entityClassImplements() for that
Also not sure the check is right for config, so better to check for \Drupal\Core\Entity\FieldableEntityInterface or \Drupal\Core\Entity\ContentEntityInterface
Better to load all entities and delete them multiple
Comment #6
andypostYou're missing to
$this->accountSwitcher->switchBack();at the end and not sure why it needs to login as UID1Comment #7
piggito commentedFixed comments in #5 and #6
Comment #8
andypostplease index this array with uuid to prevent loading same entities and delete bugs
Comment #9
piggito commentedFixed last comment
Comment #11
agentrickardFWIW, in our workflow, putting this in uninstall would be very bad. We enable this module, import content, and then disable it, hal, and serialization.
More ideally this would be a drush command, see #3282547: Drush command to delete and reimporting default content,