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.
Comment | File | Size | Author |
---|---|---|---|
#10 | 2880499-8.patch | 4.44 KB | mahtab_alam |
#2 | content_access-add-migrate-support-2880499-2.patch | 4.18 KB | osopolar |
Issue fork content_access-2880499
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:
- 8.x-1.x changes, plain diff MR !6
- 2880499-add-migrate-support changes, plain diff MR !5
Comments
Comment #2
osopolarContent Access settings might be set with the help of an Event Subscriber subscribing to the event
MigrateEvents::POST_ROW_SAVE
, see attached patch.Example on how to set the Content Access Settings for operation
view
(node view) in a migrate template (see also the PHPDoc for MigrationEventSubscriber::migratePostRowSave):The default settings don't have to be defined in the migration template, it would be just enough to define the customized settings, as above, where only the
$content_access_settings['view']
is defined. In this example the settings forupdate
ordelete
will be received from the content types defaultcontent access settings
. If the per node settings matches the default settings the per node settings aren't saved to the database (as it's not necessary).Comment #3
osopolarComment #4
rwmanos CreditAttribution: rwmanos commentedPatch in #2 needs some work to prevent those fatal errors.
Comment #5
osopolarWhere did you define your migration? In a custom module? If so, may you please add the following to the modules
.info.yml
file:It's just a guess based on what I found searching for your error message. It looks similar to the issue the commerce migrate module had, see: #2912247: Fatal error MigrateEvents not found.
Otherwise we may need to outsource the code in a custom sub-module with dependency on migrate – or the error is related to something else.
Comment #6
rwmanos CreditAttribution: rwmanos commentedI assumed some migration dependency is missing but I'd expect this dependency to be added in the module by the patch itself.
The point is that this patch is for content_access and if you apply it, you are not able to enable the module any more.
In addition, I enabled all migration-related modules (i.e. migrate_upgrade migrate_plus migrate_tools migrate migrate_drupal) but I still cannot enable this module with this patch applied. The error is different this time:
I strongly believe this patch needs some work.
Comment #7
mahtab_alam CreditAttribution: mahtab_alam at Valuebound commentedComment #10
mahtab_alam CreditAttribution: mahtab_alam at Valuebound commentedComment #12
mahtab_alam CreditAttribution: mahtab_alam at Valuebound commentedPatch #10 is working but it is not passing the test because of drupal coding standards.
Comment #13
osopolarAdding the migrate dependencies directly to Content Access means that everybody who wants to use the Content Access module needs to enable the Migrate module, no mater if the site will use migration, or am I missing something?
It may be implemented in a submodule of Content Access (Content Access Migration) or in a custom module, which implements the migration if present. See also #5.
Comment #14
DamienMcKennaPatch #10 also shouldn't specify
@package Drupal\example_module\EventSubscriber
.Comment #15
DamienMcKennaAlso, is there a specific reason to rename
MigrateEvents
asMigrateEventsCore
?Comment #16
gislePatch fails to apply, and needs to be rerolled against HEAD. Also comments needs to be addressed.
Comment #21
pattersonc CreditAttribution: pattersonc as a volunteer commentedSee MR #20 as I added proper migration support for per node content_access records.
Comment #23
nsciacca@pattersonc Thanks for your merge request - with a few tweaks I made it work well for my implementation. I pushed these changes:
Comment #24
bisonbleu CreditAttribution: bisonbleu commentedCan someone please explain what the setup is to make this work? Thanks!
Comment #25
gisleThis should go into the version compatible with Drupal 10.
Comment #26
sclsweb CreditAttribution: sclsweb commentedI need to migrate a D7 site using Content Access to Drupal 10 and would love to see this added to the D10 version. I can't code it, but I would test if someone ported it.