Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Create a migration config and class for enable end user to migrate Text Formats and filters from Drupal 7 to Drupal 8
Comment | File | Size | Author |
---|---|---|---|
#30 | 2384567-d6-d7.diff | 13.85 KB | phenaproxima |
| |||
#29 | interdiff-2384567-26-29.txt | 2.56 KB | phenaproxima |
#29 | 2384567-29.patch | 11.95 KB | phenaproxima |
#26 | interdiff-2384567-25-26.txt | 1.83 KB | phenaproxima |
#26 | 2384567-26.patch | 10.85 KB | phenaproxima |
Comments
Comment #1
-enzo- CreditAttribution: -enzo- commentedComment #2
-enzo- CreditAttribution: -enzo- commentedThis patch enable users migrate Text formats and the following list of filters
The previous filters are provided by core, other filters could be imported but require contributed modules to handle custom filters like Media filter and Twitter filter
The roles calculation is provided but by definition all new Text Formats doesn't have roles associated in creation, maybe this is something could change in the future you can confirm this information in \Drupal\filter\Entity\FilterFormat where you can check the following statement.
Comment #3
miguelc303 CreditAttribution: miguelc303 commentedRemove un necessary code in Filter format file for permissions and set the names to formats migrated from Drupal7
Comment #4
miguelc303 CreditAttribution: miguelc303 commentedThis patch fix an error in previous patch to enable import custom formats, but only the following plugins are accepted for now in Drupal 8
Because if a format has other plugins these are import as a filter_null plugin disabling the input format in Drupal 8.
If you want enable others plugins you must to add in the yml file and in the FilterFormat class in array filters_allowed.
Comment #5
hosef CreditAttribution: hosef commentedMoving to the IMP sandbox issue queue.
Comment #6
benjy CreditAttribution: benjy at CodeDrop commentedComment #7
miguelc303 CreditAttribution: miguelc303 at Anexus commentedAdded organization support to Anexus IT
Comment #8
phenaproximaWrote a test, and greatly simplified the migration itself. It seems to me that using the static_map plugin to determine the filter IDs is pointless, since they're exactly the same between D7 and D8.
Postponing until MigrateDrupal7TestBase lands.
Comment #9
phenaproximaComment #10
phenaproximaThis is blocking migration of nodes, comments, and taxonomy terms (and probably others); escalating.
Comment #11
phenaproximaRe-rolled against HEAD and added a unit test of the d7_filter_format source.
Comment #13
phenaproximaThis oughta work now.
Comment #14
phenaproximaComment #15
quietone CreditAttribution: quietone commentedThanks to phenaproxima and mikeryan1 I'm reviewing this.
I don't have enough knowledge to know if the function assertEntity is correct and sufficient. But, personally, I find the name odd because it appears to be for one specific type of entity, not a generic test for all entities. But I can be pedantic, so don't know if that is a problem.
The only other thing I noticed was a typo, which is fixed in the attached patch.
So, still needs someone more experienced to have a look.
Comment #16
mikeryanComment #21
alexpottIt looks like were not testing the migration of any custom filter settings for example changing the list of tags filtered by
filter_html
.Comment #22
phenaproximaGood point. Added a couple of assertions for that.
Comment #23
mikeryanInterdiff looks good, back to RTBC.
Comment #24
webchickOk, gave this a once-over...
The biggest thing is we intentionally skip plain text format in a couple of places:
However, I don't understand why we do that. While it's not deletable, it is configurable, and you can even configure it like Full HTML if you really want to ruin someone's day. ;) So it seems like we need to account for it as well, unless I'm missing a big cluestick. Needs work for that.
Then I had a question about:
Is there a reason we get this specific in terms of what filters to move over? Wouldn't the migration path for, say, BBCode look exactly the same? If so, why not just take care of all filters at the same time here?
Then some other stuff that phenaproxima answered in IRC and are fine:
Why remove docs? Because this is already covered in parent class and this stuff is just boilerplate.
Why change default values? Trying to catch edge cases.
Comment #25
phenaproximaThose are very valid points. It's not at all clear why the source plugin skips the things it does, especially when you consider that the D6 version of the plugin doesn't skip those things. Fixed.
Comment #26
phenaproximaCouple of minor fixes.
Comment #27
webchickEarlier we talked about benjy providing final review of this one, so assigning to him.
Looks good from my side, though!
Comment #28
benjy CreditAttribution: benjy commentedPatch looks good, one nitpick and a question.
s/role/filter
The d6 source specifically maps certain settings into the appropriate keys. Am I right in saying the setting arrays are identical between D7/D8?
Comment #29
phenaproximaFixed a few minor nits that were annoying me, plus #28-1.
As far as I know, yes. D6 doesn't have a serialized filters.settings column (filter settings seem to be stored in the variable table) but D7 does.
Comment #30
phenaproximaHere's a diff of the D6 and D7 versions of this migration and its plugins.
Comment #31
mikeryanLooks good.
Comment #33
mikeryanSilly testbot.
Comment #34
webchickOk, excellent. Looks like all feedback has been addressed.
Committed and pushed #29 to 8.0.x. Thanks!