Friday, January 22, 2021

Disabling a Module via the Database in Drupal 8

 

1) In D7 you could do this in the systems table by setting the status to 0. In D8, however this is stored in the config table. You can edit the blob value in the data field for this result:

SELECT * FROM config WHERE name like '%.extension%';


2) Or here's the fast (but dirty) solution:

- Delete the module's folder from the file system (/modules/

- truncate table cache_config using below commands 

 ---------------------------------------------------------------------


TRUNCATE cache_config;

TRUNCATE cache_container;

TRUNCATE cache_data;

TRUNCATE cache_default;

TRUNCATE cache_discovery;

TRUNCATE cache_dynamic_page_cache;

TRUNCATE cache_entity;

TRUNCATE cache_menu;

TRUNCATE cache_render;

TRUNCATE cache_toolbar;

Tuesday, September 1, 2020

WordPress - Disable Lost your password Link and Page Code

 // Disable Lost your password Link and Page

function remove_lostpassword_text ( $text ) {

         if ($text == 'Lost your password?'){$text = '';}

                return $text;

         }

add_filter( 'gettext', 'remove_lostpassword_text' );


add_action('init','possibly_redirect'); 

function possibly_redirect(){ 

   if (isset( $_GET['action'] )){  

     if ( in_array( $_GET['action'], array('lostpassword', 'retrievepassword') ) ) {

        wp_redirect( '/wp-login.php' ); exit;

     }

  }

}


Thursday, August 9, 2018

Drupal Menu not Saving Due to max_input_vars

Add below line to the php.ini or .user.ini which is located in site root folder, if this file is not available you care create and add this line and upload it to the server.
------------------------------------------
max_input_vars = 2000
------------------------------------------

OR

Add these lines to your .htaccess file:
php_value post_max_size = 20000M
php_value upload_max_filesize = 20000M
php_value max_execution_time = 30000
php_value max_input_time = 60000
php_value memory_limit = 8000M
php_value max_input_vars = 8000
php_value suhosin.post.max_vars = 8000
php_value suhosin.request.max_vars = 8000

Tuesday, June 19, 2018

Drupal special characters showing like & and   etc... in drupal page title. Code for fix

Replace below code in page.tpl:
<?php print html_entity_decode($head_title) ?>
instead of
<?php //print $title; ?>

Wednesday, November 8, 2017

Youtube Video Link directly to particular time


Here is the Youtube Video Link directly to particular time link code.

https://www.youtube.com/watch?v=whGwm0Lky2s&feature=youtu.be&t=14m11s

Thursday, April 20, 2017

How to add drupal block into a node?

<?php
     $block = module_invoke('block_name', 'block_view', 'block_id');
     print render($block['content']);
 ?>