Problem/Motivation
From @tim.plunkett's review in #2281691: User interface for migration-based upgrades:
+++ b/core/modules/drupal_upgrade/src/Form/MigrateUpgradeForm.php @@ -0,0 +1,1196 @@ + else { + $table_data = []; + $system_data = []; + foreach ($form_state->get('migration') as $migration) {This is a very large else block. Can this function be rewritten to avoid that, or broken into smaller methods?
+++ b/core/modules/drupal_upgrade/src/MigrateUpgradeRunBatch.php @@ -0,0 +1,358 @@ + public static function run($initial_ids, $operation, &$context) {This is another very large method that does a lot. Any way to break it up?
The first point was fixed as part of #2569805: For Drupal migration, identify the source module
The second was fixed in #2687851: Refactor run() method on Migrate UI batch and remove the $operation parameter
Proposed resolution
Refactor the code to reduce complexity. -- This has been done in #2918761: Break up MigrateUpgradeForm into smaller forms
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | Selection_002.png | 26.13 KB | quietone |
| #35 | interdiff.txt | 2.71 KB | quietone |
| #35 | 2679929-35.patch | 34.97 KB | quietone |
| #31 | Selection_008.png | 39.04 KB | quietone |
| #29 | interdiff.txt | 34.64 KB | quietone |
Comments
Comment #2
xjmComment #4
xjm#2687851: Refactor run() method on Migrate UI batch and remove the $operation parameter is one part of this.
Comment #5
quietone commentedI've been working on this and should be able to upload a patch in a day or two.
Comment #6
quietone commentedA bit of a delay for family reasons but here is a patch.
Comment #7
quietone commentedComment #9
mikeryanTested locally, looks good!
Comment #10
xjmThis patch is rc eligible since it only touches experimental code.
Since @tim.plunkett provided the original feedback, I pinged him to take a look. The issue doesn't need to be blocked on that feedback but it could be useful. :)
Comment #11
xjmDoes this patch address point 2 from the summary about the
run()method? Or just the first point? I would be okay with two separate issue scopes; just don't want to accidentally lose that outstanding item.Comment #12
mikeryanrun() is being refactored in #2687851: Refactor run() method on Migrate UI batch and remove the $operation parameter.
Comment #13
mikeryanRestoring RTBC.
Comment #15
quietone commentedNo, the tests are passing. Restoring RTBC.
Comment #16
kekkisPatch applies with offset of 40 lines. Updating patch.
Comment #17
kekkisAnd of course forgot to update status.
Comment #18
kekkisRerolled patch.
Comment #19
kekkisComment #20
mikeryanComment #21
mikeryanReroll looks good.
Comment #22
mikeryanComment #23
alexpottI'm not keen on the current approach - we don't really lose any complexity. I think it is worth asking what needs to be on the confirmation page by way of information. At the moment the big thing that is displaying is a table where one of the columns is always going to be "Missing". That suggests that maybe this table is not the best way of doing this. Maybe just an item list of the modules enabled in the source site that have no migration path. Also there are modules we know have no migration path - i.e. overlay and are never likely to - therefore are we just giving the user too much information? What I'm getting at is that some missing migrations are important and some are not - that is a tricky problem.
So for example - the missing module list code could be:
This also has the advantage of use the real module name from Drupal 6 / 7. Another thing is the use of functional code like
array_map()andarray_filter()to manipulate the arrays of data. This can result in simpler code that does less too. We could also consider removing disabled modules from the system data when we get it as we don't need them. That said I'm not sure why we're putting the system data in form state - probably when the form we also being used for rollback and incremental. I'm not sure that having one form do everything is really the way to go here.tldr; I think we need to look at:
Comment #24
mikeryanSome past discussion on the "missing" upgrade paths: #2569771: [meta] Highlighting of source modules with no upgrade paths (and child issues).
#2569805: For Drupal migration, identify the source module is addressing the hard-coded list of module upgrade paths.
Comment #25
quietone commentedNeeded a reroll.
Comment #26
maxocub commentedAssigning for review.
Comment #27
maxocub commentedOK, this patch that is up for review is only a reroll.
I see that @alexpott's comments in #23 haven't been addressed yet, nor discussed.
I'm still not too much familiar with this upgrade form so I don't have an opinion yet on that point, but I can see why we need to think about that. If we don't do that here, we should open a follow up with a plan.
I must say I agree that the 'Missing upgrade paths' table isn't really useful as a table and could be just a list of the missing upgrade paths. Same for the 'Available upgrade paths', I don't think that the 'Destination' column is that useful, it could also be just a list of the available upgrade paths.
Back to needs work because of #23
Comment #28
quietone commentedRestructing the form is probably a good idea. I looked at that ages ago but was too new to really pursue it. And like you I don't know if that should be done here or in another issue (either new or existing). Does that even fit with the plan for the UI? What is the plan for the UI?
How do we do that? I've seen a fair amount of comments about that over the year but no solid answers.
Even so, the attached patch is a quick fix to get rid of the destination column in the form table.
Comment #29
quietone commentedHere is an attempt to address the issues raised in #23.
Comment #31
quietone commentedThe failing tests pass locally and are unrelated to the patch. Tried a retest and still failing.
And here is screenshot of the modified upgrade confirm page.

Comment #32
quietone commentedLooks like the tests are passing. Setting to NR.
Comment #33
mikeryanComment #34
mikeryanExtra indent added.
s/items/modules/
The linked page isn't really helpful in interpreting the "Missing upgrade paths" list. I think we're better off describing the likely explanations in-place here, something like:
Comment #35
quietone commented1. Fixed
2. Modified using the text you provided. And added a screen shot.
But, if I understand the user interface standards, maybe the sentence, "The Drupal 8 module which corresponds to the module in your source site is not present" should be modified to not refer to Drupal 8? Maybe "The module on this site that corresponds to the module on the source site is not present."?
Comment #36
quietone commentedGot called away and forgot to upload the screenshot.
Comment #37
mikeryanComment #39
mikeryan#2569805: For Drupal migration, identify the source module is going to require a major reroll of this, and I think that's the more important issue. Postponing on that.
The issue summary should be updated to reflect that this issue was redirected from just simplifying the code to simplifying the UI itself.
Comment #40
quietone commentedComment #43
quietone commentedNow that #2918761: Break up MigrateUpgradeForm into smaller forms has been committed this can proceed.
Comment #44
quietone commentedThe two point in the original IS have been done, that is noted in the IS. I read through the issue and didn't find any followup to make.
Closing as out of date