- 🇮🇹Italy RenataBin
Hello, I try to write here, please let me now if it's the right place.
I've a strange problem: I've installed plupload module+plupload library in my Drupal10 server and I've written this php code to use plupload:$form['fileimporta'] = array(
'#type' => 'plupload',
'#title' => t('Scegli i files XML (il nome del file non deve contenere spazi o caratteri speciali). Massimo 10.'),
'#upload_validators' => array("file_validate_extensions" => array("xml XML")),
'#plupload_settings'=> array(
'runtimes' => 'html5',
'unique_names' => TRUE,
),
'#required' => TRUE,
);when I try to understand what's in my 'fileimporta' field with
$form_state->getUserInput()['fileimporta'])
or $form_state->getvalue('fileimporta')
the result is NULL.
In Drupal 7 works, of course.
Any ideas?
THANK YOU!
Renata. - Issue was unassigned.
- Status changed to Active
over 1 year ago 9:27am 31 July 2023 - 🇮🇹Italy RenataBin
Hello,
I've used your test module but still doesn't work, even the field 'upload' in the validate part of code is empty.
I think I've something wrong in my Drupal10 installation but I don't understand what...
It's very strange 'cause I've got NO errors...
Thank you for any advice.
Renata. - 🇪🇸Spain budalokko Girona
If I had to debug your issue I would try the following:
1. Visit
/admin/reports/status
and check there are no messages in the "Plupload library" section. Something like "2.3.9" should appear.
2. Visit/admin/reports/dblog
and ensure there are no messages related to writing files nor file system.
3. Access the plupload test page at/plupload-test
and try to upload a very small file.
4. Instead of pressing directly the "Submit" button, click "Start upload" first, ensure a green tick appears at the right, and then "Submit".
5. Also you can check browser console for messages when clicking "Start upload".
6. If files are empty in the validate function, probably you don't have correct permissions at temporary directory or public files directory but definitely some message should appear at "Recent log messages" at this point. - 🇮🇹Italy RenataBin
Hello budalokko and thank you so much!
From your png I've noticed that "stop" and "done" gif in my Drupal didn't appear (I don't know why...).
At the same time my collegue had a problem in the same Drupal installation with Javascripts so we decided to update Drupal 10.0 to 10.1.4 and... now correct gifs appear and, more important, $form_state->getvalue('fileimporta') is no more null.
Now i'm trying getting file-id of these uploaded files (with Drupal7 I've used this method: https://drupal.stackexchange.com/questions/108583/how-to-save-file-uploa... but now it doent's work, of course). Any suggestions?
Thank you!
Renata. - Status changed to Closed: outdated
11 months ago 12:02am 29 December 2023 - 🇪🇸Spain budalokko Girona
No news from the original reporter for years so closing as outdated.
@RenataBin if your issue is still not fixed, you could create new support request with detailed information on what you did and what errors you get.