Git Product home page Git Product logo

simplebatchupload's People

Contributors

abijeet avatar hexmode avatar jeroendedauw avatar joeytje50 avatar kghbln avatar malberts avatar mtmnc avatar s7eph4n avatar shirayuki avatar thijskh avatar tosfos avatar translatewiki avatar universal-omega avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplebatchupload's Issues

Upload fails with old token

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.

Use chunked upload for large files

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.

Error after installing in mediawiki 1.37

Setup

  • MW version:
  • PHP version:
  • DB (MySQL etc.):
  • SBL version:
  • Browser version:

Issue

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

Explanation needed what's going on here

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.

No drop area on upload page

Setup

  • MW version: 1.35+
  • SBU version: 1.6+

Issue

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

Suggested fix

Fix: in src/SimpleBatchUpload.php, replace

'dependencies' => [ 'jquery.ui.widget' ],

with

'dependencies' => [ 'jquery.ui' ],

ERROR: Server Communication failed

Setup

  • MW version: 1.39
  • PHP version: 8.1.5
  • DB (MySQL etc.): MariaDB
  • SBL version: 2.0 (SimpleBatchUpload version)
  • Browser version: Latest version of Edge, Windows 11. Also reported by other users in our wiki.

Issue

See below
Steps to reproduce:
Upload anything using any method using Special:BatchUpload.
Expected result:
A file should be uploaded.
Observed result:
image
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

Cannot use 'in' operator to search for 'length' in 20

Setup

  • MediaWiki | 1.35.3 (086b4f1)09:56, 26 July 2021
  • PHP | 7.4.3 (apache2handler)
  • MariaDB | 10.3.29-MariaDB-0ubuntu0.20.04.1
  • ICU | 66.1
  • SimpleBatchUpload | 1.8.2

Issue

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)

Code snippets for inserting uploaded files or images

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.

Conflict between SimpleBatchUpload and MW Extension:Chartie

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

Add compatibility with PHP 8.1+

Setup

  • MW version: 1.37.2
  • PHP version: 8.1.5
  • DB (MySQL etc.): 10.5.15-MariaDB

Issue

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.

Unknown module: mediawiki.api.edit

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' ],

Repo moved

@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.

Cannot install simple batch upload by the tar file

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.

ERROR: Server communication failed

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.

Question: The 2.0 Release?

Setup

  • MW version: 1.39
  • PHP version: PHP 8.1
  • DB (MySQL etc.): MariaDB
  • SBL version: 1.9

Issue

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?

wgEnableWriteAPI Error

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.