[1.3.x] Single Content Sync

Created on 24 March 2023, about 2 years ago

The Single Content Sync module offers a unique and super easy way to export any type of content (taxonomy, node, media, references, files, etc) and further import them to a different environment or to a different website. The module generates a YAML code snippet for the content you import that can just be copied and pasted. No manual steps or other user interaction is needed afterward. This makes the module very helpful for migration and deployment processes, as well as for lost content recovery.

The module is able to export entities together with entity references (taxonomy terms, block content, users, media, paragraphs, etc.), entity translations for multilingual websites, the contents of various supported field types.

The module supports many entity types and field types to be exported and imported. You can also provide an export/impot for your custom entity type or field type as well as adjusting it for existing types.

This module grows fast and I try to do my best to maintain it well with providing new features as well as bug fixing.

Some users use this module to migrate a site to another one, debug the values of content, create content backup, create content once and migrate to all other environments in one click, and many more different stories.

The module provides a configuration page to control what entity types can be exported. There are also different permissions to control what user roles can export/import content for what entity type.

The module already supports Drupal 10. There is also a documentaton where most of features are described with details https://www.drupal.org/docs/contributed-modules/single-content-sync โ†’ .

You can install the module with composer or clone with git. No dependencies required.

Project link:

https://www.drupal.org/project/single_content_sync โ†’

๐Ÿ“Œ Task
Status

Needs review

Component

module

Created by

๐Ÿ‡บ๐Ÿ‡ฆUkraine nginex

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @nginex
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    Thank you for applying! Reviewers will review the project files, describing what needs to be changed.

    Please read Review process for security advisory coverage: What to expect โ†’ for more details and Security advisory coverage application checklist โ†’ to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

    To reviewers: Please read How to review security advisory coverage applications โ†’ , What to cover in an application review โ†’ , and Drupal.org security advisory coverage application workflow โ†’ .

    While this application is open, only the user who opened the application can make commits to the project used for the application.

    Reviewers only describe what needs to be changed; they don't provide patches to fix what reported in a review.

  • Status changed to Needs work about 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    Fix PHPCS issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml single_content
    _sync/
    
    FILE: single_content_sync/README.md   
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 9 WARNINGS AFFECTING 9 LINES
    ----------------------------------------------------------------------
      9 | WARNING | Line exceeds 80 characters; contains 85 characters    
     25 | WARNING | Line exceeds 80 characters; contains 87 characters    
     28 | WARNING | Line exceeds 80 characters; contains 100 characters   
     45 | WARNING | Line exceeds 80 characters; contains 82 characters    
     58 | WARNING | Line exceeds 80 characters; contains 88 characters    
     62 | WARNING | Line exceeds 80 characters; contains 102 characters   
     67 | WARNING | Line exceeds 80 characters; contains 86 characters    
     71 | WARNING | Line exceeds 80 characters; contains 102 characters   
     78 | WARNING | Line exceeds 80 characters; contains 82 characters    
    ----------------------------------------------------------------------
  • Status changed to Needs review about 2 years ago
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine nginex

    Hi @vishal.kadam,

    Did not know that phpcs is applicable for README file, this seems a bit too much, anyway, I simplified README.md file, the changes are now available in branch 1.3.x

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    Hi @nginex,

    I have reviewed the changes, and they look fine to me.

    Letโ€™s wait for other reviewers to take a look and if everything goes fine, you will get the role.

    Thanks

  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine nginex

    Thank you, @vishal.kadam, I am looking forward

  • ๐Ÿ‡ฒ๐Ÿ‡ฉMoldova andrei.vesterli Chisinau

    Hi @nginez

    I've done a review of this module and I like the way it works. Most of the focus is on D10 but anyway, here is my little feedback:

    • File: src/Form/ContentExportForm.php. Method handleAutoFileDownload. You don't need to use triple if statements (line 100), but just add && between conditions.
    • File: src/Form/ContentExportForm.php. Method handleAutoFileDownload. Method refreshContent is missing doxy like @param, @return
    • File: src/Form/ContentExportForm.php. Method handleAutoFileDownload Method submitForm. There is a switch statement with 2 cases only. I would say that a switch statement in Drupal (according to the sonarqube policies), should follow these rules: minimum 3 cases, present default case too.
      switch ($button['#name']) {
            case 'download_file':
              $file = $this->fileGenerator->generateYamlFile($entity, $extract_translations);
              break;
      
            case 'download_zip':
              $file = $this->fileGenerator->generateZipFile($entity, $extract_translations);
              break;
          }

      . I would suggest changing it to an if/else if/ or 2 if's.

    • File: src/Form/ContentSyncConfigForm.php. Missing @package Drupal\single_content_sync\Form.
    • File: src/ContentExporter.php. Method exportBaseValues. There is another switch statement. I would suggest adding the default option too. I saw more places with such implementation in other files.
    • The core requirements says core_version_requirement: ^9.3 || ^10 but in the readme file you set example_update_8001. I would suggest changing it to 9xxx or so.
    • File: single_content_sync.install. I saw some hook updates implementations. I suppose that all is configured the way you need but, what about uninstalling it? Do you remove for example this config single_content_sync.settings? I would suggest checking it. We don't need any trash after the module is uninstalled.

    p.s. really love this module.

    Regards,
    Andrei

  • Status changed to Needs work about 2 years ago
  • ๐Ÿ‡ฒ๐Ÿ‡ฉMoldova andrei.vesterli Chisinau
  • Status changed to Needs review about 2 years ago
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine nginex

    Hi @andrei.vesterli,

    Thank you for your review, I appreciate the feedback.

    I managed to fix all the feedback and pushed the changes in 1.3.x branch.

    I did check what happens when users want to uninstall the module. The result is that all module related configs are removed automatically, so no extra actions needed here.

  • ๐Ÿ‡ฒ๐Ÿ‡ฉMoldova andrei.vesterli Chisinau

    hi @nginex

    really glad to know that. All i can say is โ€œGreat jobโ€.

    Nothing else from my side.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sivakarthik229

    Hi @nginez,

    I have reviewed the changes, and they look fine to me.
    Thanks for the module, it really worked great for syncing the contents between environments.

    Thanks
    Siva

  • Status changed to RTBC about 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    name: Single Content Sync
    type: module
    description: 'Export/import a single content between different environments.'
    core_version_requirement: ^9.3 || ^10
    

    I would increase the minimum Drupal release required, since the module is using PHP 7.4 features, and Drupal 9.3 still requires PHP 7.3. Drupal 9.4 dropped the support for PHP 7.3 โ†’ ; that is the minimum release to use for modules that expect PHP 7.4 or higher to be installed.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    Thank you for your contribution! I am going to update your account.

    These are some recommended readings to help with excellent maintainership:

    You can find more contributors chatting on the Slack โ†’ #contribute channel. So, come hang out and stay involved โ†’ .
    Thank you, also, for your patience with the review process.
    Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review โ†’ . I encourage you to learn more about that process and join the group of reviewers.

    I thank all the reviewers.

  • Status changed to Fixed about 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine nginex

    Hi @apaderno,

    Thank you for your feedback and updating my account, much appreciated.

    Concerning your feedback about php minimum version. I'm wondering, isn't enough to set "php": ">=7.4" in composer.json of the module (already there) instead of increasing minimum Drupal core version from 9.3 to 9.4?

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Assigned to apaderno
  • Status changed to Fixed 20 days ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
Production build 0.71.5 2024