To remove the weight from the menu.yml file and enable alphabetical sorting in Drupal:
Locate the menu.yml file in the module directory.
Open the file and remove any weight property from the menu items.
Save the file.
Clear the cache using drush cr or from the admin interface.
Verify that the menu items are now sorted alphabetically
To
menu_name: main-menu
parent: main-menu
title: 'Menu Item'
weight: 10
This
menu_name: main-menu
parent: main-menu
title: 'Menu Item'
Please update the View Password module to apply the latest fixes for the low-contrast focus outline issue.
composer require 'drupal/view_password:^6.0'
$(document).ready(function () {
var $alertBlock = $('#block-olivero-sitewidealert');
if ($alertBlock.length) {
$alertBlock.attr("role", "region");
$alertBlock.attr("aria-label", "Sitewide Alert");
}
});
I hope this code resolve your issues
To use the transcode feature in the Drupal Video module, especially for version 3.0.5, youโll need to follow a few steps, as the functionality allows for converting uploaded video files into formats suitable for web playback.
Install the Required Libraries: You will need third-party libraries like FFmpeg for transcoding videos. FFmpeg handles the conversion process by compressing and reformatting the video into compatible formats for web streaming.
Configure Video Settings: Once you have the libraries in place, go to the module's configuration page within your Drupal admin. Under the โVideoโ settings, youโll find an option to configure transcoding settings. Here, you can define the output formats (such as MP4, WebM, etc.) that FFmpeg should produce.
Automate Transcoding: After configuring, when users upload a video file, the Video module automatically sends it through the transcoding process, generating the required formats. You can also set specific resolutions or bitrates for different devices, optimizing video playback.
Manage Transcoding: Depending on the setup, you can manage the transcoding process from the admin panel, ensuring proper queue management if you are working with large volumes of content.
Sometimes the module libraries may not install properly. Try reinstalling or updating the Admin Toolbar module
composer update drupal/admin_toolbar
Prevent Users Without Email Addresses from Using the Password Reset Form
You can implement a check in the password reset form handler (UserPasswordForm) to ensure that only users with a valid email address can submit the form.
Modify the submitForm() function in a custom module or use a hook, like hook_form_alter() or hook_form_user_pass_alter(), to check for the presence of an email address associated with the username.
function mymodule_form_user_pass_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
$form['#validate'][] = 'mymodule_user_pass_validate';
}
function mymodule_user_pass_validate($form, \Drupal\Core\Form\FormStateInterface $form_state) {
$username = $form_state->getValue('name');
$account = user_load_by_name($username);
if ($account && !$account->getEmail()) {
$form_state->setErrorByName('name', t('The account does not have an email address and cannot reset the password.'));
}
}
It seems that uninstalling the Rate module in your Drupal site caused anonymous and authenticated user roles to disappear. To fix this:
Check if roles exist: Go to People > Roles in the admin panel.
Check permissions: Ensure permissions for anonymous and authenticated users are correct under People > Permissions.
Clear cache: Go to Configuration > Performance and clear all caches.
Restore roles: If missing, manually recreate the roles and set permissions.
Database check: Verify roles in the user_roles table if needed.
I Hope this steps will fix your issues.
The Drupal Redirect module does not support scheduling redirects natively.
for enable scheduling you can use .
Rules Module: Use the Rules module to set up workflows that activate redirects based on conditions, like a scheduled time.
Module โ
Three effective solutions to optimize CSS and JavaScript in Drupal 10:
1. Lazy Loader
Defers loading of off-screen images and iframes until they enter the viewport, improving initial load times and conserving bandwidth, especially for mobile users.
2. CDN Module
Delivers static assets (CSS, JS, images) from servers closest to the user, reducing latency and enhancing performance for a global audience. Ideal for high-traffic sites.
3. Minify JS and CSS
Removes unnecessary characters and whitespace from JavaScript and CSS files, resulting in smaller file sizes and faster load times. This is crucial for sites with extensive scripts and styles.
Check Table Definitions: Use the SQL command SHOW CREATE TABLE
In Drupal 10 with CKEditor 5, the old HOOK_form_editor_link_dialog_alter used for CKEditor 4 no longer applies, as CKEditor 5 uses a modular JavaScript-based system for forms like the link dialog. To customize or alter the link form, you need to create a custom CKEditor plugin.
.form-item-pass {
margin-bottom: 20px;
}
.user-register-form {
margin-top: 20px;
margin-bottom: 20px;
}
#edit-contact{
margin-bottom: 20px;
}
Step for resolve the issues
-Update the database
- Check for Module Dependencies & Confirm that all required dependencies for Opgino LMS are installed and enabled.
- clear the cache
I hope these steps fix your issues
You need to ensure that all use statements are sorted in a case-sensitive manner.
Before:
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\feeds\FeedsEntity;
After:
use Drupal\feeds\FeedsEntity;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Session\AccountInterface;
For parameters that have null as a default value but are not marked as nullable, you need to update the function signatures. The PHP 7.1+ syntax allows you to explicitly mark parameters as nullable using the ? operator.
Before:
public function exampleFunction($param = null) {
}
After:
public function exampleFunction(?string $param = null) {
}
The core issue is that version 8.x-1.4 of the File Entity Browser module is using a library (once) that was introduced in Drupal 9 and is not available in Drupal 8.9.x. To resolve the issue, you can either downgrade to version 1.3 of the module, manually add the once library. Upgrading to Drupal 9 is another long-term solution that will avoid these kinds of problems in the future.
While sending an email using the Symfony Mailer Lite module, the following error occurred:
Error: Class "TijsVerkoyen\CssToInlineStyles\CssToInlineStyles" not found.
The required CssToInlineStyles library is missing because it wasnโt installed via Composer, which is normally used to manage dependencies.
Download the Library:
The CssToInlineStyles library was manually downloaded from GitHub.
Place the Library:
The library was placed in the path:
vendor/tijsverkoyen/css-to-inline-styles.
Autoload the Library:
It was manually added to Drupal's autoloader by including it in the autoload.php file.
Clear Cache.
Can you explain how you uninstalled the Flag module? Did you do it via the admin interface or command line?
The issue arises because the old namespace path (PhpUnit8) is no longer valid. By replacing it with the general ClassWriter path, the error can be resolved, ensuring the code is compatible with newer versions of PHPUnit or Drupalโs testing tools
We need to replace old namespace use Drupal\TestTools\PhpUnitCompatibility\PhpUnit8\ClassWriter; to new namespace use Drupal\TestTools\PhpUnitCompatibility\ClassWriter;
Steps:
->Check for Existing Content:
Run a query in the database to find any content or entities related to file_resup.
Manually delete any file_resup content if found.
-> Clear Caches
-> use the Clean Files Entity module to remove any ghost entities.
-> Try uninstalling via the admin interface or using Drush.
drush pm-uninstall file_resup -y
-> After uninstallation, delete the module files from /modules/contrib/file_resup
-> Check Drupal logs for details about the error.
-> Rebuild node access permissions to ensure everything is working.
drush php-eval 'node_access_rebuild();'
The error occurs because the SchedulerEvent class was moved from Drupal\scheduler\SchedulerEvent to Drupal\scheduler\Event\SchedulerEvent in a newer version of the Scheduler module.
Update this old namespace use Drupal\scheduler\SchedulerEvent; // to New namespace use Drupal\scheduler\Event\SchedulerEvent;
You should replace all instances of get_class() without arguments with static::class. This solution is compatible with PHP 7.3 and PHP 8.3.
class ExampleClass {
public function someMethod() {
$className = static::class;
}
}
Its work as expected. Can you share more details?
You can add custom CSS
ul.menu {
li {
a {
font-weight: 700;
}
}
}
Creating a migrate_skip_fields/src/MigrateSkipFieldsByName.php
namespace Drupal\migrate_skip_fields;
use Drupal\Core\Config\ConfigFactoryInterface;
class MigrateSkipFieldsByName {
protected $settings;
public function __construct(ConfigFactoryInterface $config_factory) {
$this->settings = $config_factory->get('migrate_skip_fields.settings')->get('skip_fields');
}
}
Then i created migrate_skip_fields/config/install/migrate_skip_fields.settings.yml
migrate_skip_fields.settings:
type: config_object
label: 'Migrate Skip Fields Settings'
mapping:
skip_fields:
type: string
label: 'Skip Fields'
description: 'Comma-separated list of fields to skip during migration.'
We access settings using ConfigFactoryInterface in the class. The schema file helps validate the settings, and managing everything in a custom module keeps it clean and modular.
Instead of using toISOString(), which converts the date to UTC, you can rely on JavaScript's Date() object to work with local time.
Iโve thoroughly tested the Layout Builder on my local setup, including adding a two-column section, and everything seems to be working as expected. The blocks are arranging properly in columns without any issues.
I followed the steps to reproduce the issue, but I was unable to replicate the problem. After editing the image link and saving the changes, the link updated correctly without reverting to the original. I tested this on both external and internal links, and everything is functioning as expected
I got this error after saving the menu
Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'bundle' cannot be null: UPDATE "menu_link_content" SET "revision_id"=:db_update_placeholder_0, "bundle"=:db_update_placeholder_1, "uuid"=:db_update_placeholder_2, "langcode"=:db_update_placeholder_3 WHERE "id" = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => 68581 [:db_update_placeholder_1] => [:db_update_placeholder_2] => ba66cf02-b531-4e83-a0e6-4e2a27451afd [:db_update_placeholder_3] => en [:db_condition_placeholder_0] => 68581 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 815 of core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php).
zartab farooquee โ created an issue.