unity – How to set the z axis bound of the collider of child of an instantiated object to zero

The simplest way to fix this is to spawn your prefab at a position that places its children in the same z-plane as the objects you’re hoping to detect.

So for example if the object you want to detect is at z=0, and your prefab’s children are at z = 1 relative to their parent, and their parent isn’t scaled in the z axis or rotated in the x/y axes, then you would need to spawn the parent at z = -1 to cancel-out the child colliders’ offsets so they’ll sit at the z = 0 plane.

Since you haven’t shown us enough details of your setup for us to tell you exactly what position values to change, another option is to exclude Z from consideration in your test. We can do this by adding an extension method:

public static class PhysicsExtensions {
    public static bool Envelops2D(this Bounds a, Bounds b) {
        return (b.max.x <= a.max.x)
             & (b.max.y <= a.max.y)
             & (b.min.x >= a.min.x) 
             & (b.min.y >= a.min.y);
    }
}

Then you can change your if clauses to…

if (collider1.bounds.Envelops2D(other.bounds))
{            
    if (other.bounds.Envelops2D(collider2.bounds))
    {                  
         Destroy(other.gameObject);
         Destroy(gameObject);
         circles.instantiator();                
    }
}

Note that this is using only the bounding rectangles of your colliders, not their actual shapes. So for example this will say a radius-8 circle collider at (0, 0) envelops a radius-1 circle collider at (7, 7), even though that second circle is completely outside the first, but still inside its bounding rectangle. You can use radius and distance checks instead of bounds checks if you want to take the circular shape of the colliders into account.

html – Flexbox container with children that have a set top value but still behave like in a flexBox along the X-axis

HTML

<div class="flexContainer">
  <div class="booking blue"></div>
  <div class="booking green"></div>
  <div class="booking purple"></div>
</div>

CSS

.flexContainer {
  display: flex;
  width: 300px;
  background-color: red;
  height: 100vh;
}

.booking {
  flex: 1;
  height: 100px;
  position: relative;
}

.green {
  background-color: green;
  top: 50%;
}

.blue {
  background-color: blue;
}

.purple {
      background-color: purple;
      top: 50%;
    }

The goal from the drop box example for the blue box to have 100% width (of the red box) and the blue and green box should each be 50% wide of the red container. Atm they each take 1/3 of the width.

I basicly want to get the behaviour from a flexbox along the X-axis, as in the children take up 100% width if they are alone and share the space and take 50% width if they share the same postion as another child along the Y-axis.

However I wanna set a certain top value for each box, like in the cope pen example, except I want the boxes to take 100% width since they are alone in that area along the Y-axis. Can this be achieved with only CSS and HTML or do I need to involve JS for this?

column – Set Form Values from Popup window

Good Day,
I have the non-standard task. I have SharePoint Document List and Directory List. The Directory List includes three columns: “Process” (single-line field), “Process Group” (choice field), “Process Region”.
The Document List has “Process”, “Process Group”, “Process Region” fields too.

In the Directory List one Process Region includes several Process Groups, one Process Group includes several Processes.
The Directory List includes 100 list elements with filled “Process”, “Process Group”, “Process Region” fields.
I must create “Select Process” button on this Document List NewForm. The user wants to click this button and see Popup window.
The Popup window must display hierarchy “Process Region”, “Process Group”, “Process” from Dictionary List like Tree.
The user must click some process in Modal Window and that Process and his “Process Group”, “Process Region” values from Directory must become a field values “Process”, “Process Group”, “Process Region” on Document NewForm.aspx

Do the SharePoint standard methods to do that exist? Where can I see some JS code example to past values from Dictionary List to Modal Window, then past selected values from Modal Window to Document Form fields?

Thanks for any idea.

uno platform – How to set a CSS class for UNO Wasm element

I have an element like this

<TextBlock Text="Hello, world!" Margin="20" FontSize="30" x:Name="tctsample" />

I want to set a class “warning” to this element, I have tried something like this

     tctsample.SetCssClass("warning");

From official documentation
https://qa.website.platform.uno/docs/articles/interop/wasm-javascript-1.html

But this throws a compiler error

enter image description here

What am I doing wrong here?

iphone – iOS mail downloads when set to manual but on charge

This seems to be an ongoing problem to which I seem to have inadvertently found the solution. Apart from those already suggested, setting Push to off, all a/cs to manual including Fetch, you need to turn off Mail notifications. If this is on it appears to override all other settings and downloads mail from the server. Why it only does it when the phone or tablet is on charge beats me but for me at least it works!

8 – Content moderation “current revision” not set on nodes migrated from Drupal 7 where there are both a published and draft revisions

I am working on upgrading a Drupal 7 site to Drupal 8. The upgrade uses a content-only custom migration. The Drupal 7 source site and the Drupal 8 destination do not contain any custom modules other than a Drupal 8 custom module containing the custom migration configuration. Both source and destination site were created using the Standard install profile.

I have created migrations for both the node and node revisions of the Page content type. The page node consists of a media reference field and a paragraph reference field. After running the migration I notice that for migrate nodes which had both a published and draft version in which the draft revision is more recent than the published revision then the current content revision is not set.

Here is the moderation tab of such a node in Drupal 7:

enter image description here

Here is the moderation tab of the same node after migrating it to Drupal 8:

enter image description here

Following is the content_moderation_state_revision table from the destination database. The node in question is id = 3.

enter image description here

Following is the content_moderation_state_field_revision table from the destination database.

enter image description here

Here is the config for the Page node migration:

langcode: en 

status: true 

dependencies: {  } 

id: health_node_standard_page 

label: Standard Page Nodes 

audit: true 

migration_tags: 

  - Drupal 7 

  - Content 

migration_group: health 

deriver: DrupalnodePluginmigrateD7NodeDeriver 

source: 

  plugin: d7_node_extended 

  node_type: page 

process: 

  nid: tnid 

  vid: vid 

  langcode: 

    - 

      plugin: static_map 

      source: language 

      map: 

        und: en 

      bypass: true 

  title: title 

  uid: node_uid 

  status: status 

  created: created 

  changed: changed 

  promote: promote 

  sticky: sticky 

  revision_uid: revision_uid 

  revision_log: log 

  revision_timestamp: timestamp 

  field_h_content_blocks: 

    plugin: sub_process 

    source: field_content_blocks 

    process: 

      paragraphs: 

        plugin: migration_lookup 

        migration: 

          - health_paragraph_content_text 

        source: value 

      target_id: 

        - 

          plugin: extract 

          source: '@paragraphs' 

          index: 

            - 0 

      target_revision_id: 

        - 

          plugin: extract 

          source: '@paragraphs' 

          index: 

            - 1 

  field_h_image_featured: 

    - 

      plugin: sub_process 

      source: field_featured_image 

      process: 

        target_id: 

          - 

            plugin: migration_lookup 

            migration: health_media_image 

            source: fid 

  moderation_state: 

    - 

      plugin: static_map 

      source: moderation_state 

      map: 

        published: published 

        draft: draft 

        needs_review: needs_review 

      default_value: draft 

destination: 

  plugin: entity:node 

  default_bundle: h_standard_page 

migration_dependencies: 

  required: 

    - health_user 

    - health_paragraph_content_text 

    - health_media_image 

Here is the config for the Page node revisions migration:

langcode: en 

status: true 

dependencies: {  } 

id: health_node_revision_standard_page 

label: Node revisions - Standard Page 

audit: true 

migration_tags: 

  - Drupal 7 

  - Content 

migration_group: health 

deriver: DrupalnodePluginmigrateD7NodeDeriver 

source: 

  plugin: d7_node_revision_extended 

process: 

  nid: 

    - 

      plugin: get 

      source: nid 

  vid: 

    - 

      plugin: get 

      source: vid 

  langcode: 

    - 

      plugin: static_map 

      source: language 

      map: 

        und: en 

      bypass: true 

  title: title 

  uid: node_uid 

  status: 

    - 

      plugin: get 

      source: status 

  created: created 

  changed: changed 

  promote: promote 

  sticky: sticky 

  revision_uid: revision_uid 

  revision_log: log 

  revision_timestamp: timestamp 

  moderation_state: 

    - 

      plugin: static_map 

      source: moderation_state 

      map: 

        published: published 

        draft: draft 

        needs_review: needs_review 

      default_value: draft 

destination: 

  plugin: entity_revision:node 

  default_bundle: h_standard_page 

migration_dependencies: 

  required: 

    - health_node_standard_page 

Both migrations make use of a custom “Source” which extends the “d7_node” and “d7_node_revision” source plugins accordingly. These extended source plugins get the moderation state info of the relevant node or node revision.

/**
 * Extended version of core Drupal 7 node source from database.
 *
 * @MigrateSource(
 *   id = "d7_node_extended",
 *   source_module = "node"
 * )
 */
class D7NodeExtended extends Node {

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    // Make the node's moderation state available to migration.
    $database = $this->getDatabase();
    $vid = $row->getSourceProperty('vid');
    $query = $database
      ->select('workbench_moderation_node_history', 'wm')
      ->fields('wm', ('state'))
      ->condition('wm.vid', $vid)
      ->orderBy('wm.stamp', 'DESC')
      ->range(0, 1);
    $value = $query
      ->execute()
      ->fetchField();
    if ($value) {
      $row->setSourceProperty('moderation_state', $value);
    }

    return parent::prepareRow($row);
  }
}
/**
 * Extended version of core Drupal 7 node source from database.
 *
 * @MigrateSource(
 *   id = "d7_node_revision_extended",
 *   source_module = "node"
 * )
 */
class D7NodeRevisionExtended extends NodeRevision {

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    // Make the node revision's moderation state available to migration.
    $database = $this->getDatabase();
    $vid = $row->getSourceProperty('vid');
    $query = $database
      ->select('workbench_moderation_node_history', 'wm')
      ->fields('wm', ('state'))
      ->condition('wm.vid', $vid)
      ->orderBy('wm.stamp', 'DESC')
      ->range(0, 1);
    $value = $query
      ->execute()
      ->fetchField();
    if ($value) {
      $row->setSourceProperty('moderation_state', $value);
    }

    return parent::prepareRow($row);
  }
}

javascript – How to set a minimal window size in Proton Native applications

When I run an application built with Proton Native it seems to be there’s no minimal window size, so when I resize the window, I can shrink the window height to 0 pixels. Obviously the UI isn’t visible at that point.

Is it possible to specify a minimal window size so I can prevent UI disappearing when the window becomes to small?

I understand that creating a minimal window size that’s too big would be problematic for people with tiny or zoomed screens, but I’m only interested in making sure the UI doesn’t get moved outside the bounds of the window.

theming – How to set equal height to drupal blocks

I am using bootstrap theme with D8. I have 4 blocks. Each row should have 2 blocks. Below shows code for one block. Rest of the blocks have identical code except for the characters. If all the blocks have equal number of characters, all the blocks display in equal height just fine(please see image A). However, if any blocks have more characters than the other, some blocks get pushed out of the row (please see image B).

<section data-quickedit-entity-id="block_content/43" id="block-acquisitionpractices" class="col-lg-6 col-md-6 col-sm-6 col-xs-12 >
  
<h2 class="block-title">Acquisition Practices</h2>
<div data-contextual-id="block:block=acquisitionpractices:langcode=en|....></div>
<div data-quickedit-field-id="block_content/43/body/en/full" class="field field--name-body field--type-text-with-summary >
<div class="AcquisitionPractices  strategy-div row">
<div class="col-inner">
<img src="https://www.w3schools.com/html/pic_trulli.jpg" alt="Trulli" width="150" height="150"><h2 style="text-align: left;">Acquisition Practices</h2>
<hr><p> line 1</p>
<p> line 2</p>
<p> line 3</p>
<p> line 4</p>
</div></div></div>
      
</section>

Structure > blocks > blocks library > add basic block > I put FULL HTML code to create a block.

How can I create blocks so that blocks display in equal height?