If you do please leave something for me :)
I hope you take something away...
MySQL screwed up after brew upgrade
PROBLEM
I ran
brew upgrade
It updated my mysql installation to 8.0.12. Previously I was working with 5.7.22. Now each time I start mysql using the following commands
mysql.server start
OR
brew services mysql restsrt
MySQL does not start properly
Most probably the error you will face is
.. ERROR! The server quit without updating PID file
SOLUTION
When I run
Add a NOT IN condition and a nested query to your views WHERE condition
PROBLEM:
I needed to add a NOT IN condition with a nested query for the WHERE condition. The usual method wont work
$view->query->where[1]['conditions'][] = array(
['field'] => 'groups_group_membership.type'
['value'] => array
(
[0] => 'SELECT_QUERY_HERE'
)['operator'] => IN
);
SOLUTION :
The way that works
How to print the formatted backtrace of function calls in Drupal
Problem:
Drupal sometimes shows errors as follows
Message EntityMetadataWrapperException: Unknown data property field_activity_status.
Convert a 3D model to JSON with Three.JS library
Problem
Converting a given 3D model (a .obj file) to JSON format
Solution
Three js has its own converter now
requirements
The converted location in source code
https://github.com/mrdoob/three.js/tree/dev/utils/converters
How to set selected="selected" in VueJS
Problem: I have a select element. The options are populated using an array and while populating the select element I want to also set the selected value. How do I do this.
Solution
use v-bind:se;ected OR :selected with a boolean expression that returns TRUE or FALSE. If it returns TRUE that will be the selected value. See example below
Fix permissions in /tmp folder for mac
Problem:
I messed up my /tmp folder permissions
OS details
Solution:
Follow the below steps to get it resolved.
- Reboot your Mac into recovery mode
-
Open Utilities menu in the top bar > open Terminal
csrutil disable
-
Reboot
Programatically rewrite view fields in Drupal 8
Problem: I had the need to re-write some view fields programatically
Solution:
- first use template_preprocess_views_view_fields hook
ex:- yourtheme_preprocess_views_view_fields(&$variables)
A future waiting to know...
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.