professionalwiki / simplebatchupload Goto Github PK
View Code? Open in Web Editor NEWAllows for basic, no-frills uploading of multiple files
Home Page: https://www.mediawiki.org/wiki/Extension:SimpleBatchUpload
License: Other
Allows for basic, no-frills uploading of multiple files
Home Page: https://www.mediawiki.org/wiki/Extension:SimpleBatchUpload
License: Other
Uploading files via special page "BatchUpload" fails on MonoBook, Medik and Vector..
jQuery.Deferred exception: Cannot use 'in' operator to search for 'length' in 20 TypeError: Cannot use 'in' operator to search for 'length' in 20
at isArrayLike (https://www.example.org/w/load.php?lang=en&modules=ext.SimpleBatchUpload%7Cext.SimpleBatchUpload.jquery-file-upload%7Cjquery%7Cjquery.ui&skin=medik&version=r3in5:33:476)
at Function.each (https://www.example.org/w/load.php?lang=en&modules=ext.SimpleBatchUpload%7Cext.SimpleBatchUpload.jquery-file-upload%7Cjquery%7Cjquery.ui&skin=medik&version=r3in5:31:930)
at HTMLDocument.<anonymous> (https://www.example.org/w/load.php?lang=en&modules=ext.SimpleBatchUpload%7Cext.SimpleBatchUpload.jquery-file-upload%7Cjquery%7Cjquery.ui&skin=medik&version=r3in5:1:308)
at mightThrow (https://www.example.org/w/load.php?lang=en&modules=ext.SimpleBatchUpload%7Cext.SimpleBatchUpload.jquery-file-upload%7Cjquery%7Cjquery.ui&skin=medik&version=r3in5:76:149)
at process (https://www.example.org/w/load.php?lang=en&modules=ext.SimpleBatchUpload%7Cext.SimpleBatchUpload.jquery-file-upload%7Cjquery%7Cjquery.ui&skin=medik&version=r3in5:76:808) undefined
Uncaught TypeError: Cannot use 'in' operator to search for 'length' in 20
at isArrayLike (load.php?lang=en&modules=ext.SimpleBatchUpload|ext.SimpleBatchUpload.jquery-file-upload|jquery|jquery.ui&skin=medik&version=r3in5:33)
at Function.each (load.php?lang=en&modules=ext.SimpleBatchUpload|ext.SimpleBatchUpload.jquery-file-upload|jquery|jquery.ui&skin=medik&version=r3in5:31)
at HTMLDocument.<anonymous> (load.php?lang=en&modules=ext.SimpleBatchUpload|ext.SimpleBatchUpload.jquery-file-upload|jquery|jquery.ui&skin=medik&version=r3in5:1)
at mightThrow (load.php?lang=en&modules=ext.SimpleBatchUpload|ext.SimpleBatchUpload.jquery-file-upload|jquery|jquery.ui&skin=medik&version=r3in5:76)
at process (load.php?lang=en&modules=ext.SimpleBatchUpload|ext.SimpleBatchUpload.jquery-file-upload|jquery|jquery.ui&skin=medik&version=r3in5:76)
breaks on Mediawiki 1.31.0
PHP Fatal error: Uncaught UnexpectedValueException: callback 'SimpleBatchUpload\SimpleBatchUpload::initCallback' is not callable in /home/riotawfb/nosubject.com/includes/registration/ExtensionRegistry.php:360
Im trying to install SimpleBatchUpload, after download and put the extension in the /extensions and put the line in LocalSettings wfLoadExtension( 'SimpleBatchUpload' );, im getting an error in mine mediawiki.
The error
Fatal error: Uncaught Exception: Unable to open file C:\xampp\htdocs\mediawiki/extensions/SimpleBatchUpload/extension.json: filemtime(): stat failed for C:\xampp\htdocs\mediawiki/extensions/SimpleBatchUpload/extension.json in C:\xampp\htdocs\mediawiki\includes\registration\ExtensionRegistry.php:182 Stack trace: #0 C:\xampp\htdocs\mediawiki\includes\GlobalFunctions.php(52): ExtensionRegistry->queue('C:\xampp\htdocs...') #1 C:\xampp\htdocs\mediawiki\LocalSettings.php(192): wfLoadExtension('SimpleBatchUplo...') #2 C:\xampp\htdocs\mediawiki\includes\Setup.php(145): require_once('C:\xampp\htdocs...') #3 C:\xampp\htdocs\mediawiki\includes\WebStart.php(90): require_once('C:\xampp\htdocs...') #4 C:\xampp\htdocs\mediawiki\index.php(44): require('C:\xampp\htdocs...') #5 {main} thrown in C:\xampp\htdocs\mediawiki\includes\registration\ExtensionRegistry.php on line 182
I already tried in another mediawiki versions but get the same error
@translatewiki please beware that this repo moved. This should not break anything due to a redirect. You also should have the same access as before. Still, you might want to update the relevant config. Let me know if something broke.
incl. testing of tar balls
Thanks for this very useful plugin!
In the spirit of simplicity and better user experience after a successful batch upload (green filenames) it would be very nice to get code snippets to insert the recently uploaded files as either separate images or a gallery.
I manage a very large wiki in an educational environment and it is very common for users to forget filenames and removing unlinked files is a major issue.
Follow-up to #53
Includes doing the actual coding standards changes.
See below
Steps to reproduce:
Upload anything using any method using Special:BatchUpload.
Expected result:
A file should be uploaded.
Observed result:
The error "ERROR: Server communication failed" is observed, and nothing seems to have been uploaded. Normal MediaWiki file upload works without issues.
Stacktrace:
A generic 500 error message upon debugging in the console
Can presumably use this setup: https://github.com/ProfessionalWiki/Network/tree/master/.github/workflows
Then we can ditch the testing via ScrutinizerCI which is currently broken and a pain in the *** to deal with.
It would be nice if there was a specific right that controlled access to the special page.
When the upload site has not been refreshed for some time the token times out and subsequent uploads fails.
A new token should be obtained either before every upload or on error.
Our group has been using Extension:SimpleBatchUpload (1.5.0) extensively, but unfortunately we are running into an issue where files are uploaded but fail to be written as a row in the _fileData MW db table or saved to our Cargo db table. To the end user error appears as red highlighted text: ERROR: Server communication failed. We have checked our web server logs during uploads but cannot identify any server issues. Currently running MediaWiki 1.31.1, PHP 7.2.11 (apache2handler). Thank you for your help.
The upload is performed as soon as you drop a file. This is quite irritating and breaks with common behavior people expect.
There are two options:
a) Describe this in the special page, or better
b) implement this as a two step process: First drop all files, then click a button, then the upload is performed the way it is performed now.
Additionally I noticed that some uploads failed though I have seen no error message in response to an upload.
Whoops. I discovered an update to Chartie that fixes the problems. (...no issue here, move along please...).
Sorry about this posting.
Dennis
SimpleBatchUpload fails to complete any uploads when MediaWiki Extension:Chartie is enabled.
Errors look like this...
PHP Fatal error: Call to a member function getCanonicalUrl() on boolean in /var/www/mediawiki/extensions/Chartie/Chartie_body.php on line 173, referer: https://sample-site.org/doco/Special:BatchUpload
I suspect that this is maybe a Chartie error, but am posting a note here as I'm not a programmer, and I don't really know what's going on.
If I disable Chartie, the uploads complete OK.
thanks
Dennis
Implement a configurable option, that could be disabled, to limit how many files could be batch uploaded on each attempt.
I installed the extension by the "alternative" method, but it failed. Here is the error message in php.log:
PHP Fatal error: Uncaught exception 'Exception' with message '{{My Mediawiki Root Path}}/extensions/SimpleBatchUpload/extension.json is not a valid JSON file.' in {{My Mediawiki Root Path}}/includes/registration/ExtensionRegistry.php:176
Stack trace:
#0 {{My Mediawiki Root Path}}/includes/registration/ExtensionRegistry.php(127): ExtensionRegistry->readFromQueue(Array)
#1 {{My Mediawiki Root Path}}/includes/Setup.php(39): ExtensionRegistry->loadFromQueue()
#2 {{My Mediawiki Root Path}}/includes/WebStart.php(137): require_once('/var/lib/opensh...')
#3 {{My Mediawiki Root Path}}/index.php(38): require('/var/lib/opensh...')
#4 {main}
thrown in {{My Mediawiki Root Path}}/includes/registration/ExtensionRegistry.php on line 176
I omitted my mediawiki root path. It is weird since "SimpleBatchUpload/extension.json" is a valid JSON.
Just FYI-
https://nvd.nist.gov/vuln/detail/CVE-2018-9206
Unfortunately v9.22 appears to be the current release for jquery-file-upload.
After installing SimpleBatchUpload I get the following error:
ERROR: Editing of this wiki through the API is disabled. Make sure the $wgEnableWriteAPI=true; statement is included in the wiki's LocalSettings.php file
It's probably worth adding this and any other requirements to the read me?
Files don't become green or change the color after a error or sucessful upload.
https://www.mediawiki.org/wiki/Extension:SimpleBatchUpload
I'd update this if I knew how to even add this. Can't add via composer due to #10 and regular extension doesn't even work.
Why not just be simple and allow for a git clone like everyone else?
EDIT: I noticed your production files are actually in /src instead of /release ? This is very misleading
PHP 8 reports a fatal error loading the extension:
[09-May-2022 15:23:19 Europe/London] PHP Fatal error: Uncaught Error: SimpleBatchUpload\SimpleBatchUpload::registerEarlyConfiguration(): Argument #1 ($targetConfiguration) cannot be passed by reference in /srv/wiki.example.com/extensions/SimpleBatchUpload/src/SimpleBatchUpload.php:42
Stack trace:
#0 /srv/wiki.example.com/includes/registration/ExtensionRegistry.php(574): SimpleBatchUpload\SimpleBatchUpload::initCallback()
#1 /srv/wiki.example.com/includes/registration/ExtensionRegistry.php(258): ExtensionRegistry->exportExtractedData()
#2 /srv/wiki.example.com/includes/Setup.php(168): ExtensionRegistry->loadFromQueue()
#3 /srv/wiki.example.com/includes/WebStart.php(90): require_once('...')
#4 /srv/wiki.example.com/index.php(44): require('...')
#5 {main}
thrown in /srv/wiki.example.com/extensions/SimpleBatchUpload/src/SimpleBatchUpload.php on line 42
Stopping registerEarlyConfiguration
trying to take that argument by reference seems to have fixed things for me.
Originally reported on mediawiki.org
"MW 1.35, SimpleBatchUpload 1.6
Symptoms: No drop area on upload page (just a file upload button), error on Chrome console stating jquery.ui.widget is deprecated
Fix: in src/SimpleBatchUpload.php, replace
'dependencies' => [ 'jquery.ui.widget' ],
with
'dependencies' => [ 'jquery.ui' ],
Since 1.1.0 the list of uploads is deleted when a new upload is initiated.
Best case: Old uploads continue in the background without status indication.
Worst case: Old uploads fail as soon as the progress event does not find the expected status line and triggers a Javascript error.
Since I'm planning to upgrade php 8.1 on wiki, SimpleBatchUpload need to update 2.0 (which is under development stage, according to release notes). Is there any release date of 2.0?
Latest version does not work on MediaWiki 1.33. Dragging and dropping a file does not do anything. Upon debugging, find the following error in the console
load.php?lang=en&modules=startup&only=scripts&skin=vector:2 Error: Unknown module: mediawiki.api.edit
at sortDependencies (load.php?lang=en&modules=startup&only=scripts&skin=vector:8)
at sortDependencies (load.php?lang=en&modules=startup&only=scripts&skin=vector:9)
at resolveStubbornly (load.php?lang=en&modules=startup&only=scripts&skin=vector:9)
at Object.load (load.php?lang=en&modules=startup&only=scripts&skin=vector:21)
at index.php?title=Special:BatchUpload:9
at Array.RLQ.push (load.php?lang=en&modules=startup&only=scripts&skin=vector:48)
at load.php?lang=en&modules=startup&only=scripts&skin=vector:48
at load.php?lang=en&modules=startup&only=scripts&skin=vector:48
Find this module and others are deprecated (https://phabricator.wikimedia.org/T196802)
Fix by modifying as follows:
Change the line in src/SimpleBatchUpload.php
'dependencies' => [ 'ext.SimpleBatchUpload.jquery-file-upload', 'mediawiki.Title', 'mediawiki.api.edit', 'mediawiki.jqueryMsg' ],
to
'dependencies' => [ 'ext.SimpleBatchUpload.jquery-file-upload', 'mediawiki.Title', 'mediawiki.api', 'mediawiki.jqueryMsg' ],
If a file exeeds post_max_size
or upload_max_filesize
set in php.ini
the upload will fail without proper error message.
It seems that PHP does not raise an error when the file is too large and ApiUpload
is not explicitly testing this error condition, so no error message is generated.
MediaWiki's own $wgMaxUploadSize
is checked however.
Workaround for the moment: Raise the php.ini
settings above the largest expected file size.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.