Tuesday, June 25, 2019

Migration path info for drupal 8

if the path of your csv file is in the root of your project then:
source:

  plugin: CSV

  path: your_file.csv
the best practice is to put the csv file into your migrate module in a directory "artifacts" for example the structure should be as below:
-- custom_migrate_module

   +-- artifacts

         +-- your_file.csv

   +-- config

   +-- src

   +-- custom_migrate_module.info.yml
in this case your migration confg file should be:
source:

  plugin: CSV

  path: modules/custom/custom_migrate_module/artifacts/your_file.csv

Thursday, June 13, 2019

Useful Drupal 8 modules

1. Conditional Fields - Allows for easy creation of conditional fields for content types.

Tuesday, June 11, 2019

find unprintable characters in vim

Using range in a [] character class in your search, you ought to be able to exclude the ASCII hexadecimal character range, therefore highlighting (assuming you have hlsearch enabled) all other characters lying outside the ASCII range:

/[^\x00-\x7F]
This will do a negative match (via [^]) for characters between ASCII 0x00 and ASCII 0x7F (0-127), and appears to work in my simple test. For extended ASCII, of course, extend the range up to \xFF instead of \x7F using /[^\x00-\xFF].

You may also express it in decimal via \d:

/[^\d0-\d127]
If you need something more specific, like exclusion of non-printable characters, you will need to add those ranges into the character class [].

Thursday, June 6, 2019

Search through Git logs!

So, you want to search your git commit logs. Good news! It's really easy, and I'm going to show you how to do it.
If you use git, you're probably already familiar with the classic UNIX string searching tool, 'grep.' (If you already know about grep but want something better, you should try out Ack, but that's an unrelated issue.)
Lucky for you, git has a 'grep' mode!
Suppose I wanted to search for the string "facebook" in all of the commit messages of my project. All it takes is this one command:
git log --grep="facebook"
and you'll see all of the log messages which contain the our search term!
Okay, now suppose that you want to search more than just the commit messages, but the commits themselves. Simple! Drop the 'log' argument.
git grep "facebook" $(git rev-list --all)
This will show the commit ID and line number of all instances of your string. (The string can also be a regular expression, which is handy if you know regex, too.)
This can be made slightly more human-friendly by using the 'pickaxe' feature of git log grep, like this:
git log -S"facebook"
which will show all the commit messages of commits which include your string.
Hope this helped!

Monday, June 3, 2019

Unable to install , already exists in active configuration.

When I come accross this error:  Unable to install <module>, <config name> already exists in active configuration.

Try this:


fin drush config:delete <config name>