Content Type Hub – Cannot delete content type

This has been discussed many times and here is another one much loved Content Type Hub issue. 🙂

So, in SPO I’ll have some Content Types in the Content Type Hub that cannot been deleted. In the SPO Admin Center when trying to delete a Content Type is says that it cannot be deleted as it is in use.

I have tried:

  • I have tried to publish the CT, wait for +8h and then unpublish it and wait another 4-8h before trying to delete it.

  • Have emptied the primary and secondary recycle bin for each site in the tenant using PnP: Clear-PnPRecycleBinItem -All -Force

  • Via code trying to find the content type and having it removed. Below code is currently saying that the CT with a specific ID is not found on any site.


    function FindContentTypeById {
        param (
            (Parameter(Mandatory=$true))
            (string)$ContentTypeId        
        )
        
        $siteCollections = GetSites ## Get all sites in the tenant custom function
        
        foreach ($site in $siteCollections) 
        {
            $siteUrl = $($site.Url)
            Write-Host "+ Site: $siteUrl"
            ConnectPnPOnline -Url $siteUrl
    
            $lists = Get-PnPList
            foreach ($list in $lists) 
            {
                $ct = Get-PnPContentType -List $($list.Title) -Identity $ContentTypeId -ErrorAction SilentlyContinue
                if($null -ne $ct) {
                    Write-Host -ForegroundColor Yellow "    - Found CT"
                    Write-Host -ForegroundColor Yellow "      - Found: $($ct.Name) in List: $($list.Title)"
                }
            }
    
            $siteCTs = Get-PnPContentType
    
            $x = $siteCTs | Where-Object {(($_.Id).StringValue -eq ($ContentTypeId))}
            if($null -ne $x)
            {
                Write-Host "  - Found: $($x.Name) in ($site.Url)"
            }
    
            Disconnect-PnPOnline
        }
    }

I have also run code that looks for a Content Type by Name with the same result (not found).

So, any ideas what else I could do/try to have the CT deleted?

Delete docx pages hosted in SharePoint Library using OpenXML

Does anyone know how to delete pages from a document hosted in a SharePoint Library using OpenXML ?

Looking forward for your answers

rest – How do I delete items on the frontend that have been deleted on the backend?

I’m building a single page application with a timeline and loading those objects in from a paginated REST API. I’d like to delete objects that don’t exist in the backend anymore or that have been edited by other users, but the solution I can think of seems incredibly naive and frankly expensive.

What I’m thinking of doing is iterating through the loaded objects and checking if they still exist in the backend (or passing all of the object IDs to the backend and getting a list of items that don’t exist anymore). This feels like a bad idea.

Webhooks seem like they’d fail if a user isn’t online and getting a list of items that have been deleted since the last time the user requested a page load feels incomplete, clunky, and prone to failure.

I feel like part of this could be handled by modifying the frontend’s objects on a successful edit/delete response, but that still doesn’t handle the cases where another user makes an edit and I need to update every other user’s timeline.

Is there a best practice for updating a frontend when objects have been deleted on the backend?

How to manually delete a std::vector in c++?

I have following code snippet

void func(int row,int n,std::vector<int>& buffer){
    if(row>n){
        return;
    }
    std::vector<int> new_buffer;
    for(int elm : buffer){
        std::cout<<elm<<" ";
        new_buffer.push_back(elm*2);
    }
    std::cout<<std::endl;
    func(row+1,n,new_buffer);
}

the thing is, I dont need the buffer varaible after the creation of new_buffer. And since I am continuing to recursively call the function after requirement of buffer is over, I am concerned that I am wasting space without reason. Is there any sure shot way of deallocating this space with compliance to the RAII scheme. If I call the destructor directly, the memory gets freed once again on the completion of the function resulting in a double free.

How can I delete a very large number of GMail emails?

I would like to delete about 430,000 emails matching a specific search in GMail.

I’ve tried the normal process for doing this (as mentioned in this answer and others): I clicked the “select all” checkbox, then “Select all 428,238 conversations …”, and then clicked the “delete” button. However, when I do this it only deletes about 4,000-5,000 emails at a time, and I have to manually repeat the process in order to delete more emails. At this rate it will take several hours of work to fully delete these emails.

Is there a faster way to bulk delete emails in GMail (possibly with a third-party tool)?

sql server – One-directional database replication without delete on target database?

I have two databases: A small one where data is permanently added and a big one where the data is copied from the small one and is supposed to be stored long term. The small database deletes old data if the database is growing to big. But the big database is supposed to keep this data (that’s its purpose).

Is there a way to achieve this by transactional replication?

(I’m not interested in a SQL-Statement solution and regularly calling a job. I know how to do that.)

I’ve read some stuff about one-directional replication, snapshot replication, transactional replication, and merge replication but I can’t figure out if one of those can do what I need. The scenario is not that exotic, isn’t it?

I just need someone to point me the right direction.

Any help would be appreciated.

backup – How to actually delete SMS/MMS messages using third-party SMS applications like Pulse SMS?

A while back, I switched from Samsung’s default SMS app (Samsung Messages) to Pulse SMS.

For many months, I’ve been using Pulse SMS to delete old SMS and MMS messages. After deleting almost all MMS messages and thousands of SMS messages, I backed up Android’s SMS/MMS database using Epistolaire. Much to my surprise, the backup was over 500GB.

Given that SMS messages are tiny, I immediately knew something was wrong. So I loaded up Samsung’s default SMS app, and sure enough, every one of my supposedly-deleted SMS and MMS messages are still technically on the Android device (even though thousands of them had supposedly been deleted by the Pulse SMS app).

Besides going through tens of thousands of SMS and MMS messages again, how can I remove all the supposedly-deleted SMS/MMS messages from Android without removing the thousands of messages I want to keep?

Also, how do I prevent this mess from happening in the future?

java – How do you delete an item in RecyclerView list and Database using checkboxes?

I am following a tutorial to make a simple to-do list app using using RoomDatabase and connected to RecyclerView. Each item has a checkbox next to it, and I want to delete the item from the database and the view when the checkbox is clicked. In the tutorial, this deletion is done by swiping the row, which is done by code inside the onCreate in MainActivity:

new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0,
            ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) {
        @Override
        public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
            return false;
        }
        @Override
        public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
            noteViewModel.delete(adapter.getNoteAt(viewHolder.getAdapterPosition()));
        }
    }).attachToRecyclerView(recyclerView);

I am unsure how to do this with checkboxes however.

What I tried:

checkBox.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                itemViewModel.delete(adapter.getItemAt(???);
            }
        });

I am not sure how to access the current ViewHolder through this method. Also, the getAdapterPosition() method is deprecated.

I also tried removing it in the Adapter class. This successfully removes it from the list but does not remove it from the database. I am unsure if I can (or should) access the database from the Adapter class.

So I am wondering which is the correct way to do this?

i just want to delete this

but i just edit it instead bc i donk know how to