Needs review
Project:
MaxLength
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Feb 2022 at 10:03 UTC
Updated:
24 Mar 2023 at 17:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
omkar.podey commentedInitial patch.
Comment #3
omkar.podey commentedUpdated tests.
Comment #4
omkar.podey commentedComment #5
narendrarTested manually and added my observations below:
Check if Maxlength module is enabled on the source site or not.
What if
$row->getSourceProperty('data')does not have any value?Extra space
Title and link migration missing.
To reproduce link migration issue enable https://www.drupal.org/project/link
Common data can be moved above switch case.
Remove extra space wherever possible.
Seems irrelevant to me.
Do we require this in this case?
Is it required in this case?
Comment #6
omkar.podey commentedUpdated as per review.
Comment #7
omkar.podey commentedComment #8
narendrarTitlefield maxlength configurations are still not migrated.This line can be added outside switch case.
This is not required.
Comment #9
omkar.podey commentedUpdated as per review.
Comment #10
omkar.podey commentedUpdated with custom deriver.
Comment #11
omkar.podey commentedComment #12
huzookaRe #11: Very nice job, I've only a few minor nits.
It is enough to check whether the
maxlengthmigration tag is present or not.This reads better if you write
$row->getSourceProperty('widget/settings').In addition, the name of the variable should refer to the data in it, e.g.
$widget_settingsThe data in
field_definition/typeis the same what is already available in thetypesource property (it is the field type).We don't have to do anything if the array key does not exist (I mean you don't need the
elsestatement at all). And other than that, if$unserialized_data['maxlength_js']is0, then there is no limitation, so we shouldn't migrate any maxlength configuration.With these in mind, I would say just use an early return:
It would be nice to provide an optional support for the core patch at #3097336: Improve the DX for migrating content entities: view modes, fields, formatters, widgets etc should be migrated per entity type + bundle.
Please prefer single quotes where possible!
https://www.drupal.org/docs/develop/standards/coding-standards#quotes
An empty line is missing at the beginning of this test class' body (after the opening curly brace).
Comment #13
omkar.podey commentedUpdated as per review.
Comment #14
omkar.podey commentedUpdated with Dynamic migration dependencies.
Comment #15
huzookaThed7_node_typemigration isn't a derived migration in Drupal core; the thing what makes it available is the patch at #3097336: Improve the DX for migrating content entities: view modes, fields, formatters, widgets etc should be migrated per entity type + bundle.By default, the node label max length migrations should depend on
d7_node_type. But if the patch in3097336is applied, then these migration should (and can) depend on the correspondingd7_node_typederivative.Edit: I was wrong. You can ignore my concern at #12.5.
Comment #16
omkar.podey commentedUpdated as per review.
Comment #17
omkar.podey commentedComment #18
huzooka#16 deserves RTBC.
Thank you, @omkar.podey, great work!
Comment #19
wim leersAfter may months in use, not a single problem reported.
Comment #20
hipp2bsquare commentedThank you for the good work, omkar, for the review and feedback, huzooka, and for the prodding, Wim! Committing this to the project.
Comment #21
hipp2bsquare commentedAlas, I spoke to soon -- I just caught that there is a coding standards issue w/ line 263:
Comment #22
adaucyjI'll work on it.
Comment #23
adaucyjCould someone review it, please.
Comment #24
Arturo-q commentedHi, I will review it.
Comment #25
Arturo-q commentedThanks, @Adaucyj, for the patch, it fixes the last CS issue.
Moving to RTBC.
Comment #26
cedeweyComment #27
cedeweyMarking as needs review to check if anything needs updating to make it work with the 2.1.x branch.