I hope you take something away...

If you do please leave something for me :)

A future waiting to know...

Submitted by nmeegama on Sat, 02/17/2018 - 16:28

A lifetime a lifetime of mistakes and courage

the People the people that surround you each day

It hurts it hurst when you know you will leave them

its best, its best if you go first and not see them go

Selfish is it selfish to feel this way or is it fear to just let go

 

to think, to think if you did do the right thing

If not, if not just turn back and say sorry

You wish, you wish you could go back in time

Just fix, just fix what you left there to die

But no, you just cannot go back and lie

 

Drupal 8 - get blocks assigned to a region

Problem: There is no specific function in Drupal 8 which we can use to get all blocks assigned to a region. We used to have a function called block_get_blocks_by_region in Drupal 7 to do this

 

Solution : Although we don't have a specific function we have the tools in Drupal 8 s Object oriented hierarchy to do the same. Here is the code

 

function my_module_get_blocks_by_region($region) {

  $blocks = \Drupal::entityTypeManager()

    ->getStorage('block')->loadByProperties([

Drupal 8 Error when synching THEMENAME.settings

Problem

I cam across an error when synching configurations from my Drupal 8 local environment to my development environment. The error is as folllows

Error: configuration THEMENAME.settings depends on the THEMENAME extension that will not be installed after import.

Not entirely sure if this is a bug in D8 core but the root cause was that it when exporting the configurations from my local environment the "Configuration manager" module in D8 core was picking up an odd looking configuration.