How to do a custom migration from a Drupal 7 site to Drupal 9 using classes and custom modules - drupal

l have installed and enabled the Drupal Migrate module and any additional modules required for the source and destination plugins.
Created a custom module for the migration and defined the migration class in the .module file
Please find the screenshot below for the info.yml file for the migration modulesinfo.yml
\
This is the .module file code below:`
.module file class
This is the destination plugin class code below:
destination plugin class
This is the source plugin class code below:
source plugin class
But l cant find the custom module in the Drupal 9 site ?
I expected to find the custom module in the list of modules in my Drupal 9 site and implement the migration process

Related

Drupal 8 to publish files

I'm trying to create a simple CMS to ingest contents and publish files. I'm using Drupal 8 with Feeds module to read xml files from a directory and it works fine.
I can't figure it out how I can take the information saved in my custom content and publish them to a file in another directory.
Anyone can help?
Thx
Luca
Could you create a view to render the desired output for the content you're after and then use the Views data export module to export that view into a file?
I note the following:
This module also exposes a drush command that can execute the view and
save its results to a file.
drush views-data-export [view-name] [display-id] [output-file]
If you can do it with Drush you can do it with PHP.
So potentially you could write hooks to manage the export of files based on the activity of the feed. E.g. The hook_ENTITY_TYPE_insert would allow you to perform logic when a node of a particular content type is created.

Magnolia form module templates are missing in new page wizard

I'm building a site starting from the magnolia empty webapp with maven.
All is ok but now I'm now writing the contact page of the site. I'd like to use the magnolia mail module for this. So I installed the mail module and the form module.
Problem:
After installing the form module in magnolia 5.4, the template called "Form" does not appear in the template selection when creating a new page in the pages app.
As it seems from the Documentation, it should be there.
Details:
Other templates, created by me with yaml and freemarker, correctly appear (and i can use them correctly).
The mail module is up and running and configured: i can send a mail to myself with the "verify setting" page, using a template i made, but i'd like to create a contact module for my site.
I installed the module with maven like:
dependency: groupId:info.magnolia, artifactId:magnolia-module-form , version:2.3
and installed it with the usual steps (installed module, wait , correctly completed without messages, started magnolia)
I DO NOT have STK installed since i'm using MTE... and i've other modules installed (resources, site, mail, MTE, DAM, etc...)
Am I missing something or doing something wrong? :|
Otherwise, Can the magnolia mail module simply be used standalone without the form module to send out a email, may be pointing a hand-written form to somewhere?
Or, best option imho: can I make a new form template with yaml? I can't find docs about it.
Thank you!.
Edit: I tried to install the STK along with MTE (I correctly updated to magnolia 5.4.1) but it relies on data-module 2.3.6 (which i don't have in my dependencies and which i don't use) so it won't install the STK. Also , installing STK just for a form template seems overkill to me. I'd prefere to understand how to insert a form in one of my templates.
Preinstalled templates are for STK. If you want to use Magnolia without STK, then you need to write template yourself, but in exchange have much more freedom in what you can do with that template. Once you create and register template you should be able to use it.
Re STK - latest version doesn't have any dependency on data module - see module descriptor. Either I'm blind or there is no such dependency. :D
HTH,
Jan

How to point at the templates folder of a module in Drupal 7

How do you make Drupal read the templates you create or override in a module (when you create templates that get overriden in the theme folder, Drupal reads them automatically)?
When you implement hook_theme() or hook_theme_registry_alter() (in the case you are overriding a template file defined from another module), you use the "path" property to tell Drupal where the template file is.
This is particularly important with hook_theme_registry_alter(), since you are overriding the template file used by another module, and you want Drupal looks for the template file in your module's directory. With hook_theme(), it is important to use the "path" property when the template file is not in the directory containing the module (or the theme), but in another directory, for example in a sub-directory of the directory containing the module/theme.

Installing Module in Drupal 6

I've uploaded a new unzipped module folder into site/modules directory through ftp. But it is not shown in admin panel module lists from where I can configure it. Please help to solve the problem.
I've uploaded a new unzipped module folder into site/modules directory
through ftp
To be precise, you have to upload the module to sites/all/modules folder. Say you upload Views module, then there should be a file called /sites/all/modules/views/views.info. Not sites/modules/views.info . You'll have to create a folder called "modules" if this is your first contributed module installation
By default, Drupal clears module caches when you access modules list (D7: admin/modules , D6: admin/build/modules)
Make sure that you search the modules list well. it's long one so most likely that you miss it unless you know it's human-friendly name.
D7 only supports D7 modules, D6 only supports D6 modules,...
Mmm... You said you uploaded the module, but it's not appearing in configuration pages. Sorry if I don't understand what you are explaining and it's obvious but probably you did not enable the module (or a module that shows the UI's of this module) on admin/build/modules
Hope that helps!

Drupal hook that runs when modules are installed and uninstall?

I am trying to get a Drupal to run a custom hooks; one that needs to run when a module is being installed and another for when the module is being unistalled. Is there a hook or a trigger that I can use to have Drupal run the hook while the module is installing or uninstalling? The hook that I need to run builds taxonomy terms from an array. I am basing the lay out on the hook_schema. An example of the implementation of this hook is:
function mymodule_install_taxonomy() {
return array(
<<Taxonomy Structure Here>>
);
}
This code would be placed in the .install file.
When your own module is installed or for others?
For your own, there is hook_install() (only called the first time your module is installed, usually used to install the schema defined in hook_schema() in Drupal 6, this is automated in Drupal 7), hook_uninstall(), hook_enable() (called every time your module is enabled) and finally hook_disable() (when your module is disabled).
Drupal 7 has also added a similar set of hooks that is however called when other modules are installed, uninstalled, enabled or disabled, see hook_modules_*()

Resources