Sharepoint 2016 form with three PeoplePickers that allow multiple in their respective field

I am following this tutorial on how to configure a PeoplePicker and send the selected values ​​through the API.

My question revolves around a form that has 3 PeoplePickers. (Mgr, 2nd Mgr, and Assistant). The part of the tutorial that confuses me is this section:

// Get the people picker object from the page.
    var peoplePicker = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan;

Since I have three people who select different people, how can I keep track of who selects which person? Do I define three different PeoplePickers in that section of the code? Something like:

// Get the people picker object from the page.
    var peoplePicker1 = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv1_TopSpan;
    var peoplePicker2 = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv2_TopSpan;
    var peoplePicker3 = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv3_TopSpan;

That just doesn't seem right … especially because of this code a few lines later …

// Get information about all users.
    var users = peoplePicker.GetAllUserInfo();
    var userInfo = '';
    for (var i = 0; i < users.length; i++) {
        var user = users(i);
        for (var userProperty in user) { 
            userInfo += userProperty + ':  ' + user(userProperty) + '
'; } } $('#resolvedUsers').html(userInfo);

I appreciate any suggestions for help on how to approach a form with three people on it.

views: rewriting results output creates 2 links for a custom text field rewritten one by one

I am using replacement patterns to rewrite the results of my content title field with the manufacturer's name in front of the title. I am using the following custom text to achieve this:

{{ field_tool_manufacturer }}
{{ title }}

Then I am generating this field as a custom link, with the path Node/{{ nid }}

The problem is that I realize that the only title field rewritten with the manufacturer added to the front is issued as 2 separate links, instead of one. One link for the manufacturer and one for the title. This, of course, is not optimal for UX since it communicates 2 separate links when the mouse passes, etc.

The results are the same without the line break, and the manufacturer's field is excluded from the display and is not published as a link itself. I did this with very few problems in Drupal 7, and I wonder if this is a mistake or if there is a structural change that is causing the 2 links. Any help would be appreciated, and let me know if I omitted any useful information.

Thank you!

8 – How to display a field of the main store in my module?

I have a Drupal 8.7 site with the Drupal Commerce 2.14 module.

I created a market (several merchants in the same place). In the type of store, I created a field "Text (formatted, long)" with the name of the machine field_terms_and_conditions.

In this field, the merchant writes his general conditions of sale, which the customer must accept during the order process.

When the customer orders in several stores, this will create several shopping carts (the store name is shown above each shopping cart). It works very well. Now that Drupal Commerce handles the address book, the orders are very fast.

I have currently created a view that shows the content of the field. field_terms_and_conditions on a page I also created a custom module to display a checkbox with a link to the general conditions of sale in a modal window.

I want to directly render the field field_terms_and_conditions in the modal window without using a view. How to do this ?

/src/Plugin/Commerce/CheckoutPane/MarketplaceTermsAndConditions.php :

    $store_id = $this->order->getStoreId();
    $pane_form('#attached')('library')() = 'core/drupal.dialog.ajax';
    $attributes = (
      'attributes' => (
        'class' => 'use-ajax',
        'data-dialog-type' => 'modal',
        'data-dialog-options' => Json::encode((
          'width' => 'auto'
    $link = Link::fromTextAndUrl(
      $this->t('terms and conditions of the store "@store_name"', ('@store_name' => $store_name)),
      Url::fromUri("internal:/store/$store_id/cgv", $attributes)
    $pane_form('marketplace_terms_and_conditions') = (
      '#type' => 'checkbox',
      '#default_value' => FALSE,
      '#title' => $this->t('I have read and accept @terms.', ('@terms' => $link)),
      '#required' => TRUE,
      '#weight' => $this->getWeight(),
    return $pane_form;


forms: use of a fixed decimal when filling in a currency amount entry field

When entering amounts of currency into an input field, I have seen two methods:

Decimal with key: The keyboard includes the decimal character and the user enters the decimal along with the numbers. The Chase mobile application uses this approach.

Key  Display
 5       $5
 4      $54
 .     $54.
 6    $54.6
 3   $54.63

Fixed Decimal: The keyboard excludes the decimal character and the numbers are completed around a fixed decimal. PayPal and Square mobile applications use this approach.

Key  Display
 5    $0.05
 4    $0.54
 6    $5.46
 3   $54.63

The decimal approach with a key seems simpler to me, and it also requires 2 keystrokes less when entering non-decimal amounts (for example, $ 10 only requires writing 1-0, instead of 1-0-0-0). However, users of our payment processing application have accidentally charged amounts such as $ 123,456.00 instead of $ 1,234.56 because they expected a fixed decimal interaction instead of a key decimal interaction.

Is it just a matter of preference, or are there other merits to a fixed decimal approach that you may be overlooking?

How to toggle between two custom fields in the add-in & # 39; WC Product Field Group & # 39; WordPress woocommerce?

I have a full suit that adapts the WordPress website and I use it with the woocommerce plugin. I need 2 groups of custom fields to display on a single product page.

  1. Custom measurements (accurate)
    In this method, the customer has to measure and enter all the data, such as height, weight, etc.

  2. Standard sizes (fast)
    This is the world standard size. Small, medium, large, etc.

I have created 2 groups of custom fields and they are only visible with & # 39; Product category name & # 39;

I need to alternate between these 2 field groups when a customer selects their interested 1 or 2 measurement method.

I don't have a good knowledge of PHP, so if possible, I prefer some easy method to do it.

enter the description of the image here

Lightning Network – BOLT 11 – Why is the description field limited to 639 bytes?

Why is the description field limited to 639 bytes?

Each field in the lightning bill has the form:

  1. type (5 bits)
  2. data_length (10 bits, big-endian)
  3. data (data_length x 5 bits)

the data_length indicates the size of the data That must be followed. As data_length It has a size of 10 bits, it can represent a number of up to 1023 (210 -one). Therefore, the size of data it can have a maximum of 1023 * 5 bits or 639,375 bytes. This puts the upper limit of 639 bytes in the description field.

8 – Show block when the Boolean field is marked

I currently have a custom block (created programmatically) that is shown in my type of news content (through the design generator). The code I used for the block is below.

class NewsButton extends BlockBase {

   * {@inheritdoc}
  public function build()
    return ('#markup' => '' . t('NEWS') . '');


However, everything shows perfectly, there is a Boolean field in the type of content that, when checked, should display the word "Updates" instead of "News", the same button style but different text. I have been searching the forums and I found the following article, but I wonder if there is an easier way to achieve it or if it is the best.


Should I try to add an if else statement to the previous code to change the text and the url of the button when the Boolean field is marked in the content type or is there some other method (maybe a branch?) To update the button text inside my block?

postgresql: the expression index in a citext field is ignored, why?

It runs on RDS with approximately 32 million rows.

PostgreSQL 11.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit

It also tests locally on macOS with approximately 8 million rows.

PostgreSQL 11.5 on x86_64-apple-darwin16.7.0, compiled by Apple LLVM version 8.1.0 (clang-802.0.42), 64-bit

I have a field called old_value that is of type citext. Some of the values ​​are very long (more than 2172 characters), so I am cutting the data for the index in this way:

CREATE INDEX record_changes_log_detail_old_value_ix_btree
    ON  record_changes_log_detail 
    USING btree (substring(old_value,1,1024));

But the index is not used. At some point, this was likely because the CONCURRENTLY INDEX was exploding too long and leaving an invalid index behind. Here is a simple script to activate invalid indexes:

select *

 from pg_class,

where pg_index.indisvalid = false and
      pg_index.indexrelid = pg_class.oid;

I dropped and then rebuilt the index, and it no longer appears in the search for an invalid index. It is shown as existing in the table. The entry pg_indexes.pg_indexes reads like this:

CREATE INDEX record_changes_log_detail_old_value_ix_btree ON data.record_changes_log_detail USING btree ("substring"((old_value)::text, 1, 1024))

I tried to transmit :: citext or :: text in the creation or query of the index, but it doesn't seem to matter. As I understand it, citext stores text and only modifies the comparison method, so the conversion probably makes no sense. I used a script that I found here to verify custom collations:

select table_schema, 
from information_schema.columns
where collation_name is not null
order by table_schema,

Any. The database is set to en_US.UTF-8.

So, I have millions of rows, an expression index that is marked as valid, and an equal search. Leaving for a second the question "does it make sense to use a tree B here?", Why is the index not used? A = o starts with LIKE should be able to use a B tree here since the query is anchored to the left. Here is a query analysis:

explain analyze select * from record_changes_log_detail where old_value = 'SYNTHES CLICK X' limit 5;
Limit  (cost=0.00..3413.76 rows=5 width=90) (actual time=126.642..3217.274 rows=4 loops=1)
  ->  Seq Scan on record_changes_log_detail  (cost=0.00..858901.65 rows=1258 width=90) (actual time=126.640..3217.268 rows=4 loops=1)
        Filter: ((old_value)::text = 'SYNTHES CLICK X'::text)
        Rows Removed by Filter: 31047058
Planning Time: 0.067 ms
Execution Time: 3217.294 ms

Depending on when I tried, sometimes I have seen the index used, but in general not. I am getting a full sequential scan all the time now.

Suggestions? And, for the record, I'm creating a hash index locally to prove it, since it will be smaller and should work fine for = searches, most of what people want.

Thank you very A lot for any help.

Deleted views after changing the content field

It happened three times so far.

After deleting one field and replacing it with another in one type of content, some pages are missing or restarted. Of course, the deleted fields were used on those deleted pages.

The last two days the pages created with the Page Manager and the panels were formatted (the views disappeared), so I need to put and configure the views once again.

Today, after changing the type of content, a page created by Views disappeared.

I guess it happened before, would you have any advice on what I'm doing wrong? Is it possible that by deleting content fields, Drupal deletes the sites that contain that field?