Create module_name.install file in drupal 8 module directory and add related code into this file.

CommentFileSizeAuthor
#4 2740527-4.patch3.86 KBsagar ramgade

Comments

Nitin Shirole created an issue. See original summary.

nitin shirole’s picture

nitin shirole’s picture

Status: Active » Fixed
sagar ramgade’s picture

Status: Fixed » Needs work
StatusFileSize
new3.86 KB

Needs work as t() was called in column descriptions and State APu was used which shouldn't be the case. The patch attached addresses these issues.

  • Sagar Ramgade authored dffc61e on 8.x-1.x
    Issue #2740527 by Sagar Ramgade, Nitin Shirole: Create .install file
    
nitin shirole’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

humayunrashidchattu’s picture

I wanted to create a table with some predefined data on installing a custom module. How to achieve this?

kunalkursija’s picture

Hi @Sagar Ramgade,
I Was checking the patch's hook_uninstall() and I guess the code

\Drupal::service('config.factory')->getEditable('download_count.settings')->delete();

is not required because Drupal core automatically deletes the configuration related to the module we uninstall.

sagar ramgade’s picture

It does only when configurations has a dependency set, please see this https://drupal.stackexchange.com/questions/173684/how-to-remove-mymodule..., so we should set dependency in the configs.