Drupal is up and running but how do I ...?

What is the best practice for large scale content updates arising from a refactor?

Hi, I'm adding some fields to a bundle that already have a lot of existing entities. I want to make changes to the front end that will depend on these new fields being populated in order to display correctly. New ones will be covered by a presave hook, but how to safely populate the old entities where the fields didn't exist?

My instinct is to use an update hook to ensure that the content is safe in advance, but I'm not sure if I should be using queries or the Entity API or something else. What are the best practices?

Image field link to image file leads to 404 response, sometimes

Hello,

I have been struggling with a problem with media image fields linking to the image file on my new Drupal 11 website.

I have created a content type containing a media image field, and a block view displaying a selection of the images. This works fine. The block displays the image correctly as thumbnail linking to the image file.

Now sometimes i get a 404 response on the image link from one browser, while it works fine from another browser (see  apache loggin below).

Media image field link to image file gives 404, sometimes

Hello,

I have been struggling with a problem with media image fields linking to the image file.

I have created a content type containing a media image field, and a block view displaying a selection of the images. This seems to work fine. The block displays the image correctly as thumbnail linking to the image file.

Now sometimes i get a 404 response on the image link from one browser, while it works fine from another browser (see  apache loggin below).

Editable fields

I have a content type with an editable fields field. I've given permission to the anonymous user to edit it (no autosave AJAX). However, if I create a view that includes this field (formatter editable fields), the anonymous user can edit the field. However, if I return to the view or refresh, the following error appears:
The website encountered an unexpected error. Try again later.

Something adds a wrong </source> closing tag

So, on our Drupal 10 site, any audio file gets rendered with an additional source closing tag, like <source src="/…/name.mp3" type="audio/mpeg"></source>. The closing </source> is not valid HTML.
There is no closing </source> in our theme. If I change the theme to Claro, the closing </source> is added as well.

Unable to remove Context Stacks

Currently on Drupal 10.5.6. Prepping for update 11.1

Upgrade Status Report says I should uninstall Context Stack 1.1.2

However when I uninstall it, it breaks the site with the following error:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "context_stack.current_content". in Drupal\Component\DependencyInjection\Container->get() (line 159 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Pages

Subscribe with RSS Subscribe to RSS - Post installation