Problem/Motivation

Content that needs update or new content doesn't have to require a module/profile install in order to be imported. Normally it should be easy to make changes on content or add new content even the site is on production.

Proposed resolution

Add 2 new Drush commands:

  1. default-content-import-module: Imports or updates all the content provided by a module or profile.
  2. default-content-import: Imports or updates the content provided by all enabled modules and default profile.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#142 2640734-warning-about-missing-dependencies.patch771 bytesbladedu
#136 2640734-136.interdiff.txt1.03 KBneclimdul
#136 2640734-136.patch27.06 KBneclimdul
#135 2640734-135.patch26.86 KBneclimdul
#128 default_content-allow_reimport-2640734-124.diff18.52 KBxurizaemon
#127 default_content-allow_reimport-2640734-124.patch43.02 KBxurizaemon
#115 default_content-allow_reimport-2640734-115.patch17.34 KBDonAtt
#114 default_content-allow_reimport-2640734-114.patch17.34 KBbarig
#113 drupal_default_content-2640734-Allow-manual-imports.patch18.74 KBxurizaemon
#110 default_content-2640734-allow_manual_import-110.patch16.93 KBrowrowrowrow
#109 default_content-2640734-allow_manual_import-108.patch16.79 KBrowrowrowrow
#105 default_content-2640734-allow_manual_import-105.patch13.58 KBsiegrist
#102 default_content-2640734-allow_manual_import-102.patch13.04 KBbgilhome
#98 2640734-98.default_content.Allow-manual-imports.patch12.88 KBsvetoslav.dragoev
#97 2640734-97.default_content.Allow-manual-imports.patch12.86 KBsvetoslav.dragoev
#94 2640734-94.default_content.Allow-manual-imports.patch12.85 KBmuldos
#93 interdiff.2640734.85-93.txt1.05 KBjurgenhaas
#93 2640734-93.default_content.Allow-manual-imports.patch12.83 KBjurgenhaas
#88 interdiff.2640734-88.txt2.69 KBneclimdul
#88 default_content-allow_manual_imports-2640734-88.patch12.66 KBneclimdul
#87 interdiff.2640734-87.txt2.72 KBneclimdul
#87 default_content-allow_manual_imports-2640734-87.patch26.15 KBneclimdul
#83 default_content-allow_manual_imports-2640734-74-reroll.patch12.58 KBdas-peter
#74 default_content-allow_manual_imports-2640734-74.patch12.99 KBvalidoll
#74 interdiff-2640734-67-74.txt4.65 KBvalidoll
#72 default_content-allow_manual_imports-2640734-72.patch12.68 KBvalidoll
#72 interdiff-2640734-67-72.txt4.38 KBvalidoll
#67 interdiff-63-67.txt2.56 KBantonnavi
#67 allow_manual_imports-2640734-67.patch12.25 KBantonnavi
#63 interdiff.txt3.24 KBpiggito
#63 allow_manual_imports-2640734-63.patch13.02 KBpiggito
#61 2640734-61.patch11.8 KBantonnavi
#57 interdiff-2640734.txt7.88 KBdawehner
#57 2640734-57.patch11.92 KBdawehner
#52 allow_manual_imports-2640734-52.patch7.8 KBkalpaitch
#48 allow_manual_imports-2640734-48.patch5.74 KBpiggito
#2 2640734-2.patch3.1 KBclaudiu.cristea
#5 allow_manual_imports-2640734-5.patch5.76 KBclaudiu.cristea
#5 interdiff.txt7.45 KBclaudiu.cristea
#7 allow_manual_imports-2640734-7.patch5.77 KBid.tarzanych
#7 interdiff-2640734-5-7.txt747 bytesid.tarzanych
#11 allow_manual_imports-2640734-11.patch6.04 KBkeesje
#18 interdiff-2640734-7-11.txt1.26 KBkeesje
#20 interdiff-2640734-7-11_1.txt1.43 KBkeesje
#22 allow_manual_imports-2640734-22.patch7.88 KBkalpaitch
#22 interdiff-2640734-11-22-do-not-test.diff6.29 KBkalpaitch
#38 allow_manual_imports-2640734-38.patch5.45 KBkalpaitch
#38 interdiff-2640734-22-38-do-not-test.diff6.6 KBkalpaitch
#41 allow_manual_imports-2640734-41.patch5.95 KBao2
#41 interdiff-2640734-38-41-do-not-test.diff3.33 KBao2
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Title: Allow manual regular imports » Allow manual imports
Status: Active » Needs review
StatusFileSize
new3.1 KB

Patch.

claudiu.cristea’s picture

Issue summary: View changes

IS change.

sam152’s picture

  1. +++ b/drush/default_content.drush.inc
    @@ -97,3 +109,42 @@ function drush_default_content_export_module($module_name) {
    +  if (!\Drupal::isConfigSyncing()) {
    

    Perhaps this check should be moved into the importContent if it's important? Currently it's checked twice in the drush file.

  2. +++ b/drush/default_content.drush.inc
    @@ -97,3 +109,42 @@ function drush_default_content_export_module($module_name) {
    +function drush_default_content_import_module_validate($module) {
    

    Could this same validation be used by the other drush commands that take a module as an argument?

  3. +++ b/drush/default_content.drush.inc
    @@ -97,3 +109,42 @@ function drush_default_content_export_module($module_name) {
    +    return drush_set_error('INEXISTENT_MODULE', dt("Module or profile '@module' doesn't exist or is uninstalled.", ['@module' => $module]));
    

    Is INEXISTENT_MODULE a drush thing? Is non-existent meant here?

  4. +++ b/drush/default_content.drush.inc
    @@ -97,3 +109,42 @@ function drush_default_content_export_module($module_name) {
    + * Imports or updates the content provided by all enabled modules and default
    + * profile.
    

    Nit: short-descriptions should be one line.

  5. +++ b/src/DefaultContentManager.php
    @@ -213,6 +213,11 @@ class DefaultContentManager implements DefaultContentManagerInterface {
    +          // Allow existing entities overwrite. Delete first an existing entity
    +          // with the same uuid.
    +          if ($existing_entity = $this->entityManager->loadEntityByUuid($entity_type_id, $entity->uuid())) {
    +            $existing_entity->delete();
    +          }
    

    Would be good to get some more eyes over this.

claudiu.cristea’s picture

StatusFileSize
new5.76 KB
new7.45 KB

#4.1: It's not used twice in Drush but in .module. I don't see the reason for that check, thus I removed from patch. Moving in import is out of scope of this issue.

#4.2: OK, I added the validation to the other command event it's off-topic for this issue.

#4.3: OK, changed to INVALID_MODULE.

#4.4: Fixed.

#4.5: Someone could argue that removing the existing entity is not correct because the overridden data should rather be a new revision of the existing entity (in case of revisionables). Well, this is very complex to implement (I tried) because the object resulted from decoding doesn't fit the existing object even they are the same. This is a problem of the entity system, specifically of how \Drupal\Core\Field\FieldItemListInterface::equals() works. For example if a node entity is imported, the existing entity $node->path value is an empty array [] while the decoded value is ['alias' => NULL, 'pid' => NULL]. For such a case, a new revision will be created and this is wrong. We don't want to create new revisions unless a real, human-signifiant, change has been made.

But this would be to much as for default_content entities we already have the "revisioning" assured in code (because the code is in a VCS). To get a reasonable compromise, I added a new parameter to importContent().

interface DefaultContentManagerInterface {
  ...
  public function importContent($module, $update_existing = FALSE);
  ...
}

This prevents overriding by default.

ademarco’s picture

+++ b/src/DefaultContentManager.php
@@ -213,8 +213,16 @@ class DefaultContentManager implements DefaultContentManagerInterface {
+          $existing_entity = $this->entityManager->loadEntityByUuid($entity_type_id, $entity->uuid());

Shouldn't this be $this->entityRepository->loadEntityByUuid(...) ?

id.tarzanych’s picture

StatusFileSize
new5.77 KB
new747 bytes

Worked for me. Thanks!

Created a fixed patch for those who need a link to file.

claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

Great! I'm moving this to RTBC as @id.tarzanych confirmed that works as expected and all review points were addressed.

keesje’s picture

#7 confirmed as working, great!
I doubt the "$existing_entity->delete();" part though. For standalone entities this is OK, but what about references?
Case:
Import terms. Use these for tagging nodes (adding references from nodes to terms). Than "update" these terms by delete followed by save. All references would be gone right? This is not updating, this is re-adding, which can be OK in some cases.

keesje’s picture

This patch has a more intelligent "update" handling of existing entities: https://www.drupal.org/node/2698425#comment-11377803

keesje’s picture

damontgomery’s picture

Tested #11 and it seems good. It fixes several issues we've had.

- Can install a content module on a site where the node already existed without throwing an error.
- Can install new content once the module has already be run by executing the drush command.

keesje’s picture

Status: Needs review » Reviewed & tested by the community
realgt’s picture

After applying patch #11 i was able to run the import once, but on the second time i was unable to access /admin/content and got the same error listed here: http://drupal.stackexchange.com/questions/200492/can-not-access-contents...

Recoverable fatal error: Argument 1 passed to Drupal\views\Plugin\views\field\EntityOperations::getEntityTranslation() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /mnt/www/html/secgovstg/docroot/core/modules/views/src/Plugin/views/field/EntityOperations.php on line 111 and defined in Drupal\views\Plugin\views\field\EntityOperations->getEntityTranslation() (line 69 of /mnt/www/html/secgovstg/docroot/core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php).

keesje’s picture

Status: Reviewed & tested by the community » Needs review

Interesting, van you add steps to reproduce please?

claudiu.cristea’s picture

@keesje, are so kind to provide an interdiff for #11 against #7?

claudiu.cristea’s picture

keesje’s picture

StatusFileSize
new1.26 KB

Like this?

claudiu.cristea’s picture

Not exactly :) See https://www.drupal.org/documentation/git/interdiff. We create interdiffs on each patch, even the change is very small, because it help reviewers to understand the changes from the previous patch.

keesje’s picture

StatusFileSize
new1.43 KB

Check, thanks.

codium’s picture

Tested #11, complex entity (nested entity references), works smoothly

kalpaitch’s picture

Very nice indeed @keesje, works like a dream. I have a complex setup as well with paragraphs and file entities.

I have a few small updates to this patch because I'm a pedant:

  • Have removed the phpdoc @return declaration from the drush command functions because returning boolean and void is not particularly pleasant :)
  • Have moved the !empty()check from the _drush_default_content_valid_module() function and made $module a required param on the basis that it seems a bit frivolous to check whether a non-existent module is a valid module :)
  • Have renamed the new import commands (and added an export all command) on the basis that the naming was inconsistent: 'default-content-export' exports just a single entity and 'default-content-import' imports all entities, confused me a little.
  • Added the new export all command to make triggering of single/multiple module imports/exports consistent, and because it would be a useful addition... contentious.
jfcolomer’s picture

Status: Needs review » Reviewed & tested by the community

#22 Manually import working great, thanks!

andypost’s picture

Status: Reviewed & tested by the community » Needs work

It needs work, for translations and revisions

  1. +++ b/drush/default_content.drush.inc
    @@ -93,15 +117,112 @@ function drush_default_content_export_references($entity_type_id, $entity_id = N
    - * Exports all of the content for a given module.
    + * Exports all of the content for a given module and default profile.
    

    I see no profile involved...

  2. +++ b/drush/default_content.drush.inc
    @@ -93,15 +117,112 @@ function drush_default_content_export_references($entity_type_id, $entity_id = N
    +  if (empty($modules) || !is_array($modules)) {
    +    $modules = array_keys(\Drupal::config('core.extension')->get('module'));
    

    I'd better export nothing if no modules passed, so where is a profile?

  3. +++ b/drush/default_content.drush.inc
    @@ -93,15 +117,112 @@ function drush_default_content_export_references($entity_type_id, $entity_id = N
    +  $t = \Drupal::translation();
    ...
    +      drush_log($t->formatPlural($count, '@module: 1 entry exported', '@module: @count entries exported', ['@module' => $module]), LogLevel::OK);
    ...
    +    drush_log($t->formatPlural($total, 'Total: 1 entry exported', 'Total: @count entries exported'), LogLevel::OK);
    

    No need, just use new PluralTranslatableMarkup

  4. +++ b/src/DefaultContentManager.php
    @@ -220,8 +220,25 @@ class DefaultContentManager implements DefaultContentManagerInterface {
    -          $created[$entity->uuid()] = $entity;
    +          ¶
    +          // Allow existing entities overwrite.
    

    nit, trailing writespace

  5. +++ b/src/DefaultContentManager.php
    @@ -220,8 +220,25 @@ class DefaultContentManager implements DefaultContentManagerInterface {
    +              try {
    +                $entity->setNewRevision(FALSE);
    +              } catch (\LogicException $e) {}
    

    better to check that entity supports this method, check core's RevisionableInterface

andypost’s picture

also better split that patch because it does not what subject said

ao2’s picture

Hi,

it is worth noting that importing existing users (in particular the admin user) works only on the same site installation.

For instance, this works:

$ drush default-content-export-references --folder=profiles/my_profile/content node
$ drush default-content-import-modules --update
my_profile: 4 entries imported                                                                                             [ok]
Total: 4 entries imported

However importing some previously exported content into a new site does not work, at least not when importing the admin user if any node references it.

To reproduce, install using a profile without content, and then try to import some exported nodes authored by admin:

$ cp ../previously_exported_content profiles/my_profile/content
$ drush default-content-import-modules --update
Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key       [error]
...

This is not specific to manual import tho, it happens also at install time if the profile provides the content/ dir, I am just mentioning the issue here to make people aware; see #2698425-4: Do not re-import existing entities and #2698425-19: Do not re-import existing entities for more details.

Thanks,
Antonio

ao2’s picture

BTW, the cp command in the example above also suggest that some import command which accepts a --folder option could make sense, for symmetry with default-content-export-references.

larowlan’s picture

Feels like we're moving beyond the realm of default content here, into the deploy realm.

I'm not keen to introduce additional complexity to support use-cases that are beyond the scope of the module.

Can you convince the maintainers that this is in fact for default content and not for deploying?

keesje’s picture

@larowlan valid point!

claudiu.cristea’s picture

@larowlan, but with config you can provide "default config" and then "config updates". Why shouldn't this be possible with content at least in a limited way? I know that content deploy and staging is a more complex issue (covered by https://www.drupal.org/project/deploy suite). Here what we want to achieve is when we have some default content installed with default_content, we want be able to pull changes from code.

EDIT:

Use case: A simple presentation site with 2-3 pages. I want to be able to change the About page locally and then push changes to production via Git.

ao2’s picture

Regarding my own comments, my point was just that default_content should be able to re-import (either manually or at install time) whatever has been previously exported.

If it exports the admin user because it was referenced by some node, I'd expect it to be able to re-import it.

My use case would be to share a baseline site (an installation profile with config and some default content) to make it easier to demonstrate bugs, or to create themes.

andypost’s picture

Personally I like to see issue with uid (0|1) fixed in separate in
#2698425: Do not re-import existing entities or #2815051: Skip exporting core users by default

larowlan’s picture

Ok, thanks - seems reasonable @claudiu.cristea

Agree with @andypost that the existing issues cover the pain points around admin user.

Algeron’s picture

In case anyone else is having errors related to importing entity reference revisions, see #2848029: Prevent duplicate revisions by checking whether a host entity is already saved

andypost’s picture

Just tested that on project, and discovered that domain_access module blocking loading nodes so this command require UID=1 switch and tests

  1. +++ b/src/DefaultContentManager.php
    @@ -220,8 +220,25 @@ class DefaultContentManager implements DefaultContentManagerInterface {
               $entity->enforceIsNew(TRUE);
    ...
    +          else {
    +            $entity->enforceIsNew(TRUE);
    +          }
    

    called twice

  2. +++ b/src/DefaultContentManager.php
    @@ -220,8 +220,25 @@ class DefaultContentManager implements DefaultContentManagerInterface {
    -          $created[$entity->uuid()] = $entity;
    +          ¶
    +          // Allow existing entities overwrite.
    

    trailing spaces

  3. +++ b/src/DefaultContentManager.php
    @@ -220,8 +220,25 @@ class DefaultContentManager implements DefaultContentManagerInterface {
    +              $entity->setOriginalId($old_entity->id());
    +              $entity->enforceIsNew(FALSE);
    

    setOriginalId() already calls next line internally

  4. +++ b/src/DefaultContentManager.php
    @@ -220,8 +220,25 @@ class DefaultContentManager implements DefaultContentManagerInterface {
    +              try {
    +                $entity->setNewRevision(FALSE);
    +              } catch (\LogicException $e) {}
    

    there should be check for revisionable interface and somehow bc for core 8.3.x

  5. +++ b/src/DefaultContentManagerInterface.php
    @@ -20,11 +20,13 @@ interface DefaultContentManagerInterface {
    -  public function importContent($module);
    +  public function importContent($module, $update_existing = FALSE);
    

    I'd prefer that as separate patch #2698425: Do not re-import existing entities

kalpaitch’s picture

Thanks Andy, could we clear up point 5 first. This ticket has a lot to do with #2698425: Do not reimport existing entities because the work for that ticket was originally done on this ticket. So as @vijaycs85 points out we either have to remove it from this ticket or combine the two together.

If we remove it, we have to block this ticket until that one is merged, so that we can correctly add the flag to the drush command. Also if we remove it I think it would be good to put your points 1-4 on that ticket and not this.

Happy either way, just trying to avoid blocking one ticket for too long.

Either way it would be good to have tests that cover the import. I guess this should really have been done previously so could either be covered by another ticket or by #2698425: Do not reimport existing entities.

kalpaitch’s picture

Oh yea and in regards to tests, it might be quite good to convert them to PHPUnit tests before we get too far.Or at least write the new tests in PHPUnit.

kalpaitch’s picture

Status: Needs work » Needs review
StatusFileSize
new5.45 KB
new6.6 KB

As has been suggested by a few people, here is a patch that separates the other import issues. Of course this only provides drush commands now, so all comments on import bugs can be raised separately or on existing tickets https://www.drupal.org/node/2698425 and https://www.drupal.org/node/2815051

The last submitted patch, 38: allow_manual_imports-2640734-38.patch, failed testing.

ao2’s picture

Status: Needs review » Needs work

The patch does not apply cleanly anymore after commit 11fa54825b611dc280dd0621b090c2b53dea0f29

ao2’s picture

StatusFileSize
new5.95 KB
new3.33 KB

I rebased the patch on the latest code.

A normal interdiff between the two patches didn't work, but I am attaching a diff between the them, the changes since #38 are:

  • the addition of the run-as option
  • the consequent addition of the _drush_default_content_setup(); and _drush_default_content_teardown(); calls in drush_default_content_export_modules and drush_default_content_import_modules
  • patch context updates
ao2’s picture

Status: Needs work » Needs review
kalpaitch’s picture

Status: Needs review » Reviewed & tested by the community

All looks super good. Reviewed and tested.

One thing, we should make this depend on #2698425: Do not reimport existing entities getting in. And then add the 'update' flag to all drush import commands.

getu-lar’s picture

I also successfully reviewed and tested this together with #2698425.

andypost’s picture

I'd like to commit more complicated issue first #2614644: Split DefaultContentManager into Exporter and Importer

ao2’s picture

In the meantime I am hiding the patch from #41 (because of #2857589: Remove the run-as option in drush commands) and showing again the one from #38, which applies again on the latest 8.x-1.x branch.

larowlan’s picture

Yep, let's get the split in first, please help with rerolls and reviews over there

piggito’s picture

StatusFileSize
new5.74 KB

I generated a new patch for those like me who want a drush command to update the default content right now.
This patch adjusts the work in #38 to the changes in https://www.drupal.org/node/2698425#comment-12001085
and allows to update content using the option update_existing in "drush default-content-import-module" and "drush default-content-import-modules"

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 48: allow_manual_imports-2640734-48.patch, failed testing.

andypost’s picture

dawehner’s picture

Note: https://github.com/larowlan/default_content/pull/60 does something similar but instead moves most of the logic into the Importer class, so as such makes is much easier to test.

kalpaitch’s picture

StatusFileSize
new7.8 KB

Cool, I think it would be good to try to get this one in first as there are quite a few tickets that could use or extend this. As a result I've stripped out all the functionality not directly related to adding a manual import command. Will raise any separate issues as needed.

@piggito I'm with you on wanting the update flag in right now, but in the interests of keeping issues separate I haven't added to the re-roll as per #36.

@dawehner agreed, getting as much logic into the importer and exporter classes will allow other UIs to use in the future. Updated with the re-roll.

kalpaitch’s picture

Status: Needs work » Needs review

No interdiff on that last patch because it's a complete re-roll. Everything's moved.

dawehner’s picture

@kalpaitch
Do you want to pull in my test coverage as well? I strongly believe this would be valueable here :)

kalpaitch’s picture

@dawehner I think your dead right, but really these are just drush commands. If it's alright I've added this to #2868710: Add tests for Importer to improve the test coverage of this new Importservice...

dawehner’s picture

It is a bit hard to see why we don't pull them from https://github.com/dawehner/default_content/blob/import-command/tests/sr... directly :)

dawehner’s picture

StatusFileSize
new11.92 KB
new7.88 KB
  1. +++ b/drush/default_content.drush.inc
    @@ -107,3 +128,57 @@ function drush_default_content_export_module($module_name) {
    + *
    + * @param string $module_name
    ...
    +function drush_default_content_import_module($module) {
    

    Documentation no longer matches the signature.

  2. +++ b/src/Importer.php
    @@ -201,6 +212,17 @@ class Importer implements ImporterInterface {
    +    $profile_name = drupal_get_profile();
    

    We could inject the installation profile container parameter.

  3. +++ b/src/Importer.php
    @@ -201,6 +212,17 @@ class Importer implements ImporterInterface {
    +    return array_reduce(array_unique($module_names + [$profile_name]), function (array $entities, $module_name) {
    +      return array_merge($entities, $this->importContent($module_name));
    +    }, []);
    

    I added some documentation on top of it, to make it clear what this method tries to do. Yeah for using array_reduce().

  4. +++ b/src/ImporterInterface.php
    @@ -18,4 +18,12 @@ interface ImporterInterface {
    +   * @return array[\Drupal\Core\Entity\EntityInterface]
    

    That is a weird syntax for a list of entities. I used the other one which is already used in the same file.

larowlan’s picture

+++ b/tests/src/Kernel/ImporterIntegrationTest.php
@@ -0,0 +1,108 @@
+  } ¶

nit, whitespace issue

Otherwise, looking good - can be fixed on commit

andypost’s picture

Issue tags: -Needs reroll

#58 could be fixed on commit, it conflicts with another patch #2698425: Do not re-import existing entities
Guess to commit that later

+++ b/src/Importer.php
@@ -201,6 +222,17 @@ class Importer implements ImporterInterface {
+  public function importAllContent() {
...
+    return array_reduce(array_unique($module_names + [$this->installProfile]), function (array $entities, $module_name) {
+      return array_merge($entities, $this->importContent($module_name));

That may need another argument to pass after #2698425: Do not re-import existing entities

andypost’s picture

Issue tags: +Needs reroll
antonnavi’s picture

Issue tags: -Needs reroll
StatusFileSize
new11.8 KB

Reroll-ed

Status: Needs review » Needs work

The last submitted patch, 61: 2640734-61.patch, failed testing.

piggito’s picture

StatusFileSize
new13.02 KB
new3.24 KB

It seems like the ImportIntegrationTest wasn't considering 2 nodes in default_conten_test and caused patch #61 to fail. I worked over patch #61 and fixed the test.

piggito’s picture

Status: Needs work » Needs review
andypost’s picture

Assigned: Unassigned » larowlan

Looks good to me, imo we should get this in before #2698425: Do not re-import existing entities

larowlan’s picture

Status: Needs review » Needs work
+++ b/tests/src/Kernel/ImporterIntegrationTest.php
@@ -0,0 +1,118 @@
+    $this->assertInstanceOf(TermInterface::class, $entities['550f86ad-aa11-4047-953f-636d42889f85']);
+    $this->assertInstanceOf(NodeInterface::class, $entities['65c412a3-b83f-4efb-8a05-5a6ecea10ad4']);
+    $this->assertInstanceOf(NodeInterface::class, $entities['78c412a3-b83f-4efb-8a05-5a6ecea10ad4']);
+    $this->assertInstanceOf(NodeInterface::class, $entities['78c412a3-b83f-4efb-8a05-5a6ecea10aee']);
+
+    $this->assertCount(4, $entities);
+    // Ensure the content can be actually loaded.
+    $this->assertEquals('A tag', Term::load($entities['550f86ad-aa11-4047-953f-636d42889f85']->id())->label());
+    $this->assertEquals('Imported node', Node::load($entities['65c412a3-b83f-4efb-8a05-5a6ecea10ad4']->id())->label());
+    $this->assertEquals('Imported node with owned by user 1', Node::load($entities['78c412a3-b83f-4efb-8a05-5a6ecea10ad4']->id())->label());
+    $this->assertEquals('Imported node with owned by user that does not exist', Node::load($entities['78c412a3-b83f-4efb-8a05-5a6ecea10aee']->id())->label());
...
+    $this->assertInstanceOf(TermInterface::class, $entities['550f86ad-aa11-4047-953f-636d42889f85']);
+    $this->assertInstanceOf(NodeInterface::class, $entities['65c412a3-b83f-4efb-8a05-5a6ecea10ad4']);
+    $this->assertInstanceOf(NodeInterface::class, $entities['78c412a3-b83f-4efb-8a05-5a6ecea10ad4']);
+    $this->assertInstanceOf(NodeInterface::class, $entities['78c412a3-b83f-4efb-8a05-5a6ecea10aee']);
+
+    $this->assertCount(4, $entities);
+    // Ensure the content can be actually loaded.
+    $this->assertEquals('A tag', Term::load($entities['550f86ad-aa11-4047-953f-636d42889f85']->id())->label());
+    $this->assertEquals('Imported node', Node::load($entities['65c412a3-b83f-4efb-8a05-5a6ecea10ad4']->id())->label());
+    $this->assertEquals('Imported node with owned by user 1', Node::load($entities['78c412a3-b83f-4efb-8a05-5a6ecea10ad4']->id())->label());
+    $this->assertEquals('Imported node with owned by user that does not exist', Node::load($entities['78c412a3-b83f-4efb-8a05-5a6ecea10aee']->id())->label());

these lines are duplicated, please move them to a method such as doImportTests and call it in both places

antonnavi’s picture

Status: Needs work » Needs review
StatusFileSize
new12.25 KB
new2.56 KB

Patch was updated: Duplicated code in test was moved to the separated method.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/tests/src/Kernel/ImporterIntegrationTest.php
@@ -72,14 +72,12 @@
+   *
+   * @param array $entities
+   *   Entities list to test.

Nitpick: You could use TermInterface[] here, but this is a super minor change to be honest.

aless86’s picture

#67 works for me! When the patch could be applied?

kalpaitch’s picture

Awesome, looks good.

larowlan’s picture

Assigned: larowlan » Unassigned
Issue tags: +Release blocker

Yep, this can go in before the next release

validoll’s picture

validoll’s picture

Status: Reviewed & tested by the community » Needs review
validoll’s picture

StatusFileSize
new4.65 KB
new12.99 KB

Forgot add 'extra' section to composer.json

5n00py’s picture

Hi, everyone.
Does this patch supports re-import of entities ?
I have following error on `drush dcia`

Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY': INSERT INTO {block_content} (id, revision_id, type,            
uuid, langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4);
eelkeblok’s picture

That would be #2698425: Do not re-import existing entities (I do believe it also supports updating existing entities, despite the title).

eelkeblok’s picture

Would it make sense to commit this first as #67 and add the Drush 9 stuff in a separate issue? Sorry, disregard. Drush 9 support has been added to the existing drush commands, so it only makes sense to have newly added drush commands to support it too.

timwood’s picture

Patch from #74 doesn't apply to -dev anymore. Anyone have time / knowledge to re-roll?

timwood’s picture

Status: Needs review » Reviewed & tested by the community

After a quick look I realized the changes to composer.json were previously committed in https://cgit.drupalcode.org/default_content/commit/?id=a3bc209 for issue https://www.drupal.org/node/2826455. Just that bit needed to be removed for the patch to apply cleanly.

I've made the patch from #72 the most current and hidden #74 as the only difference between the two was the extras section in composer.json.

timwood’s picture

When running the drush dcia command provided by this patch, if the default content user directory doesn't exist (perhaps because you are using the patch from https://www.drupal.org/project/default_content/issues/2815051), the following error occurs.

 [error]  RecursiveDirectoryIterator::__construct(modules/custom/mfgusa_deploy/content/user): failed to open dir: No such file or directory 

If the directory exists and is empty, no such error occurs.

larowlan’s picture

Status: Reviewed & tested by the community » Needs work

no new patch?

timwood’s picture

Sorry, I'm unable to contribute a patch to help resolve the error I mentioned. I also realize that the functionality from the other issue (Skip exporting core users) doesn't seem to be working anyway as it keeps exporting the admin user.

das-peter’s picture

Status: Needs work » Needs review
StatusFileSize
new12.58 KB

Re-rolled.

prineshazar’s picture

+1, this would be extremely helpful for us who want to deploy content and manage them through updates.

yassersamman’s picture

Status: Needs review » Reviewed & tested by the community

#83 working great.

larowlan’s picture

Status: Reviewed & tested by the community » Needs work

Needs work for the @module arg to PluralTranslatableMarkup

  1. +++ b/drush/default_content.drush.inc
    @@ -107,3 +128,57 @@ function drush_default_content_export_module($module_name) {
    +    $message = new PluralTranslatableMarkup($count, 'Total: 1 entity imported.', '@module: @count entries imported.');
    

    Should we have the arguments here for @module? Should @module be in the singular string too?

  2. +++ b/drush/default_content.drush.inc
    @@ -107,3 +128,57 @@ function drush_default_content_export_module($module_name) {
    +      drush_set_error('INVALID_MODULE', dt("Module or profile '@module' doesn't exist or is uninstalled.", ['@module' => $module]));
    

    neat trick

  3. +++ b/src/Commands/DefaultContentCommands.php
    @@ -89,11 +112,71 @@ class DefaultContentCommands extends DrushCommands {
    -      ->getModule($module)
    -      ->getPath() . '/content';
    +        ->getModule($module)
    +        ->getPath() . '/content';
    

    unneeded?

  4. +++ b/src/Commands/DefaultContentCommands.php
    @@ -89,11 +112,71 @@ class DefaultContentCommands extends DrushCommands {
    +      $message = new PluralTranslatableMarkup($count, 'Total: 1 entity imported.', '@module: @count entries imported.');
    

    same issue here with the @module

  5. +++ b/src/Commands/DefaultContentCommands.php
    @@ -89,11 +112,71 @@ class DefaultContentCommands extends DrushCommands {
    +   * @param string|null $module
    +   *   An installed module or the default profile. If not passed, the validation
    +   *   passes.
    

    why do we need to support the null case?

  6. +++ b/src/Importer.php
    @@ -200,6 +221,17 @@ class Importer implements ImporterInterface {
    +    return array_reduce(array_unique($module_names + [$this->installProfile]), function (array $entities, $module_name) {
    +      return array_merge($entities, $this->importContent($module_name));
    +    }, []);
    

    nice

  7. +++ b/src/ImporterInterface.php
    @@ -18,4 +18,12 @@ interface ImporterInterface {
    +   * Imports all default content across the site.
    

    should we qualify this with 'from enabled modules and the active profile'?

neclimdul’s picture

Status: Needs work » Needs review
StatusFileSize
new26.15 KB
new2.72 KB

1 and 4 addressed. I mostly rerolled because I'd been annoyed by this for a while and was working on something related. Total is clearly copied from the other command so replaced with @module as well.
2. agreed
3. diff removed.
5. That very much looks like PhpStorm guessing something. I don't see a reason this method is different from the procedural version or a reason explicitly handling null would be needed. I just remove null from the doc.
7. probably. Changed to "Imports default content from all enabled modules and active profile."

neclimdul’s picture

StatusFileSize
new12.66 KB
new2.69 KB

Bah, I really messed that up. Description is right but I did my work on the wrong branch and got another patch mixed in. You'll notice the interdiff is mostly the same though.

The last submitted patch, 87: default_content-allow_manual_imports-2640734-87.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jurgenhaas’s picture

I have successfully tested #88 and it looks like we now need options for Drush to set $update_existing to true, because there doesn't exist any code yet which changed that variable from FALSE to TRUE. Is that correct? If so, I'd be happy to provide a modified patch for that.

neclimdul’s picture

so #2698425: Do not re-import existing entities and this are kinda mucking about in the same place and conflict. That's were I messed up in #87 because I had been messing with merging the two patches and what that would look like. Which ever one goes in first will need to be updated to support the other and I have a patch locally that adds the drush options for update. Its pretty trivial but it doesn't make sense until one of the patches lands.

ao2’s picture

Just nitpicking, sometimes the word "entity" is used instead of "entry":

diff --git a/drush/default_content.drush.inc b/drush/default_content.drush.inc
index fc01d00..e2aaf29 100644
--- a/drush/default_content.drush.inc
+++ b/drush/default_content.drush.inc
@@ -143,7 +143,7 @@ function drush_default_content_import_module($module) {
   /** @var \Drupal\default_content\ImporterInterface $importer */
   $importer = \Drupal::service('default_content.importer');
   if ($count = count($importer->importContent($module))) {
-    $message = new PluralTranslatableMarkup($count, '@module: 1 entity imported.', '@module: @count entries imported.', [
+    $message = new PluralTranslatableMarkup($count, '@module: 1 entry imported.', '@module: @count entries imported.', [
       '@module' => $module,
     ]);
     drush_log($message, LogLevel::OK);
diff --git a/src/Commands/DefaultContentCommands.php b/src/Commands/DefaultContentCommands.php
index ee0c4d3..d8a757e 100644
--- a/src/Commands/DefaultContentCommands.php
+++ b/src/Commands/DefaultContentCommands.php
@@ -138,7 +138,7 @@ class DefaultContentCommands extends DrushCommands {
     }

     if ($count = count($this->defaultContentImporter->importContent($module))) {
-      $message = new PluralTranslatableMarkup($count, '@module: 1 entity imported.', '@module: @count entries imported.', [
+      $message = new PluralTranslatableMarkup($count, '@module: 1 entry imported.', '@module: @count entries imported.', [
         '@module' => $module,
       ]);
       $this->logger()->log(LogLevel::OK, $message);

I tested #88 and it works well for me when importing content the first time, so I'd say le't merge it and move forward.

The change is very useful even though it does not support all use cases yet.

jurgenhaas’s picture

I have added to the patch from #88 the option update-existing to the Drush 9 command default-content:import-module

muldos’s picture

Hi,
the patch in #93 wasn't applying anymore

line 11 in default_content.services.yml

arguments: ['@serializer', '@entity_type.manager', '@entity.repository', '@hal.link_manager', '@event_dispatcher', '@module_handler', '@info_parser', '%default_content.link_domain%']

is now injecting the account switcher services

arguments: ['@serializer', '@entity_type.manager', '@entity.repository', '@hal.link_manager', '@event_dispatcher', '@module_handler', '@info_parser', '%default_content.link_domain%', '@account_switcher']

so I've updated the patch to fix that.

Extra : Little summary about patches provided here
By the way, this patch (and previousely #93) only make sense if you also plan to use the patch of https://www.drupal.org/project/default_content/issues/2698425

this 2 issues (and their patches) are required if you want to be able to import content without having to uninstall / install a module and also if you want to avoid conflict when importing an already existing entity.

My patch and #93 allow to pass a flag (--update-existing) that is only used by the code provided in issues 2698425.
For the record you will have to choose which patch to apply automatically, and which one to apply manually, because the are incompatible.

ivnish’s picture

douggreen’s picture

The command reports that nothing has been importing when something has.

drush default-content:import-module re_report --update-existing
[warning] No content has been imported.

I think that importContent() should return $created + $updated;

svetoslav.dragoev’s picture

Hi,
the patch in #94 wasn't applying anymore

line 11 in default_content.services.yml

arguments: arguments: ['@serializer', '@entity_type.manager', '@entity.repository', '@hal.link_manager', '@event_dispatcher', '@module_handler', '@info_parser', '%default_content.link_domain%', '@account_switcher']
is now injecting the file system services

arguments: arguments: ['@serializer', '@entity_type.manager', '@entity.repository', '@hal.link_manager', '@event_dispatcher', '@module_handler', '@info_parser', '%default_content.link_domain%', '@account_switcher', '@file_system']
so I've updated the patch to fix that.

svetoslav.dragoev’s picture

And another re-roll of 2640734-94.default_content.Allow-manual-imports.patch if you have applied "Do not reimport existing entities": "https://www.drupal.org/files/issues/2020-02-05/2698425--accept-content-u..." already.

eelkeblok’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Status: Needs review » Needs work

Since, as I understood from another issue, the 1.x version is not going to get any new features (great fan of the yml-approach of 2.x, btw), I suppose this will need retargeting to 2.x as well.

mbovan made their first commit to this issue’s fork.

bgilhome’s picture

Here's a patch from the branch in the MR against 2.0.x, in case anyone wants to test without having to checkout the branch.

phjou’s picture

@bgihome You can have the patch when someone is doing a merge request:
https://git.drupalcode.org/project/default_content/-/merge_requests/1.patch

flyke’s picture

I can apply patch #102 on default_content 2.0.x-dev.
But if I execute the command on my exported nodes, like this:
drush default-content:import-module my_custom_module
Then I get this error:

In ContentEntityBase.php line 955:
Invalid translation language (fr) specified.

For me all import problems are fixed by using these patches:

siegrist’s picture

Reroll. Can someone check if this patch still does what it was intended to? There were apparently a lot of changes lately. Thanks.

Fonteijne’s picture

drush dcim custom_module still overwrites existing content.
It has the same result as drush dcim custom_module --update-existing

The importContent() (Importer.php:152) does not allow the options argument given in contentImportModule() (DefaultContentCommands.php:140).
Therefore the flag 'update-existing' doesn't do anything. Even when documentation states otherwise.

Unfortunately the content is currently always being overwritten.

xurizaemon made their first commit to this issue’s fork.

rowrowrowrow made their first commit to this issue’s fork.

rowrowrowrow’s picture

Status: Needs work » Needs review
StatusFileSize
new16.79 KB

This adds support for the '--update-existing' flag to be used with the 'import all' and 'import module' commands. It will now force update all existing entities with exported values. If you don't use that flag it will only import new entities.

I noticed some code for exporting/importing json and wasn't sure if we care about that now. I'm not sure if that should be removed or not.

rowrowrowrow’s picture

Using filter_var for better user experience while flag handling. I.e. you can pass '--update-existing=false' and expect it not to update existing entities. In the previous version only something like omitting or '--update-existing=0' would work.

xurizaemon’s picture

Status: Needs review » Needs work

Hi @rowrowrow. Can I check if it was intentional to introduce changes from #2698425: Do not re-import existing entities to this MR in #108? This patch no longer applies for us as a result.

FYI (you may be aware of this), you can combine patches in cweagans/composer-patches, eg:

    "drupal/default_content": {
      "#2698425: Do not reimport existing entities": "https://git.drupalcode.org/project/default_content/-/merge_requests/14.diff",
      "#2640734: Allow manual imports": "https://git.drupalcode.org/project/default_content/-/merge_requests/1.diff"
    },

However, the above no longer applies, and a user referring to MR1 would now have some or all of the changes from #2698425: Do not re-import existing entities / MR14 also. It does become complicated to handle multiple patches to a project. Currently MR1 here is unclear to me, and I'd propose that we either clarify that or revert those changes and rework so they can apply cleanly (one MR per issue, one issue per MR).

That said, I'm not the maintainer, just a fellow contributor - so what I say isn't the rules ;)

(Caveat: It's not recommended practice to refer to MR URLs for composer patches, as they are subject to breakage via changes. That's a separate discussion!)

rowrowrowrow’s picture

Hey @xurizaemon, yes it was intentional. I found that I wasn't able to apply the patch from https://www.drupal.org/project/default_content/issues/2698425 cleanly after making some necessary changes and some of the logic from that patch was required to get the update-existing flags working. I was also using both this patch and the other but am able to solely use this one for both purposes.

To me there is clearly an overlap between the two issues as being able to stop the update of existing entities is a prerequisite for enabling/disabling them using something like an update-existing flag. Hopefully that makes sense and I hope I'm not messing things up here too much. If we need to undo stuff let me know and I'm happy to help.

Also, @here I think we should add a flag for updating entities only if their data differs, i.e. to avoid the consequences of saving an unchanged entity like caching etc... I had some thoughts about how to do it but I think that should be a separate ticket.

xurizaemon’s picture

OK. Thanks for the quick reply @rowrowrowrow!

If it makes sense for the issues need to be combined then no objection from me, with the request that this be communicated / coordinated between the affected issues. The impact for us was that an automated dev build tracking both of those MR URLs started to fail because when 83fe76a5 appears in both patches, the patch process fails, breaking the build. Fixed now, no hard feelings, just wanted to clarify the plan here :)

Looking back - I don't recall what the purpose of the MR opened in #107 was - maybe a reroll of current patches, I'm not sure the MR added anything at all. It's likely the intent there was to generate a patch URL which applied to current 2.0.x, or something like that.

Anyway - attached is a version of the patch which I believe corresponds to !1 before that latest set of changes - this is just in case someone else finds themself in the same boat and winds up here looking for a patch to use.

Please note: the attached patch does not include any changes beyond #107 and is not a proposed update to the WIP in the MR.

Cheers

barig’s picture

Hi everyone !

Thanks for this great patch, hope it'll be merged soon in the module ! (and thanks of course for this great module ;-) ).

I rerolled the patch against 2.0.0-alpha1 version just to fix some deprecations and an error displayed when calling "drush dcim":

In Logger.php line 161:
                                      
  The log level "ok" does not exist.  
                                      

I wanted to roll the patch against dev version of the module but it doesn't work so I kept with the 2.0.0-alpha1 release.

Thanks again !

Best regards,
Bastien

DonAtt’s picture

Using the patch in #114 I had an error while running drush dcia --update-existing:
[warning] Undefined variable $update_existing Importer.php:292

The reason is that the closure in importAllContent() does not inherit $update_existing from the parent scope.

Fix in line 291:

return array_reduce(array_unique($module_names + [$this->installProfile]), function (array $entities, $module_name) use ($update_existing) {

Attached the fixed patch.

alorenc’s picture

Thanks, patch from #115 works for me

claudiu.cristea’s picture

  1. --- a/drush/default_content.drush.inc
    +++ b/drush/default_content.drush.inc
    

    This is a new feature so I wouldn't provide support for Drush 8.

  2. +++ b/src/Commands/DefaultContentCommands.php
    @@ -85,10 +109,79 @@ class DefaultContentCommands extends DrushCommands {
    +   * @command default-content:import-module
    

    I think we should avoid any confusion and merge the 2 commands in a single one, default-content:import. This command will take as argument an *optional* list of modules (space delimited). When the list is passed will limit the import to the list. When no argument is passed, will import from all installed modules.

  3. +++ b/src/Importer.php
    @@ -258,6 +282,17 @@ class Importer implements ImporterInterface {
    +  public function importAllContent($update_existing = FALSE) {
    

    I don't think that makes sense to add this method (why not a 3rd one, importMultiple()?). No, I think we should have this logic inside the Drush command.

  4. +++ b/src/ImporterInterface.php
    @@ -12,10 +12,20 @@ interface ImporterInterface {
    +   *   The module to create the default content from.
    

    The param comment seem to be off

claudiu.cristea’s picture

Assigned: Unassigned » claudiu.cristea

Working on this.

claudiu.cristea’s picture

More remarks

  1. +++ b/src/Commands/DefaultContentCommands.php
    @@ -85,10 +109,79 @@ class DefaultContentCommands extends DrushCommands {
    +    $serialized_by_type = $this->defaultContentExporter->exportModuleContent($module);
         $module_folder = \Drupal::moduleHandler()
           ->getModule($module)
           ->getPath() . '/content';
         $this->defaultContentExporter->exportModuleContent($module, $module_folder);
    

    So, we're exporting twice?

  2. +++ b/src/Commands/DefaultContentCommands.php
    @@ -85,10 +109,79 @@ class DefaultContentCommands extends DrushCommands {
    +      drush_set_error('INVALID_MODULE', dt("Module or profile '@module' doesn't exist or is uninstalled.", ['@module' => $module]));
    

    I think we should throw an exception instead

claudiu.cristea’s picture

More remarks (2):

+++ b/src/Importer.php
@@ -123,12 +142,14 @@ class Importer implements ImporterInterface {
+  public function importContent($module, $update_existing = FALSE) {

It's OK that we want to preserve the current import behavior when the new argument ($update_existing) is not passed. Indeed, it honors the backwards However, the Drush command default should be reverted. The scope of this new feature is to update existing content. We can use a logical --update/--no-update option.

claudiu.cristea’s picture

Issue tags: +Needs tests

Fixed most of the remarks. However, this needs tests.

claudiu.cristea’s picture

Assigned: claudiu.cristea » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs tests

Ready for review.

idimopoulos made their first commit to this issue’s fork.

dimilias’s picture

Status: Needs review » Reviewed & tested by the community

Updated MR 20 to resolve a conflict with the latest 2.x.
Does what it says though I did not look for edge cases. +1 RTBC.

berdir’s picture

Status: Reviewed & tested by the community » Needs work
xurizaemon’s picture

Attaching a copy of the MR20 patch as at e164a354 (comment 124). No changes introduced here and not directing effort back to .patch uploads, just making a static patch available for builds which isn't a mutable MR patch URL.

xurizaemon’s picture

(apologies for the update noise, .diff this time)

calebtr’s picture

Status: Needs work » Needs review

Updating to 'needs review'.

pfrenssen made their first commit to this issue’s fork.

pfrenssen’s picture

Status: Needs review » Needs work

This still needs work, most of the remarks from @Berdir in the MR still need to be resolved.

pfrenssen’s picture

I am working on removing the changes that were out of scope of this issue and in scope of #2698425: Do not re-import existing entities. However that breaks the tests here. We are getting integrity constraint violations on existing content (which is the exact problem that is being solved in #2698425: Do not re-import existing entities).

So this indicates that that #2698425: Do not re-import existing entities is a hard blocker for this issue.

I propose to do the following:

  1. Leave the existing branch untouched to not needlessly disrupt existing users of this patch.
  2. Create a new branch that will combine this issue with #2698425: Do not re-import existing entities. We can continue the work in that branch, but since it will contain the code from both issues it will be harder to review. Ideally we should finish the other issue first.
  3. Mark this as postponed on #2698425: Do not re-import existing entities.

pfrenssen’s picture

Status: Needs work » Postponed
neclimdul’s picture

StatusFileSize
new26.86 KB

So this indicates that that #2698425: Do not reimport existing entities is a hard blocker for this issue.

Yeah it always kinda has been. LOL I'd been maintaining a combined patch for a project for that reason.

Because its a bit hard to test #2698425: Do not re-import existing entities without this here's a patch rerolling !24 over the merge request from the other issue.

neclimdul’s picture

StatusFileSize
new27.06 KB
new1.03 KB

The interface doesn't document it (which is its own bug of sorts) but Importer::importContent can throw exceptions. This triggers confusing fatal errors from Drush so it would be best to handle them in the command.

Also "No, I think we should have this logic inside the Drush command. " but the importAllContent command was removed entirely. I haven't added it here but seems like it was probably a useful command.

Also also, unrelated but the decode calls in importContent can throw exceptions which should be caught and re-thrown as something useful. To see this in action try putting your yaml export in a .json file and see the parse error crash things. Not that anyone would ever do that by accident...

pfrenssen’s picture

I'm thinking to be on the safe side we should default the overwriting of existing content to FALSE so it is safer by default. If people do want to overwrite existing content they'll have to manually add the --update option.

eelkeblok’s picture

I updated !24 with the latest commits from #2698425: Do not re-import existing entities and changed the default to FALSE.

eelkeblok’s picture

Also "No, I think we should have this logic inside the Drush command. " but the importAllContent command was removed entirely. I haven't added it here but seems like it was probably a useful command.

When the extension list is left empty, the dcim command in the latest MR will import content from all installed extensions, so I think that is what the import all used to do, right?

omarlopesino made their first commit to this issue’s fork.

bladedu’s picture

We tested the MR 24 and it works perfectly. We noticed, though, that if a dependency file miss Default content simply ignore them, because the method Graph::searchAndSort from core doesn't add them to the array list returned and sorted.

The only trace of them is found in `vertexes`

We'd like to propose a small, but very useful, patch that adds a log warning when some dependencies are missing.

delacosta456’s picture

hi
i am trying to aplly the MR24 on D10.2 with php 8.2 without success can somebody help with this

Thanks

vselivanov made their first commit to this issue’s fork.

vselivanov’s picture

bsuttis made their first commit to this issue’s fork.

nakaza sora changed the visibility of the branch 2640734-allow-manual-imports to hidden.

eelkeblok’s picture

Title: Allow manual imports » [PP-1] Allow manual imports
Issue summary: View changes