Add API documentation. Make sure that configuration parameters and working with translations are included. Add suitable examples too.

See the documentation in the process plugins for format examples.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

jofitz’s picture

Status: Active » Needs review
FileSize
1.98 KB

Here's a first draft, I have added:

  • available configuration key(s)
  • destination properties
  • a simple example
  • a second example incorporating the translation config key
phenaproxima’s picture

Assigned: Unassigned » phenaproxima

Self-assigning for review.

phenaproxima’s picture

Assigned: phenaproxima » Unassigned
Status: Needs review » Needs work
  1. +++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
    @@ -14,10 +14,52 @@
    + * Persist data to the config system. When a property is NULL, the default is
    

    Should be "Persists data..."

  2. +++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
    @@ -14,10 +14,52 @@
    + * Available configuration keys:
    + * - translations: (optional) Boolean, if TRUE, the destination is for
    + *   translations. Defaults to FALSE.
    

    The 'store null' option is not mentioned.

  3. +++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
    @@ -14,10 +14,52 @@
    + * This will add the value of the variable "node_admin_theme" to the config with
    + * the machine name "node.settings".
    

    This explanation is incomplete. It should mention that the saved value will really be node.settings:use_admin_theme (with nicer phrasing).

  4. +++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
    @@ -14,10 +14,52 @@
    + * This will add the value of the variable "site_offline_message" to the config
    + * with the machine name "system.maintenance" coupled with the relevant langcode
    + * as obtained from the "i18n_variable" source plugin.
    

    Again, this should be a little more explicit as to what the destination property will be.

  5. +++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
    @@ -14,10 +14,52 @@
    + * @see \Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable
    

    Nit: There should be a newline before this.

jofitz’s picture

Status: Needs work » Needs review
FileSize
1.56 KB
2.07 KB
  1. Corrected the typo.
  2. Added the "store null" option (and removed its reference from the previous sentence to avoid repetition).
  3. Included the name of the destination property.
  4. Included the name of the destination property.
  5. Added the newline.
heddn’s picture

Assigned: Unassigned » heddn

Assigning to review this week.

Dinesh18’s picture

I have reviewed the patch mentioned in comment #5, covered all the changes mentioned in #4.
Looks good.

heddn’s picture

Assigned: heddn » Unassigned
Status: Needs review » Needs work
  1. +++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
    @@ -14,10 +14,55 @@
    + * - store null: (optional) Boolean, if FALSE, the default is used when a
    

    What happens if the value is TRUE?

  2. +++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
    @@ -14,10 +14,55 @@
    + *   use_admin_theme: node_admin_theme
    ...
    + * the machine name "node.settings" as "node.settings.node_admin_theme".
    

    Wouldn't this become node.settings.use_admin_theme?

  3. +++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
    @@ -14,10 +14,55 @@
    + *   langcode: language
    + *   message: site_offline_message
    ...
    + * This will add the value of the variable "site_offline_message" to the config
    + * with the machine name "system.maintenance" as
    + * "system.maintenance.site_offline_message", coupled with the relevant langcode
    + * as obtained from the "i18n_variable" source plugin.
    

    Wouldn't this become:

    system.maintenance.langcode
    system.maintenance.message
jofitz’s picture

Status: Needs work » Needs review
FileSize
1.62 KB
2.08 KB

Made all 3 corrections identified in #8.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

I think this reads perfectly. It has my blessing. Let's git 'er done!

heddn’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
@@ -14,10 +14,55 @@
+ * - translations: (optional) Boolean, if TRUE, the destination is for
+ *   translations. Defaults to FALSE.

Nit: We aren't being consistent. Over in #2862661-5: Add documentation to EntityConfigBase destination plugin.2 we don't like the wording for translations. Working on some fixes.

heddn’s picture

Status: Needs work » Needs review
FileSize
2.14 KB
892 bytes
quietone’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @heddn, that is a much better explanation of the translations key.

  • catch committed ecb273f on 8.4.x
    Issue #2862655 by Jo Fitzgerald, heddn, phenaproxima: Add documentation...

  • catch committed feafb30 on 8.3.x
    Issue #2862655 by Jo Fitzgerald, heddn, phenaproxima: Add documentation...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.4.x and cherry-picked to 8.3.x., thanks!

Status: Fixed » Closed (fixed)

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