*** Commit message ***

git commit -m 'Issue #2522652 by neclimdul, phenaproxima: Add getTemplateByName method to TemplateStorage'

Committers: @prajaankit's patch in #8 is not RTBC. #2529250: User repeatedly uploads confusing patches to issues with no explanation

Problem/Motivation

There is not a method for fetching templates by name which would streamline running individual templates

Proposed resolution

Add a new method for retrieving an individual template.

User interface changes

None

API changes

New method.

Note: makes more sense when considered with #2522600: Remove CMI dependency from Migration Templates

Comments

lostkangaroo’s picture

Very much in favor of this one, I wonder though if it should contain an error rather then returning NULL on missing templates.

neclimdul’s picture

StatusFileSize
new2.4 KB
new1.6 KB

tests

lostkangaroo’s picture

Status: Needs review » Reviewed & tested by the community

Time to push this into the RTBC stack. Now with a test!! I have been running this patch for most of my migrations in the last few days and it has been thoroughly tested.

phenaproxima’s picture

Issue tags: +blocker
benjy’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/migrate/src/MigrateTemplateStorage.php
    @@ -63,6 +63,22 @@ public function findTemplatesByTag($tag) {
    +   * @return null|array
    

    NULL should be capitals

  2. +++ b/core/modules/migrate/src/MigrateTemplateStorage.php
    @@ -63,6 +63,22 @@ public function findTemplatesByTag($tag) {
    +    return isset($templates[$name]) ?
    +      $templates[$name] :
    +      NULL;
    

    Our coding standards has this on one line.

  3. +++ b/core/modules/migrate/src/Tests/TemplateTest.php
    @@ -49,4 +47,29 @@ public function testTemplates() {
    +  public function testGetTemplateByName() {
    

    Missing function comment.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new2.74 KB
new1.56 KB
phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

The previous patch was just minor style fixes, so back to RTBC.

prajaankit’s picture

StatusFileSize
new4.49 KB
phenaproxima’s picture

Status: Reviewed & tested by the community » Needs work

@prajaankit, what is your patch adding or removing? All I see are formatting changes. Please post some explanation, and an interdiff.

neclimdul’s picture

Status: Needs work » Reviewed & tested by the community

#8 just adds incorrect spacing.

Committers: #6 is RTBC.

neclimdul’s picture

update credit.

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes
mikeryan’s picture

Patch is double-plus good, and blocks (at least) #2530030: Create the migrate builder plugin type and #2522660: Templates Broke migrate-manifest. Should we tag this "Migrate critical"?

phenaproxima’s picture

Issue tags: +Migrate critical

In a word: yes.

phenaproxima’s picture

Issue summary: View changes
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 92965c5 and pushed to 8.0.x. Thanks!

  • alexpott committed 92965c5 on 8.0.x
    Issue #2522652 by neclimdul, phenaproxima, prajaankit, benjy: Add...

Status: Fixed » Closed (fixed)

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