Wednesday, March 20, 2019

[success] No site aliases found. drush 9

[success] No site aliases found. drush 9

Running drush sa returns below message in drush 9?

[success] No site aliases found.

Here is the solution:
NOTE: Tested with drush installed globally

Run drush debug command:
drush st --debug -vvv
 Sample output from above:

 [preflight] Config paths: /home/sastha/.composer/vendor/drush/drush/drush.yml
 [preflight] Alias paths:
 [preflight] Commandfile search paths: /home/sastha/.composer/vendor/drush/drush/src
 [bootstrap] Starting bootstrap to max [0.3 sec, 7.64 MB]
 [debug] Trying to bootstrap as far as we can [0.3 sec, 7.64 MB]
 PHP binary    : /usr/bin/php7.2
 PHP config    : /etc/php/7.2/cli/php.ini
 PHP OS        : Linux
 Drush script  : /home/sastha/.composer/vendor/drush/drush/drush
 Drush version : 9.6.0
 Drush temp    : /tmp
 Drush configs : /home/sastha/.composer/vendor/drush/drush/drush.yml


Alias Path is missing as highlighted above


Sample drush.yml content:
sastha@DESKTOP $ cat /home/sastha/.composer/vendor/drush/drush/drush.yml
#This is a Drush config file. Sites may override this config to change minimum PHP.
drush:
  php:
    minimum-version: 5.6.0
  paths:
    alias-path:
     - /home/sastha/sites

Check if alias-path is set?

sastha@DESKTOP $ drush st --debug -vvv
 [preflight] Config paths: /home/sastha/.composer/vendor/drush/drush/drush.yml
 [preflight] Alias paths: /home/sastha/sites
 [preflight] Commandfile search paths: /home/sastha/.composer/vendor/drush/drush/src
 [bootstrap] Starting bootstrap to max [1.47 sec, 7.64 MB]
 [debug] Trying to bootstrap as far as we can [1.48 sec, 7.65 MB]
 PHP binary    : /usr/bin/php7.2
 PHP config    : /etc/php/7.2/cli/php.ini
 PHP OS        : Linux
 Drush script  : /home/sastha/.composer/vendor/drush/drush/drush
 Drush version : 9.6.0
 Drush temp    : /tmp
 Drush configs : /home/sastha/.composer/vendor/drush/drush/drush.yml

Problem solved!

Yes formatting is bad because no one is reading my blog except me :) :) :)

Friday, March 1, 2019

Drupal 8 Composer failure on Windows 7 with the message "bin\phpcs" "--config-show" "installed_paths"" failed.

Drupal 8 Composer failure with the below message on Windows 7:

 ""D:\www\mydrupalsite/vendor/bin\phpcs" "--config-show" "installed_paths"" failed.

Solution: 

Save this as phpcs.bat inside D:\www\vendor\bin:

@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../squizlabs/php_codesniffer/bin/phpcs
php "%BIN_TARGET%" %*

Monday, February 4, 2019

DrupalcampNJ: YouTube Channel

Drupal 8: Using Kint to print views fields

How to print fields variable of a views?

{{ kint(fields) }}

To resolve Out of memory issue:
https://www.drupal.org/project/devel/issues/2764023

Edit modules/devel/kint/kint/config.default.php and set $_kintSettings['maxLevels'] to a lower number (the default is 7)

My recommendation: Set it to 4 if you are using Windows


PHP error while enabling Drupal 8 Devel Module

Error Message:
The website encountered an unexpected error. Please try again later.Symfony\Component\Routing\Exception\RouteNotFoundException: Route "devel.execute_php" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 202 of core\lib\Drupal\Core\Routing\RouteProvider.php).

Reason:
Most probably you are installing Devel module (8.x-2.0) with Admin Toolbar installed

Fix:
https://www.drupal.org/project/admin_toolbar/issues/3009193
Upgrade to latest version of Admin Toolbar (8.x-1.26)

Monday, April 6, 2015

Acquia Certified Developer

I am a proud Acquia Certified Developer (Drupal) from today! :)


Friday, December 30, 2011

2011 & Me!!

It’s been quite a long time, since I have posted something in my blog. So I have decided to scribble few things in this borrowed space from Google, to end this year. There is no big fan following for my writing, so no worries even if I make grammatical mistakes, unnecessary punctuations or discuss worthless topics.

Survival:

Like everyone in this densely populated, extremely polluted and massively corrupted country, I relocated to the Silicon Valley of India nothing for a single reason, Food. Once Chennai knocked me out badly, survival became a tough job for me near the end of 2010. Bangalore helped for survival and a decent comeback. It’s not required I have to stick with what is written as the title of this blog! No one questioned why movies are named irrelevant to the content shown.

Truth:

I became the most loved to most hated individual. I learnt it is not required to mention why we hate someone? Never imagined about how future will be, while living this moment. May be people don’t like this attitude and definitely it’s a tough decision to think about a guy who is having no money. Finally, what is true is "Truth won’t die, but can be killed."

Career:

New Company, new people, new environment almost everything settled when New Year begin for me. I approached this year with my own philosophy, "Hard work decides what you deserve". But nothing great is achieved now.

Travel:

Every day I have to travel one and a half an hour to reach office from my shared house. Red painted overpaid Volvo buses are offering not only luxury but also showed me how people live in a High-tech city. From multi branded wardrobes, glittering shoes, imported gadgets, multi-lingual conversations to mechanical life style, worried faces etc. Volvo is my teacher, guide, companion, park and everything.

I want to make a rough calculation of how many kilometers I have travelled (to and fro) this year.

Shared house to office: 40 Km per day * 15 days per month* 12 months = 7200 Km
Bangalore to Chennai: 360 Km * 3 times per month * 12 months = 12960 Km
Bangalore to Kodaikanal: 750 Km * 1 time = 750 Km
Approximately, I have travelled 20910 Km this year!

Books:

Travel pushed me to read. Books I have read Shall we tell the president?, 2 States, Bad luck & Trouble (still in progress),The Alchemist and Revolution 2020. Good to have few collections in my hand and mind.

Thanks:

Mid 2011 presented me unforgettable people and unforgettable moments. I feel happy for that. But I couldn’t relocate my mother along with me, for which I should scold myself as 'Stupid'.

Hope the New Year 2012 will bring more surprises. I still believe, Truth alone triumphs!

Thanks to God.