entities – Add new default value to existing content type

I’m currently on the latest version of Drupal 8. I have a content type called News and Articles. In this content type I have a field called Category which is a taxonomy term -> Entity reference field. When I first created this content type I added all my categories as default values.

Now 2 years later I want to add another default value to this content type. All the answers I’ve seen so far deal with making the change through the database. I wanted to see if there was a different option? Reason is because I have about 400 pages using this content type, really don’t want to make a new one.

Here a screenshot to the list I want to add to: https://ibb.co/XyJ58yS

sharepoint online – SP REST – add an existing group to site with REST api?

You can assign permissions to SharePoint group using SharePoint REST API like:

function setPermissionForGroup(){
    $.ajax({
        url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/roleassignments/addroleassignment(principalid=<GroupId>, roledefid=1073741827)",
        type: "POST",
        contentType: "application/json;odata=verbose",
        headers: { "Accept": "application/json; odata=verbose","X-RequestDigest": $("#__REQUESTDIGEST").val(),"X-HTTP-Method": "POST" },
        success: function (data) {
            alert('Contribute permission set on group');
        },
        error: function (data) {
            alert("Error: " + JSON.stringify(data));
        }
    });
});

Replace <GroupId> with the ID of SharePoint group. Open the SharePoint group & you will find the group ID in browser URL:

enter image description here

roledefid for Permission Levels are as follows:

  • Full Control: 1073741829
  • Design: 1073741828
  • Edit: 1073741830
  • Contribute: 1073741827
  • Read: 1073741826
  • Limited Access: 1073741825
  • View Only: 1073741924

You need to convert above REST call in Power Automate Send an HTTP request to SharePoint action.

windows – Moving existing local profile to an AD roaming profile

Looking into moving existing local profile (Windows 8.1) to an AD roaming profile (WS 2019). The goal is:

  1. One user has 2 machines at once. One is win8.1 (existing one), another is win10 (fresh). Upgrade/downgrade is possible.
  2. Now user has local admin account on a win8 machine, which should be converted saving all profile settings to an existing fresh AD user-right account.
  3. Existing browser settings for Google Chrome and IE should be preferrably transferred between too, as well as Desktop links/files and Documents folder.

What are the steps for doing this? Also network is 100MB/s, is that enough for a kinda small profile roaming to be smooth?
Also, I’ve seen a User-profile disks feature, what is the difference between UPD and roaming profile and will it fit the task better? Thanks

alter table – Why can’t you add an Identity to an existing colum in SQL Server?

What is so special about an Identity column?

See: https://stackoverflow.com/questions/1049210/adding-an-identity-to-an-existing-column

I am pretty sure there is a valid reason, but I’m trying to get a better understanding of SQL.

So what is so special about an Identity column that this can’t be easily added in retrospect?

Why is this not just a single int/bigint flag somewhere that is being incremented every time you insert a new row?

backup – Mongodb migration and appending data to existing database

I have two databases in two different machines containing data in same schema. Both have relational mappings in form of ObjectIDs as it is done in NoSQL database. The task at hand is to pick one database from machine A and append that data to another database residing in the machine B. If I simply insert the data there will be ObjectID collisions and it simply won’t work.
The only option which I see is to insert the primary key collections first in the database, then insert the collections containing the foreign key mappings and replace the ObjectIDs with the newly created ObjectIDs from the primary key documents. However, it isn’t as easy as it sounds because there are multiple collections which are interconnected with ObjectIDs.

Please suggest me the most efficient way in which this can be done. TIA

postgresql – Fill new column by appending suffixes to an existing field based on a condition on a third one (mapping)

I’d like to know if there is a better solution than the following to construct a new column (place_type_new) by adding a suffix to the textual information of an existing column (place_type) based on the value of a third column (the number of inhabitant in the case shown here):

  UPDATE places_table SET place_type_new = CASE
      WHEN inhabitant = 0 AND place_type LIKE 'Village' THEN 'Village_XXXS'
      WHEN inhabitant = 10 AND place_type LIKE 'Village' THEN 'Village_XXS'
      WHEN inhabitant = 20 AND place_type LIKE 'Village' THEN 'Village_XS'
      WHEN inhabitant = 100 AND place_type LIKE 'Village' THEN 'Village_S'
      WHEN inhabitant = 2000 AND place_type LIKE 'Village' THEN 'Village_M'
      WHEN inhabitant = 5000 AND place_type LIKE 'Village' THEN 'Village_L'
      WHEN inhabitant = 10000 AND place_type LIKE 'Village' THEN 'Village_XL'
      WHEN inhabitant = 20000 AND place_type LIKE 'Village' THEN 'Village_XXL'
      WHEN inhabitant = 50000 AND place_type LIKE 'Village' THEN 'Village_XXXL'
      WHEN inhabitant = 0 AND place_type LIKE 'VillagePart' THEN 'VillagePart_XXXS'
      WHEN inhabitant = 10 AND place_type LIKE 'VillagePart' THEN 'VillagePart_XXS'
      WHEN inhabitant = 20 AND place_type LIKE 'VillagePart' THEN 'VillagePart_XS'
      WHEN inhabitant = 100 AND place_type LIKE 'VillagePart' THEN 'VillagePart_S'
      WHEN inhabitant = 2000 AND place_type LIKE 'VillagePart' THEN 'VillagePart_M'
      WHEN inhabitant = 5000 AND place_type LIKE 'VillagePart' THEN 'VillagePart_L'
      WHEN inhabitant = 10000 AND place_type LIKE 'VillagePart' THEN 'VillagePart_XL'
      WHEN inhabitant = 20000 AND place_type LIKE 'VillagePart' THEN 'VillagePart_XXL'
      WHEN inhabitant = 50000 AND place_type LIKE 'VillagePart' THEN 'VillagePart_XXXL'
      WHEN inhabitant = 0 AND place_type LIKE 'Neighborhood' THEN 'Neighborhood_XXXS'
      WHEN inhabitant = 10 AND place_type LIKE 'Neighborhood' THEN 'Neighborhood_XXS'
      WHEN inhabitant = 20 AND place_type LIKE 'Neighborhood' THEN 'Neighborhood_XS'
      WHEN inhabitant = 100 AND place_type LIKE 'Neighborhood' THEN 'Neighborhood_S'
      WHEN inhabitant = 2000 AND place_type LIKE 'Neighborhood' THEN 'Neighborhood_M'
      WHEN inhabitant = 5000 AND place_type LIKE 'Neighborhood' THEN 'Neighborhood_L'
      WHEN inhabitant = 10000 AND place_type LIKE 'Neighborhood' THEN 'Neighborhood_XL'
      WHEN inhabitant = 20000 AND place_type LIKE 'Neighborhood' THEN 'Neighborhood_XXL'
      WHEN inhabitant = 50000 AND place_type LIKE 'Neighborhood' THEN 'Neighborhood_XXXL'
      WHEN inhabitant = 0 AND place_type LIKE 'NeighborhoodPart' THEN 'NeighborhoodPart_XXXS'
      WHEN inhabitant = 10 AND place_type LIKE 'NeighborhoodPart' THEN 'NeighborhoodPart_XXS'
      WHEN inhabitant = 20 AND place_type LIKE 'NeighborhoodPart' THEN 'NeighborhoodPart_XS'
      WHEN inhabitant = 100 AND place_type LIKE 'NeighborhoodPart' THEN 'NeighborhoodPart_S'
      WHEN inhabitant = 2000 AND place_type LIKE 'NeighborhoodPart' THEN 'NeighborhoodPart_M'
      WHEN inhabitant = 5000 AND place_type LIKE 'NeighborhoodPart' THEN 'NeighborhoodPart_L'
      WHEN inhabitant = 10000 AND place_type LIKE 'NeighborhoodPart' THEN 'NeighborhoodPart_XL'
      WHEN inhabitant = 20000 AND place_type LIKE 'NeighborhoodPart' THEN 'NeighborhoodPart_XXL'
      WHEN inhabitant = 50000 AND place_type LIKE 'NeighborhoodPart' THEN 'NeighborhoodPart_XXXL'
      ELSE place_type
  END;

I find this horribly ugly, but it’s perfectly working. The suffix to append to the existing field values in the places_table in order to build the new place_table_new one, always matches the same number in the column inhabitant according to this pattern:

0     : XXXS
10    :  XXS
20    :   XS
100   :    S
2000  :    M
5000  :    L
10000 :   XL
20000 :  XXL
50000 : XXXL

Would it be better to build an intermediary table with this mapping in order to achieve this?

I’m using PostgreSQL 12 on Ubuntu 18.04. I also narrowed down the problem here to something as simple as I can, hopefully without forgetting something important.

google sheets – Create a Unique Order Number From Existing column of values

I need to create a unique ID from an existing list of order numbers. Pls see the image below:
enter image description here

What I want is for the existing duplicate order numbers to be made unique by adding an extra digit to the end. At the moment for about 300 rows with different sets of order numbers, I make numbers form 1-300(or however long the list) & join the order numbers with that manually. That makes the IDs too long, I just want to add a digit to the end of each set of order numbers.

dnd 5e – Can a College of Creation Bard use Performance of Creation to duplicate an existing item?

My party is in possession of a book of accounts and ledgers which we have retrieved on behalf of a benefactor. We are supposed to return the book to the benefactor but the information contained within it is valuable* and could be of great benefit to us.

We have a College of Creation Bard in the party who has the Performance of Creation feature:

As an action, you can channel the magic of the Song of Creation to create one nonmagical item of your choice in an unoccupied space within 10 feet of you. The item must appear on a surface or in a liquid that can support it. The gp value of the item can’t be more than 20 times your bard level, and the item must be Medium or smaller. The item glimmers softly, and a creature can faintly hear music when touching it. The created item disappears after a number of hours equal to your proficiency bonus. For examples of items you can create, see the equipment chapter of the Player’s Handbook.

Could the bard create a duplicate of the accounts and ledgers book using Performance of Creation?


*Here, I use the term valuable to mean “of great importance.” It could well be that there is some monetary value that could be assigned to the information contained within the book but that evaluation would vary from person to person.

In our particular case, we are retrieving the ledger as a favor and no money has been promised for the service of retrieving it.

php – How to programmatically add Gallery Block to Existing Post Content

I need to insert a set of images already in the media library to the end of the content of each new post.

Instead of inserting the html directly is there a way to add a Gallery block by using the image IDs ?

I’ve found this piece of code without much explanation for it

    var content = "Test content";
var el = wp.element.createElement;
var name = 'core/paragraph';
// var name = 'core/html';
insertedBlock = wp.blocks.createBlock(name, {
    content: content,
});
wp.data.dispatch('core/editor').insertBlocks(insertedBlock);

and am wondering if someone can point to some material showing how to do this correctly if it is at all possible to do.

Examples, articles etc – what I’ve come across has not been helpful. Mostly appending the html to the end of the content.