I need to alter Paragraphs field, but only text_format field type getting alter, Other field not getting alter

I need to alter Paragraphs field, but only text_format field type getting alter, Other field not getting alter in drupal 8

function mymodoule_field_widget_entity_reference_paragraphs_form_alter(&$  element, &$  form_state, $  context) {   if ($  element['#paragraph_type'] == 'text_and_counter_block') {     //echo '<pre>'; var_dump($  context);     //print_r($  element['paragraph__field_background_style']); exit();     $  element['subform']['field_two_column_title']['widget'][0]['#title'] = 'Altered title';     $  element['subform']['field_two_column_style']['widget'][0]['#title'] = 'Altered title';    } } 

Massive window I can’t reduce in size – how to alter the “Program supplied minimum size”

I have a window (TortoiseHg) that whenever I open it is massive and I can’t reduce the size. I know about Alt-drag and I can (eventually) get to the edge, but I can’t reduce the size. If I run xwininfo -all the information includes:

xwininfo: Window id: 0x7200005 "TortoiseHg Workbench"    Root window id: 0x192 (the root window) (has no name)   Parent window id: 0x111e83a (has no name)      1 child:      0x720000e (has no name): ()  1x1+-1+-1  +4271+546    Absolute upper-left X:  4272   Absolute upper-left Y:  547   Relative upper-left X:  1   Relative upper-left Y:  28   Width: 16383   Height: 16383   Depth: 24   Visual: 0x139   Visual Class: TrueColor   Border width: 0   Class: InputOutput   Colormap: 0x7200004 (not installed)   Bit Gravity State: NorthWestGravity   Window Gravity State: NorthWestGravity   Backing Store State: NotUseful   Save Under State: no   Map State: IsViewable   Override Redirect State: no   Corners:  +4272+547  --15135+547  --15135--15850  +4272--15850   -geometry 16383x16383+4272+547    ...    Normal window size hints:       Program supplied minimum size: 16383 by 16383       Program supplied window gravity: StaticGravity   No zoom window size hints defined    No window shape defined   No border shape defined 

In particular this line:

      Program supplied minimum size: 16383 by 16383 

I have tried:

  • removing ~/.config/TortoiseHg/ and re-running
  • searching for files in ~/.cache/ or ~/.local/share/ for something that might cause this
  • searched dconf and gconf using this technique for any keys referring to thg or tortoise (case insensitive grep)
  • running with strace -f thg looking for files it is opening that might set the minimum size

But I have not found anything that tells me where the “Program supplied minimum size” might be coming from. Anyone know?

I’m using Ubuntu 18.04 with the Ubuntu Mate session, installed via the ubuntu-mate-desktop package. The system is a laptop with 2 extra monitors attached via a USB-C docking station. I have disabled HiDPI/scaling options.

How do I alter the existing filter in search api?

In drupal 7, How do I alter the existing filter? For example, I have a node title as an exposed filter and in hook_search_api_query_alter I want if any node title starts with “c” character brings all the nodes starts with “C” characters.

Below is my code which is adding a new condition, however, I want to update the existing filter condition.

function product_glossary_search_api_query_alter(SearchApiQueryInterface $  query) {   if (arg(0) == 'product-search') {      if (isset($  _REQUEST['title'])) {       if (!empty($  _REQUEST['title']) && strlen($  _REQUEST['title']) == 1) {           $  char_search = $  _REQUEST['title'];         $  query->condition('title', $  char_search.'%', 'LIKE');       }     }    } } 

Output of this alter is as below. enter image description here

Please suggest.

Two Databases in Standby/ Read-Only, Can Only Alter to SINGLE_USER One of Them

I am setting up Transaction Log shipping in Standby/ Read-Only mode of two databases to multiple instances.

One if the databases has no issue when I:


the other one throws an error:

Failed to update database "other_dbname" because the database is read-only. 

I cannot see any difference between the two. I’ve checked properties and all of the options are the same. From the options tab, the database that would throw the error had the Compatibility level set to SQL Server 2012 and one that would allow me to ALTER had that value set to SQL Server 2014, but changing them both to 2014 did not resolve the issue.

I’m at a complete loss as to what the issue could be or what I could look into that would point me in the correct direction.

how to alter the drupal webform data before post to other url

I have a drupal webfrom with one radion button input and another one is number input and i am posting the from to outside url and my question is i need to aissign number input value to radio input if user select other value in radio input .

example : my web from elements : amount ( radio button ) , amount2(number input)

if user select other option from amount input , i need to assign amount2 to amount before doing post action , how to do this programatically ??

Drupal 8 – populate a field in form alter with user name and one with user id

can someone tell me why this works

function justatest_form_alter(&$  form, $  form_state, $  form_id) {    global $  user;   if ( $  form_id == 'node_test_form'){     $  form['field_owner']['widget'][0]['value']['#default_value'] = 'test';   }   return $  form; } 

but this doesn’t

function justatest_form_alter(&$  form, $  form_state, $  form_id) {        global $  user;       if ( $  form_id == 'node_test_form'){         $  form['field_owner']['widget'][0]['value']['#default_value'] = $  user->uid;       }       return $  form;     }  

I’d also like to know how I get the current users name too, if someone can assist with that it would be much appreciated.

Many Thanks

Drupal 8 Alter views exposed form

I have a view that in that view I set up 3 exposed filter, all working fine. I need to set a condition to show the third filter option to a specific user, it can be checked according to the user role, but how I should do that?

anyone can provide a hook to help me?

previously I try this but It does not change anything!

function my_modulename_form_alter(&$  form, $  form_state, $  form_id) {   if($  form_id == 'views_exposed_form') {     //unset($  form['average']);     var_dump($  form);     die();   } } 

My view looks like this enter image description here

How to access specific checkboxes in a widget_type form alter?

I have a Paragraph with two List (text) fields. One is using the Select widget and the other using Check boxes. There are 14 checkbox options—I’m trying to show/hide certain checkboxes based on the value of the select.

In my hook_field_widget_WIDGET_TYPE_form_alter() function, I can’t figure out how to access the checkbox elements in such a way so that I can alter their ['#states'].

function test_field_widget_paragraphs_form_alter(&$  element, &$  form_state, $  context) {   if ($  element['#paragraph_type'] == 'my_test') {     $  select = $  element['subform']['field_select']['widget'];     $  checks = $  element['subform']['field_checkboxes']['widget'];     $  element['subform']['field_checkboxes']['widget']['#title'] = "This works."   } }  

Inspecting the $ checks variable I can see the individual ['#options'] as well as default_values but I can’t sort out the syntax to use so that I can alter their states.

// Null and null: $  element['subform']['field_checkboxes']['some_checkbox']; $  element['subform']['field_checkboxes']['widget']['some_checkbox'];  // Returns a `Drupal\Core\Field\FieldFilteredMarkup` object, not the form element. $  element['subform']['field_checkboxes']['widget']['#options']['some_checkbox']; 

Am I barking up the wrong tree?