How do you programmatically delete a field?

How do you programmatically delete a field?

I found this page: https://www.drupal.org/node/2012896 which lists this: // Deleting field storage. FieldStorageConfig::loadByName(‘entity_type’, ‘field_name’)->delete(); // Deleting field. FieldConfig::loadByName(‘entity_type’,... read more
How do you programmatically delete a field?

How can I import fields into Drupal 8.4 user profile from a csv file that has identical values in the key row?

I’m using Migrate Tools, Migrate Plus and Migrate Source CSV. My CSV file looks like that: “Stg”;”Color”;”Fruit” “user1″;”red”;”apple”... read more
How do you programmatically delete a field?

Accessing Drupal REST endpoint using Oauth 2 token

I have successfully installed the Simple OAuth module on my website. I am also able to authenticate to it using Postman. I am getting the access_token and the refresh_token when authenticating. However, am not able to figure out how I can use this token to access... read more
How do you programmatically delete a field?

Multiple aliases per node (and active trail)

Our site is split down the middle for tenants and landlords. But we have content the is the same for both such as “how to report antisocial behaviour”. User would normally navigate something like “Home > Tenant > ASB” or “Home >... read more
How to add active class to title which is loaded via views in block

How to add active class to title which is loaded via views in block

I have created content type XXX, via views I collected all titles of XXX content. That all titles works as links, I want to add active class to title which was clicked in block. It should works as menu item. read more
How do you programmatically delete a field?

Template override doesn’t work

I am trying to develop a Drupal 8 module in which I have to override the html.html.twig template. The idea is that I do not want any of the default html.html.twig template returned instead I only want the custom template returned. I have been spending hours Google... read more
How do you programmatically delete a field?

How do I define the block visibility for content types and term pages?

I have a block and I want to show it for specific content types and taxonomy terms. There is no common pattern for those pages. For example, the URLs could be the following ones: http://example.com/rolling-stones (a taxonomy term page)... read more
Topics are not getting associated with forum

Topics are not getting associated with forum

I am testing out the Drupal 8 core Forum module. I am using a theme that I based off of Acquia Lightning. I have successfully installed the module and added Containers, Forums and Topics. My issue is that the Topics I create don’t seem to get associated with the... read more
How do you programmatically delete a field?

"The feed from New On Our Blog seems to be broken, due to an error ‘Invalid document end’ on line 128." [closed]

I run a Drupal 7 website and I have a separate WordPress blog. The blog generates a feed I display (RSS2 version) in a block on the Drupal website via the Aggregator module. The last feed shown on the Drupal website is from November 24, 2017. The newer 2 posts have... read more
How do you programmatically delete a field?

Creating Parent-Child Entities

Is there a way to create parent-child entities in Drupal 8? I’m trying to create a structure where the top entity is for County, and the next level entity is for departments, and next level would be staff. There will be different counties so the departments... read more
How do you programmatically delete a field?

Entity field value inherited from another entity programmatically?

I’d like to setup two content types in a parent -> child relationship. Node A of content type “parent” has custom field: (text) Description Node B of content type “child” has custom fields: (text) Description dynamically inherited... read more
How do you programmatically delete a field?

Full phrase search

Now I’m using “Search_api” module and when I input, for example, “test case” – it’s output all articles which consists both of this words separately. But I want to make search with exact phrase “test case”. How can... read more
How do you programmatically delete a field?

Custom file uploads seem impossible from a POST request?

Why are $_Files and/or HTTPFoundationFileBag invalid in custom module Controller? I have noticed a very strange issue with accessing an individual file from the $_FILES object or the Symfony derived SymfonyComponentHTTPFoundationFileBag from within a custom module... read more