Problem/Motivation
For custon migration it's a very common request to filter the migrated items. Some real use cases are:
- migrate nodes older than {date};
- skip blocked users or users with certain emails or users that never accessed the website;
- migrate users with certain roles;
It would be great to be able to use conditions to narrow down your SQL source data for content/config entity types. The resulting functionality would provide much more capabilities to how you can migrate nodes one content type at a time, and the same for taxonomy terms -- but for users (by role), menu links (by menu), and so on.
The functionality would let you narrow your data during the source/extraction phase, instead of during the process/transformation phase (which you can do using skip_on_value/empty + method: row). Benefits would include general tidiness of data :) And! Speed/performance!
Proposed resolution
Introduce new configuration properties in SqlBase
base class: conditions
, joins
and distinct
:
conditions
- to filter the results;
joins
- to join additional tables (required to filter by fields/properties stored in separate tables);
distinct
- to avoid duplicated results when joining one-to-many records;
If such configuration is present, it's being applied to the query in prepareQuery
method, when the base query is already defined.
Remaining tasks
- Review and validate the approach;
- Resolve #2833060: SqlBase::prepareQuery() should be called also on count, which is kind of a blocker (the source count is not updated after applying conditions, because the count() ignoring
prepareQuery
method); - Add more tests;
- Write a change record;
Comment | File | Size | Author |
---|---|---|---|
#93 | drupal_core-3069776-SQL-source-plugins-allow-defining-conditions-and-join-in-migration-yml-2.patch | 14.05 KB | tatianag |
Issue fork drupal-3069776
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
weekbeforenextAs suggested, I have moved my changes from migrate_plus issue #3077445: Add Conditions to Table Source Plugin to Drupal core migrate module, SqlBase.php. This will allow for a conditions array in migration YAML files.
This is an example of the syntax that can be included in the source plugin configuration for a migration:
The "value" and "operator" values are optional. They will default to the values specified in the ConditionInterface, condition method.
public function condition($field, $value = NULL, $operator = '=');
Comment #3
heddnNice work. Some small points to consider below. Plus needs some tests. A simple test with a condition on node type/bundle and asserting all results only are that node type would probably be sufficient.
Let's provide a rational example of what this would look like. Maybe filtering by node type as a good example.
Let's throw a InvalidPluginException if the config for conditions doesn't match the expected format. But don't do in in prepareQuery. Rather do it in the constructor. Then we can be assured that conditions is an array and has field, value and operation all set per expectation.
Comment #4
weekbeforenextI updated the SqlBase.php documentation with an example of 'conditions' and added conditions in the constructor to catch malformed conditions data.
I added a new test of the constructor to SqlBaseTest.php, to test the new conditions added. Doing so, broke the existing tests.
I'm not sure if I'm on the right track, so I wanted to see if I could get some direction on fixing.
The previous test uses a defined class "TestSqlBase" that extends SqlBase. Originally, the constructor was sort of disabled for the testing of the mapJoinable() method. Modifying the constructor method to call the parent constructor is causing the following errors:
Drupal\migrate\Plugin\MigrationInterface::getIdMap() was not expected to be called.
Drupal\migrate\Plugin\MigrationInterface::getIdMap() was not expected to be called more than once.
Should we create another class that extends SqlBase to test the constructor?
Comment #6
daggerhart CreditAttribution: daggerhart as a volunteer and at Hook 42 commentedBefore #4, TestSqlBase's constructor didn't call the parent constructor of SqlBase. After #4, TestSqlBase calls its parent SqlBase, which calls its parent SourcePluginBase, which itself always calls `$this->migration->getIdMap();`
I've updated the patch to pass tests by changing the MigrationInterface mock object to expect to call getIdMap "atLeastOnce()".
Comment #7
heddnNit: 80 chars.
The doxygen says it defaults to an empty array. But then here we do we assume it might not. Wny not += merge in 'conditions' as an array into the configuration?
Stray change. Not needed.
It would help a lot w/ this data provider if the keys were the variable names of what they are.
Example:
'not array' => [
'expected' => TRUE,
'conditions' => '',
],
I don't think a return TRUE is needed.
Comment #8
weekbeforenextWorked with @daggerhart to make the recommended changes.
Comment #10
weekbeforenextLooking at the failed test, I think the failure is unrelated to the work here. Let me know if I'm missing something.
Comment #12
heddnRe-ran the tests, I think there must be something in this patch that is causing the fails.
Comment #14
alisonQuestion: the "type" is used as an example -- I thought we can already migrate nodes one content type at a time, can't we? Would this functionality change how that existing functionality works -- or am I mistaken and it doesn't exist yet -- or is it unrelated -- or?
Comment #15
weekbeforenext@alisonjo315, I think you are right if we are using the "d7_node" source plugin.
I was originally repurposing logic used with the "table" source plugin in migrate_plus. I wasn't sure what example would make most sense for more general use.
I'll give it some more thought, but if you have an idea, feel free to update the patch or share in a comment.
Teamwork :)
Comment #16
alison@weekbeforenext aaaaaaaahhhhhh ok, that makes sense, thanks for explaining -- it's been all of like, two months since I've worked on migrations, and, man it's always a surprise how many thing fall all the way out of your brain in so little time :)
I'll give it some thought, but I think it makes total sense now that you've explained it. Thank you!
Comment #17
alisonRe: tests -- sorry if this is stating the obvious, I'm awfully close to illiterate when it comes to unit testing, but trying to dip my toe in the water... anyway:
The one failure is in core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php (that link will take you directly to the relevant line) -- which is test in the migrate_drupal module, not directly in the migrate module:
(
assertSame(23, count($field_info));
)I'm not sure why it's getting a count of 23 for the field_info "parts" -- I'm not sure what in this patch would cause a different number...?
Is there something about the use of field things in this new functionality that's different in D6, when compared to the D7 source data......?? (...I only say that b/c the d7 version of the test didn't fail -- it's different, obviously, but -- here's the d7 version of testGetAllFields, just in case...)
OR... is the new functionality in this patch actually adding to the
field_info
structure, in the context of testing, so this line of FieldDiscoveryTest.php needs to be changed toassertSame(23, count($field_info));
.....?There's a very good chance I'm saying nonsense, but, that's what a first go-around is I guess. One major problem is that idk how to step backwards (aka "backtrace," I suppose) from
testGetAllFields()
-- if anyone can explain that part to me, I can take another swing at it!)Comment #18
freelockHuh, I just stumbled on this issue from the Slack thread...
I recently implemented a few "standard" yaml config keys for a generic source plugin that I reused on 2 different sites -- with just a little more config support, I would not have even needed a custom source!
In my custom source, I implemented these additional configurations keys:
- table
- fields (list of field names)
- not_empty (list of fields to exclude rows where this field empty)
- condition (Dictionary with the field name as the key, and then value/operator fields in a map, which I think looks slightly cleaner than the example above)
- keys (dictionary of keys with type and alias)
For example, here's a source config:
... I was able to do a couple dozen migrations using the same source plugin, just altering these fields -- and I was also able to use basically the same source plugin for both a MySQL and a MS SQL Server source.
So perhaps worth expanding to cover these additional items?
Comment #19
heddnre #18: I think that type of a source plugin works really well in contrib plus (migrate_plus). But in core, such a plugin wouldn't be needed. We'd be better off with what we have here in core, then taking #18 and posting that as a patch to contrib.
Comment #20
freelockIs it even possible to do a migration without migrate_plus :-)
Ok, given that SqlBase is a parent class of DrupalSqlBase, I can see the benefit of adding Conditions here, without the rest of my config options... and migrate_plus seems like a fine place to put a generic SqlMigration class that implements these...
Cheers,
John
Comment #21
daggerhart CreditAttribution: daggerhart as a volunteer and at Hook 42 commentedWorked this out with @weekbeforenext
The right thing to do was update the d6 FieldDiscoveryTest to look for 23 keys in the field_info.
Between #5 and #8 we made it so that
$this->configuration['conditions']
has the default value of an empty array when not provided. This means that field configurations will always now have 1 more item than before this patch.This error doesn't show up for d7 migration tests because the d7 FieldDiscoveryTest doesn't assert for a specific number of field_info keys the way that the d6 test does.
Comment #22
heddnTagging novice because the feedback is pretty easy to respond.
We don't need to support PHP < 7 at this point in the core release cycle. So lets switch to null coalescing operator.
Use Class:class syntax for greater refactoring in IDEs.
These comments are no longer needed now with the array key names :)
Comment #23
Skabbkladden CreditAttribution: Skabbkladden at Digitaliseringsdirektoratet commentedI'm looking at this at DrupalCon Amsterdam 2019
Comment #24
Skabbkladden CreditAttribution: Skabbkladden at Digitaliseringsdirektoratet commentedI've added the changes from #22
Comment #25
weekbeforenextComment #26
heddnThese should all use import statements via
use
instead of the full path inline.Comment #27
ravi.shankar CreditAttribution: ravi.shankar at OpenSense Labs commentedI have changed it.
Comment #28
heddnHere's an interdiff between 24 and 27. https://www.drupal.org/documentation/git/interdiff
Comment #29
heddnHere I've cleaned up the existing tests a little. But this still needs more work. Re-adding tests tag.
This still seems to be missing any tests of valid conditions. We've got edge case testing of the constructor, but not of anything else. Let's add that test coverage please.
Comment #31
benjifisherWould the current approach on this issue make it possible for contrib modules (such as Migrate Tools) to alter the SQL query based on something other than the migration YAML? If so, then we might not need #2780839: Optimize migration of specific source IDs for SQL sources.
Comment #32
chandrashekhar_srijan CreditAttribution: chandrashekhar_srijan at Srijan | A Material+ Company for Drupal India Association commentedI am looking into this.
Comment #33
chandrashekhar_srijan CreditAttribution: chandrashekhar_srijan at Srijan | A Material+ Company for Drupal India Association commentedI have added the test cases for valid conditions. Kindly check.
Comment #34
joey-santiago CreditAttribution: joey-santiago commentedWould it also be possible with this patch to do a join?
for example:
we are currently migrating a site in which most likely we have files that are not used in any fields, so we would like to avoid getting unused files in. Our idea would be to join the field_data_field tables for the fields we want to keep and then migrating only the files we need. Does it make sense?
thanks for helping me out.
Comment #35
joey-santiago CreditAttribution: joey-santiago commentedHello,
so i added some rough code that seems to provide the ability to do a join... does it make any sense? Sure, i am not adding anything to the tests for now, but i'd like to hear if the approach makes sense or not.
Comment #36
heddnThe addition to add joins seems reasonable.
Comment #38
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedFixing test.
Comment #39
benjifisher@vsujeetkumar:
Thanks for the fix. When uploading a new patch, remember also to update the issue status from Needs Work (NW) to Needs Review (NR). I would do that for you, but I checked the test results: although the tests pass, the testbot reports two coding-standards violations, so the issue status should still be NW.
Comment #40
joey-santiago CreditAttribution: joey-santiago commentedI wonder would it be too much to also add subqueries to the possibilities?
i achieved the functionality, it seems to work with this patch, but i'm a little bit doubtful.
Comment #41
joey-santiago CreditAttribution: joey-santiago commentedThis is the use case i have in my mind for subqueries:
So i want to migrate only users who own nodes excluding some type. The problem is this would also need a condition in the subquery... Dunno, is it too complicated? Am i the only one having this kind of needs?
About joins, an example is:
This way i am migrating only files that are used in a certain field. I think it makes sense making these migrations more 'self contained' in stead of migrating a million files at once.
Thank you for you effort on this, i think this saved me a lot of headaches!
Comment #42
joey-santiago CreditAttribution: joey-santiago commentedAnd here's the new patch. This allows pretty easily to, for example, get in only users who are owners of published nodes of type page:
Again, i think the main point is tailoring the migration to only what needs to be ported to the new site instead of getting everything carried over.
Comment #43
joey-santiago CreditAttribution: joey-santiago commentedSorry, the patch was wrong, here's a better one. checks are a little bit tricky to do :).
Comment #44
joey-santiago CreditAttribution: joey-santiago commentedOuch!
big question.
It seems that the total amount of rows for the migration is not calculated on the query with conditions, joins and subqueries added to it, so this makes it impossible to require this migration from another one.
example:
the thing is i very happily migrated only the 14 users that own nodes and i really don't want to take in the other 9815.
Hacking the count function this way, the counter is fixed, but will i break something else?
Comment #45
joey-santiago CreditAttribution: joey-santiago commentedAdded patch for the last comment: seems to solve the counter issue.
Comment #46
joey-santiago CreditAttribution: joey-santiago commentedAdding the option for a distinct to be set from the joins settings.
Comment #47
hkirsman CreditAttribution: hkirsman commentedI was having warnings.
Adding patch to check if the variables exists.
Comment #48
shaktikPlease ignore interdiff_42-44.txt file.
correct interdiff_47-48 below.
fixed testcase, kindly check.
Comment #49
xurizaemonI don't want to cool your contribution effort @joey-santiago and my comments are that of just another Drupal user here :)
In my opinion while simple filters are a good fit for Migrate core (clearly expressed in Migrate yaml), more complex examples like your subquery in #41 are better suited to a custom Migrate source plugin which extends the existing source plugin and modifies the query there.
That keeps Migrate's yaml and docs simple and clear, and still offers a flexible (more readily flexible, IMO) interface for people to customise in filters like "only users with a current account ... who've logged in in the last two years ... and who made a donation at least once ... and ..."
My 2c, feel free to keep at it if you / others feel worthwhile. Just my opinion here :)
Comment #51
quietone CreditAttribution: quietone as a volunteer commentedYes, I agree with xurizaemon, I don't think we should be adding sub-queries in core. Let's keep this simple.
That means this needs to return to the patch in #38 and bring it up to date for 9.2.x. It will need coding standard fixes see comment #39.
This also needs an issue summary update to indicate what is actually being changed here. Currently it is a list of ideas.
I reckon this is going to need a change record as well.
Comment #52
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedFixed the two coding standard issue as mentioned in #51 and give the interdiff using #38 patch
Comment #53
quietone CreditAttribution: quietone as a volunteer commented@vsujeetkumar, thanks.
I reviewed the patch but not the test. Mostly doc and comment changes.
This should be a statement of what conditions are not what they should be. For example, 'Conditions to add to the query'.
Add a new line here to separate the Example from the description.
This, 'joins' needs documentation above.
There needs to be an explanation of what this example does. What are the results when using these conditions and joins?
The words 'conditions' and 'joins' should be in single quotes.
I think that condition here is meant to be join.
It also add joins. How about 'Adds tags, metadata, and configured conditions and joins to the query.'
Similar changes in the @return description.
Still want to highlight that the conditions and joins are configuration. So, 'Add any configured conditions.' And similar for the joins comment a few lines below
Why has this changed?
Also, this still needs an issue summary update. At minimum, update the proposed resolution.
Comment #54
ayushmishra206 CreditAttribution: ayushmishra206 at OpenSense Labs commentedComment #55
ayushmishra206 CreditAttribution: ayushmishra206 at OpenSense Labs commentedAddressed:
53.1
53.2
53.5
53.7
53.8
Please review.
The remaining changes are:
53.3
53.4
53.6
53.9
Comment #57
quietone CreditAttribution: quietone as a volunteer commentedThe outer quotes need to be double quotes.
Comment #58
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedUpdated outer quotes as mentioned in #57.
Comment #59
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedComment #60
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedInterdiff added, Please have a look.
Comment #61
quietone CreditAttribution: quietone as a volunteer commentedLooks like this was missed from 53.8. This is configuring joins, not conditions.
Setting back to NW for #53: 3, 4, 6 and 9.
This also needs an issue summary update, see Write an issue summary for an existing issue for guidance on doing that.
Comment #62
alison@quietone I can try to update the issue summary -- before I dive in, is it because of formatting/structure issue, or content/substance?
Comment #65
MatroskeenI'll try to review and address the remaining points. In the meantime, feel free to edit the issue summary.
We would also need to add a change record describing a new feature - adding a tag.
Comment #66
quietone CreditAttribution: quietone as a volunteer commented@alisonjo315, thanks.
I default to thinking in lists, so this will be brief.
Comment #68
Matroskeen@quietone the answer for #53.9 is in #21.
I opened a merge request with some changes on top of #58:
1) Improved documentation and came up with some real examples (at least I hope so);
2) Added a bit more superpower by switching from
join()
toaddJoin()
, which can be used to specify a type of join. I think it mght be helpful in some cases and defaults toINNER
, which is the same asjoin()
;3) Improved
SqlBase
constructor a bit;I think we need more tests with real source plugins. Is it fine to add more test cases to the existing source plugin tests like
Drupal\Tests\node\Kernel\Plugin\migrate\source\d7\NodeTest
?The other important thing is the issue mentioned in #44. Currently, the conditions are not affecting the source count, which is gonna be confusing.
If I have 10 nodes in D7 site, and I'm adding a condition, I'm still seeing 10 as Total, which makes me think conditions don't work (but they actually do).
I don't want to postpone this issue on #2833060: SqlBase::prepareQuery() should be called also on count, but I think we cannot introduce this feature without fixing the source count.
Leaving "needs work" for:
1) Issue summary update;
2) More tests;
3) Change record;
Comment #69
MatroskeenLooking at #3060321: Plugin to only migrate users that have created/edited content and #3057685: Plugin to only migrate users with certain roles, it seems we need a support for
distinct
query flag.Comment #70
MatroskeenAdded distinct option support and borrowed example from this issue: #3057685: Plugin to only migrate users with certain roles.
Still needs work for items mentioned in #68.
Comment #71
MatroskeenUpdated the issue summary.
Comment #73
MatroskeenLooking at #3063778: Source plugin to only pull in certain URL aliases, we may consider adding support for condition groups. Thoughts?
Comment #74
MatroskeenThe answer for #73 is: let's move it into a follow-up task: #3232493: [PP-2] SQL source plugins: add support for conditional groups in migration yml files.
Comment #76
quietone CreditAttribution: quietone at PreviousNext commentedDiscussed at #3253983: [meeting] Migrate Meeting 2021-12-16 2100Z. mikelutz pointed out that this would reduce the number of source plugins in core. For myself, this needs more testing. I think testing using an existing Migration Kernel test as a template and using the various conditions available. Also tests proving that this works when someone uses the new conditions as well as existing configuration properties that alter the query. One example is 'node_type' in Node.php.
Comment #78
HitchShockApplied the same behaviour to countQuery().
When we use conditions/joins/distinct the command
drush migrate-status
doesn't take this into account to get the Total value.This means that the Total count will always be greater than the one that will actually be migrated:
Total > Imported
. Thus, in the end, we will still have the Unprocessed items. This in turn will mean that the migration is still incomplete.This is very critical if such a configuration is a required dependency for another configuration.
Comment #79
Matroskeen@HitchShock I totally agree that this issue should be fixed before we land this feature.
For this purpose, there is another issue: #2833060: SqlBase::prepareQuery() should be called also on count
I'm glad that you came up with the same approach. We also have a test coverage over there, so you can take a look.
I think we can keep these changes in the merge request, but eventually, we'll have to revert when #2833060 is committed.
Comment #80
HitchShockAllowed to add extra fields to the query. This is useful when using joins - we can retrieve an extra migration source from the joined table, e.g. when the joined table is a custom one.
Comment #82
quietone CreditAttribution: quietone at PreviousNext commentedThis was discussed at #3267552: [meeting] Migrate Meeting 2022-03-10 2100Z and I just want to ask the question that mikelutz raised, sort of. Why do this in prepareQuery instead of initializeIterator?
Comment #83
nsciaccaWith the patch from #58 I get these warnings on some pages, I'm sure it's a conflict with other source plugins I'm running for Field Collections to Paragraphs, but it would be nice if there were checks around the loops to see if the conditions / joins existed first.
Notice: Undefined index: conditions in Drupal\migrate\Plugin\migrate\source\SqlBase->prepareQuery() (line 290 of core/modules/migrate/src/Plugin/migrate/source/SqlBase.php).
Warning: Invalid argument supplied for foreach() in Drupal\migrate\Plugin\migrate\source\SqlBase->prepareQuery() (line 290 of core/modules/migrate/src/Plugin/migrate/source/SqlBase.php).
Notice: Undefined index: joins in Drupal\migrate\Plugin\migrate\source\SqlBase->prepareQuery() (line 295 of core/modules/migrate/src/Plugin/migrate/source/SqlBase.php).
Warning: Invalid argument supplied for foreach() in Drupal\migrate\Plugin\migrate\source\SqlBase->prepareQuery() (line 295 of core/modules/migrate/src/Plugin/migrate/source/SqlBase.php).
Throwing it out here in case anyone can make the change easily, otherwise I'll add to the existing work when I get a free moment.
Comment #84
xurizaemonAs Gitlab MR URLs are subject to unexpected changes (ref #3204538), I'm attaching a patch copy of MR 849 as at f4c123cf.
Comment #85
xurizaemon*sigh* and a copy of an earlier MR state which applies against Drupal 9.2 for reasons. Sorry for the noise -.-
Comment #87
Matroskeen@quietone:
We want to do this in prepareQuery method to reflect this information in the source count method, which calls only
query()
for now. In another issue, we're trying to make it smarter and callprepareQuery()
: #2833060: SqlBase::prepareQuery() should be called also on count.Comment #88
mikelutzWe should not be doing this in prepareQuery(). prepareQuery should only be used to add tags and metadata to the query. There should be nothing in prepareQuery() to affect the count. (Adding a tag that later causes the query to be altered in a query alter hook is a separate consideration, which I will comment on in #2833060: SqlBase::prepareQuery() should be called also on count
The addition of these conditions to the query should be offloaded to a protected method on SqlBase, and if they exist that method should be called in both initializeIterator, and count (or doCount, I guess)
Comment #89
MatroskeenWhy? It is common to add query tags and then apply some conditions:
Why wouldn't it affect the count if the query is being modified this way?
I don't mind moving this into another method, but why wouldn't we call it in
prepareQuery()
? In other words, why do we need to be able to callquery()
withoutprepareQuery()
?When I was looking into it, it felt like query should be even protected and called only within
prepareQuery()
.Comment #90
mikelutzI'm still going back and forth on whether/how to support query alters in the count function. Clearly, in the original design the concept of tag alters affecting the count was not considered. Ultimately, you may be right, there may be little choice but to include prepareQuery in count and toString, and everywhere else that query is called. Or we may document that tag alters on the query aren't supported in count (which I also agree, seems wrong. They should be included somehow). My main concern is that there are so many places to override this query that it becomes much too easy to override the query in multiple places in incompatible ways. This is already an issue with the highwater implementation in initialzeIterator being incompatible with queries that have sorts, for example.
While I don't know what the ultimate roles of query, prepareQuery, SqlBase:initializeIterator, and tag alters will be, or if we will change these around to better define their roles, I think that at the end of the day there is more in this system to clean up than just simply adding prepareQuery to count, and whatever we do needs to be thought through and designed and named in a better way than it is now. At that point, it's likely that prepareQuery will play the role of a precount_query_alter and the stuff currently in initializeIterator should go in a sort of postcount_query_alter (conditions used for filtering unneeded rows in a particular run while keeping the actual count unaffected).
Regardless of that bigger discussion and ultimate resolution, it's not what we currently have. Core uses no tag alters, and a case can be made that if you make a tag alter on a migration query, you are responsible for adjusting or extending your source to override your count function if you care about it. prepareQuery is documented to only be for tags and metadata and is not supposed to add conditions to affect the count directly, and at the moment and until we settle on a new organization, I think we need to respect that distinction in this issue. Keeping the conditions in a separate method will allow us to move them into a precount query alter later easily enough if that's the route we go, but for the purposes of this issue, I think having initializeIterator and doCount being aware of and processing them is the right way to go.
Comment #91
jwilson3I found this issue by searching for "migrate left join" on Google.
I just want to clarify that this approach does not allow you to magically reference the fields left joined to the migration
source:
clause from within the migration'sprocess:
clause. For this you still need to implement custom Process plugins and execute any necessary database joins again on every row.Comment #93
tatianag CreditAttribution: tatianag commentedAs Gitlab MR URLs are subject to unexpected changes (ref #3204538), I'm attaching a patch copy of MR 849 as at f4c123cf.
- This commit is excluded from the updated patch: 7b72898b
Applied the same bahaviour for countQuery()
- The change in
function doCount()
was already applied in #2833060: SqlBase::prepareQuery() should be called also on count- Otherwise, patch for #3069776 and patch for #2833060 don't work together as I'm getting the reject error on that 7b72898b commit.
Comment #95
alisonI know this is both old and has up-in-the-air elements to it, BUT, I successfully applied MR #849 to a Drupal
10.110.2 site, and then successfully migrated users of just one role. (I only applied the changes in MR #849, I didn't grab anything from #2833060.) (EDIT: I forgot we're on 10.2 now; just fixed the core version in my note.)I did get warnings when I ran
drush mim
, but it still ran successfully -- but I'll share them anyway:My very rough take on those warnings is that they mean my conditions syntax could/should be better. (I copied from one of the code examples in SqlBase.php, but maybe I certainly may have misinterpreted it.)
Speaking of which, here's the "source" section of my user migration YML: