Swati
Swati

Reputation: 7

how do i migrate custom module from drupal 7.39 to drupal 8.0.5

Reference link: http://www.drupalwoo.com/content/blog/my-first-drupal-8-module

module_name.info.yml

name: module_name description: 'A module for making online module_name.' type: module core: 8.x package: Custom version: 8.x

module_name.routing.yml

module_name_report: path: 'admin/module_name' defaults: _title: 'module_name Reports' _controller: '\Drupal\module_name\Controller\module_nameController::module_nameReport' requirements: _permission: 'access content'

module_name_myschool: path: 'admin/module_name/myschool' defaults: _title: 'My School module_name Reports' _controller: '\Drupal\module_name\Controller\module_nameController::mymodule_nameReport' requirements: _permission: 'access content'

module_name_allschool: path: 'admin/module_name/allschool' defaults: _title: 'All School module_name Reports' _controller: '\Drupal\module_name\Controller\module_nameController::allmodule_nameReport' requirements: _permission: 'access content'

module_name_getpsms: path: 'admin/module_name/getpsms' defaults: _title: 'All School psms Reports' _controller: '\Drupal\module_name\Controller\module_nameController::allabcdReport' requirements: _permission: 'access content'

module_name.module.yml

array( 'title'=>'module_name Reports', 'route_name' => 'module_name_report', ), 'admin/module_name/myschool' => array( 'title'=>'My module_name Reports', 'route_name' => 'module_name_myschool', ), 'admin/module_name/allschool' => array( 'title'=>'All module_name Reports', 'route_name' => 'module_name_allschool', ), 'admin/module_name/getpsms' => array( 'title'=>'All abcd Reports', 'route_name' => 'module_name_getpsms', ),

);  

}

/** * Implementation of hook_permission(). */

/* function module_name_permission() { return array( 'administer module_name' => array( 'title' => t('Administer module_name'), 'description' => t('Administer Student module_name.'), ),

'access module_name' => array(
'title' => t('Access module_name'),
'description' => t('Access Student module_name.'),
),

'create module_name' => array(
'title' => t('Create module_name'),
'description' => t('Create Student module_name.'),
),

'administer module_name reports' => array(
'title' => t('Administer module_name Reports'),
'description' => t('Administer Student  module_name Reports.'),
),  

); }*/

module_name.controller.php

namespace Drupal\enquiry\Controller;

use Drupal\Core\Controller\ControllerBase;

/** * Route controller for module_name. */ class module_nameController extends ControllerBase {

/**
 * Implementation of hook_help().
 */
public function enquiryHelp($path, $arg) {   
}

/**
 * Implementation of hook_init().
 */

public function module_nameInit() {        

}

/** * Displays a enquiry report. */ public function module_nameReport() {

}

public function mymodule_nameReport(){

}

public function allmodule_nameReport() { }

public function allabcdReport() {

}

folder structure

module_name src - controller: module_name.controller.php module_name.info.yml module_name.module.yml module_name.routing.yml

My question:

module showing "Extend" list. after install the module not showing permission from role/permission area. Performance also not happening from configuration tab.

Upvotes: 0

Views: 86

Answers (1)

Imran Sarder
Imran Sarder

Reputation: 1

I hope the following information will help you:

1) Drupal module upgrader: There is a video in the module page. You can convert your Drupal 7 module to Drupal 8 using this module. This module will provide some terminal commands.

2) Drupal console (Click here): If you can install this tools, you will be surprised, because there are many commands, you can create a new modules using terminal. You can crate controller, block, form, permission and more using drupal console tools.

3) My personal opinion for you, please try to create your first module using the following documentation https://www.drupal.org/developing/modules/8

4) Finally explore the drupal 8 example modules. There are more examples in this module. You can copy and paste and see the output for learning.

Thanks

Upvotes: 0

Related Questions