Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
migration system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
25 Mar 2014 at 18:01 UTC
Updated:
13 Jun 2017 at 09:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
phenaproximaComment #2
phenaproximaBlocked by #2594263: Add translation data to Migrate Drupal's test fixtures.
Comment #3
svendecabooterUnblocked
Comment #4
quietone commentedComment #5
quietone commentedComment #6
quietone commentedA work in progress.
This needs to truncate the vocabulary name to 32 chars. So, pulled the substr part of the dedupe process plugin into it's own plugin. Maybe this should go into Migrate?
Marking as postponed, as this relies on the data in #2670170: Add i18n string & variable data to d6_dump.
Comment #7
quietone commentedrerolled for 8.1.x
Comment #9
quietone commentedFailure was due to accidentally including a working copy of the test.
Comment #10
mikeryanWhy not use dedupe_entity on the vocabulary name?
The substr plugin does seem generally useful - if we're going to add it, that should be its own issue (with its own tests).
This destination plugin does not seem to actually be used anywhere? The new migration uses a destination of entity:taxonomy_vocabulary.
fields() must return an array (the fact that the Entity destination does not has its own issue: #2630732: Implement Entity::fields() for migration destinations).
s/Join/join/
Comment #11
quietone commentedBecause we want to add the translated terms to an existing vocabulary. Dedupe will detect that a given vocabulary name exists and create a new one. And then the translated terms would be added to that new vocabulary not the existing one.
Created a new issue for the substr plugin, #2752591: Add substr process plugin. This is now postponed on that.
1-2. Removed the extraneous destination plugin.
3. Fixed
Comment #12
mikeryansubstr is in!
Comment #14
gábor hojtsyThanks for working on this, reviewed!
Also the summary says this would deal with term_data, while it in fact deals with the vocabulary itself and not the terms. That is a good way to approach the problem, but I think we should clone the issue summary for a new issue and repurpose this for the vocabulary then (so we don't try to do both at once and since this is about the vocabulary in practice already).
Should not use templates anymore, should we?
Some copy-paste comments.
This kind of query would fail if the i18n module was not enabled. Where does it ensure that this depends on i18n module in the source?
The original entity may also have a langcode of its own. So IMHO we should check if different from the original.
Comment #15
viirak commentedIs this issue fixed?
Comment #16
mpp commentedComment #17
mpp commentedSee https://www.drupal.org/node/2784371.
Comment #18
gábor hojtsy@viirak: it would not be set to needs work if it would be fixed.
@mpp: thanks! Now this is a much smaller scope, do you think you may be able to work on this? :)
Comment #19
viirak commented@Gábor, thanks. I just did not see any more activities while waiting for it. I think this is also important as i18n node translation. Usually sites that have node translations also have term translations. Hence, without this patch D6 with i18n term translation migrations are broken, nodes are not properly connected to the correct terms.
Comment #20
mpp commented@Gábor, atm I solve taxonomy/vocabulary translations with an event subscriber, it doesn't scale well from a code perspective (it requires 1 column per language) but I also experience an exponential performance issue with migrations (https://www.drupal.org/node/2765729). That problem makes my multilingual migrations much slower as this approach requires to process each language separately 0(nxnxc) n=items to migrate; c=amount of languages. Once that issue is solved I can look into this.
Comment #21
viirak commented@mpp, any patch for this?
Comment #23
quietone commentedRerolled the patch in #11. Also, instead of having 2 Migrate Taxonomy Vocabulary tests, one with i18n and one without, they are merged into one test file, MigrateTaxonomyVocabularyTest. The same was done in the d6 MigrateNodeTest.
Comment #25
quietone commentedRerolled to use the new test base class for source plugins.
Comment #27
quietone commentedThis should fix I18nVocabularyTest but not MigrateUpgrade6Test.
Comment #29
quietone commentedThis and a couple of other i18n issues that make changes to EntityConfigBase destintations. Of those I believe #2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields has received the most feedback from Gábor Hojtsy and a review from phenaproxima (who has asked for a test for the changes to the destination).
Therefor, I am marking this as Postponed, until the destination is finalized in #2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields.
Comment #30
gábor hojtsyYeah it would be important to commit this at one place instead of working on the same thing in parallel, thanks @quietone, was about to say the same :)
Comment #31
quietone commented#2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields is in so no longer postponed.
Comment #32
quietone commentedOops, it is RTBC not fixed.
Comment #34
damienmckennaCross-referencing the issue that's blocking this one.
Comment #35
quietone commented#2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields is in, no loner postponed.
Comment #36
quietone commentedReroll
Comment #37
gábor hojtsyThanks, quick review:
This should depend on taxonomy and i18nstrings no?
Array closing parenthesis needs to be on its own line IMHO.
I don't think you intended to change modes on these.
Comment #38
jofitzResponse to code review.
(includes corrections to modes that does not appear in interdiff).
Comment #39
gábor hojtsyYay, thanks. Now that this one is added, should we update the migrate form mapping to map from i18n to taxonomy rather than taxonomy to taxonomy? That is where we encode that dependency for the source module as per #2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields.
Comment #40
quietone commentedThanks for fixing the bad patch. It was still 27 deg at 10pm and I was wilting...
Updating the user form as per #39. Also, removing the changes to d6/MigrateTaxonomyVocabularyTest.php and putting the i18n tests into there own file, config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nTaxonomyVocabularyTest.php. This was done to be consistent with the i18n user profile field instance tests.
Comment #41
gábor hojtsyNeither config translation, nor locale would be needed to do this migration. Config translation is just a UI module to edit config translations and locale is just an integration module for community translations / shipped config, neither of which applies here.
Language module provides ConfigurableLanguageManager and LanguageConfigFactoryOverrideInterface which manage config translations. As well as all the APIs used in the test are within language module.
Comment #42
quietone commentedPut the test back into taxonomy module and removed config_translation and locale from the test.
Comment #43
gábor hojtsyYay, superb :) Thanks!
Comment #45
gábor hojtsyLooks like a testbot fluke:
Comment #46
alexpottCommitted and pushed 28afba2 to 8.4.x and 7ac72e0 to 8.3.x. Thanks!
All the stuff below I fixed on commit.
Unrelated change.
Some code style fixes to make.
Comment #50
xjmUnfortunately I think this has a regression on Postgres:
https://www.drupal.org/pift-ci-job/616067
Reverted and testing on all environments.
Comment #52
alexpottHere's a patch with my fixes from #46
Comment #53
alexpottWe need to cast the vid to a string in postgreSQL. The only way I can think of doing this in a db agnostic way is to use the like operator because of existing code.
There's not much difference because actually there are no keys involved. And there's no key on the objectid on the original table so this is just an inefficient query. The like as expected is just a touch slower but regardless it has to scan the rows. Funky.
Comment #54
mikeryanComment #55
mikeryanThe Postgres fix looks good to me.
Comment #56
mikeryanComment #57
quietone commentedThis also needs renaming. The migrations be in the form basicmigration_variation. The same pattern should be used for the related files like migration plugins and tests. See #26 and #27
Comment #58
quietone commentedComment #59
quietone commentedRename complete. I hope the testbot agrees.
Comment #60
quietone commentedComment #61
mikeryanNothing but renames, back to RTBC!
Comment #62
alexpottWhilst looking to see if we can use an indexed field I noticed that the i18n_string table actually has a numeric field containing the object ID - we should use that. It'd be great if someone could work out how to join across the table using an index. It's not immediately apparent... I think we might have to join via locales_source.
Comment #63
quietone commentedA bit unclear what you mean here. Join to what table? What do we need to get from locales_source?
Fixed coding standards and restructured VocabularyTranslationTest.
Comment #64
quietone commentedForgot to upload the interdiff
Comment #65
quietone commentedPostponing this because the source plugin test is returning false positives. #2862006: MigrateSourceTestBase returns false positives for most plugin tests
Comment #66
heddnComment #67
jofitzNo longer blocked.
Comment #68
mikeryanComment #69
mikeryanQueued a full set of tests, given we've had db-specific issues before...
Comment #70
mikeryanTests pass, changes since this was previously committed look good - let's do it!
Comment #71
gábor hojtsyHm, I asked for an issue summary update 10 months ago in #14. The issue summary defines the problem as:
I don't know if that is a problem but that problem is definitely not the one this issue is trying to resolve. If the issue summary explains a problem that still needs to be resolved, then it should be copied over to another issue. If not, then it should just be removed. A new issue summary would be important so people arriving at this issue understand what it is/was about, eg. when reviewing changes made to Drupal core.
Re the technical question of (lack of) indexes, I am personally not concerned much for that given that the number of vocabularies should not be too much. Or am I missing something?
Comment #72
mikeryanComment #73
mikeryanGuess I didn't look closely enough last time - some copypasta to clean up here.
Comment #74
mikeryanIssue summary updated.
Comment #75
mikeryanMy feedback in #73 can be addressed by a novice (give the source plugin an appropriate description, and remove the unused member variables).
Comment #76
rajeevkRe-rolling patch after changing variable description.
Comment #77
quietone commented@RajeevK, thanks for the patch. Because of that I took another look at my patch and found that those variables can be removed.
The attached patch does that and changes the source plugin description. And finally, renamed the source plugin file from TaxonomyVocabularyTranslation.php to VocabularyTranslation.php to be consistent with the existing d6 vocabulary source plugin name.
Comment #78
mikeryanWill try to review soon.
Comment #79
mikeryanLooks good to me!
Comment #81
gábor hojtsyLooks good now to me too, thanks everyone for the constant effort on this, it was not simple, blocked multiple times, committed and rolled back but it came out great at the end. :)