Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
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?
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).
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).
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.
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.
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).