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.
I am able to get ajax working on other form elements, but for some reason I am unable to find the event for the managed_file element. Am I missing something?
$form['import_file'] = array(
'#type' => 'managed_file',
'#name' => 'import_file',
'#title' => t('Select Import File'),
'#size' => 20,
'#description' => t('CSV only for now'),
'#upload_validators' => $validators,
'#upload_location' => 'public://easy_import',
'#progress_indicator' => 'bar',
Hi,
I'm using this code to generate a password valid for a Drupal7 site, with this code:
require_once '../includes/bootstrap.inc';
require_once '../includes/password.inc';
echo "Encrypted password: ".user_hash_password(trim('11111111111'));
Why does the result change every time I run the code?
Shouldn't the hash of "11111111111" always be the same?
I created a new service class in a custom module, it works on my local PC.
After I upload the code, and tried drupalconsole and drush both to clear and rebuild cache, but when I run this service, Drupal keep showing error message that it didn't know this service. I also tried delete all cache_* database tables, but the error still.
And at the logger I can see some error messages: Container cannot be saved to cache
I don't know method to add Numbering to Book Page contents or Book child pages as below. Can you please let me know how I can add numbers to book contents or to child pages in book view as below in Drupal 8.
Actually, I am not getting numbers for book contents in Drupal 8 after creating book and adding contents to it. Please provide how to do steps for above query. And below is the new book view without numbers in drupal 8.
I'm learning hooks and I need to put a check on the start page.
I want anonymous users to be redirected to the login page and redirected to the home page after logging in.
Only authenticated users must see the home page
I have tried both with hook_form_alter () and with hook_user_login (). I have been reading various codes for several days and doing various tests but I cannot understand where I am wrong
The version of Drupal is 8.8.5
I'm creating a form that sends a file to an outside server (via webform remote handlers). This server returns a .html file which I need to view from my drupal page but I can't seem to find a way to do this.
How could I view the html file in drupal or create a page from the server?