-
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
Description
Describe the bug
Spatialhelper blocks uploads, error upload failed
To Reproduce
Steps to reproduce the behaviour:
Upload file (PDF in my case) using media manager. Upload fails.
Additional context
When deactivating spatialhelper the upload works.
Expected behaviour
Upload working normally.
environment
- php version: 8.3.3
- dokuwiki version: 2024-02-06a "Kaos"
- plugin version / date: latest 2023-12-22
- list of any other plugins (apart from bundled plugins): Authad
Authldap
Authpdo
Commentsyntax
Folded
Geotag
Indexmenu
Move
Openlayersmap
Pagelist
Spatialhelper
Tag
Wrap
debug log
handleMediaUploaded::event data
[
"\/www\/htdocs\/w00a194a\/private_data\/dokuwiki\/adminwiki\/data\/tmp\/201b0fd1db30818091387f69a9ec522a\/1786f43e7fd18f87ad155eb1437971fb",
"\/www\/htdocs\/w00a194a\/private_data\/dokuwiki\/adminwiki\/data\/media\/notizen\/haus\/rauchmelder_2024.pdf",
"notizen:haus:rauchmelder_2024.pdf",
"application\/pdf",
false,
"copy"
]
error log
TypeError: helper_plugin_spatialhelper_index::indexImage(): Argument #1 ($img) must be of type array, string given, called in /www/htdocs/w00a194a/htdocs/wikifarmer/lib/plugins/spatialhelper/action.php on line 342/www/htdocs/w00a194a/htdocs/wikifarmer/lib/plugins/spatialhelper/helper/index.php(211)
#0 /www/htdocs/w00a194a/htdocs/wikifarmer/lib/plugins/spatialhelper/action.php(342): helper_plugin_spatialhelper_index->indexImage('notizen:haus:ra...')
#1 /www/htdocs/w00a194a/htdocs/wikifarmer/inc/Extension/EventHandler.php(80): action_plugin_spatialhelper->handleMediaUploaded(Object(dokuwiki\Extension\Event), Array)
#2 /www/htdocs/w00a194a/htdocs/wikifarmer/inc/Extension/Event.php(75): dokuwiki\Extension\EventHandler->process_event(Object(dokuwiki\Extension\Event), 'BEFORE')
#3 /www/htdocs/w00a194a/htdocs/wikifarmer/inc/Extension/Event.php(133): dokuwiki\Extension\Event->advise_before(true)
#4 /www/htdocs/w00a194a/htdocs/wikifarmer/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger('_media_upload_a...', true)
#5 /www/htdocs/w00a194a/htdocs/wikifarmer/inc/media.php(501): dokuwiki\Extension\Event::createAndTrigger('MEDIA_UPLOAD_FI...', Array, '_media_upload_a...', true)
#6 /www/htdocs/w00a194a/htdocs/wikifarmer/inc/media.php(328): media_save(Array, 'notizen:haus:ra...', false, 8, 'copy')
#7 /www/htdocs/w00a194a/htdocs/wikifarmer/inc/Ajax.php(295): media_upload_xhr('notizen:haus', 8)
#8 /www/htdocs/w00a194a/htdocs/wikifarmer/inc/Ajax.php(28): dokuwiki\Ajax->callMediaupload()
#9 /www/htdocs/w00a194a/htdocs/wikifarmer/lib/exe/ajax.php(26): dokuwiki\Ajax->__construct('mediaupload')
imageIndex is called with a string
dokuwiki-plugin-spatialhelper/action.php
Line 342 in 038f4f4
$indexer->indexImage($event->data [2]); |
but expects an array with id and file
final public function indexImage(array $img): bool |
So either an array needs to be passed(maybe just the whole event array) or file and parameter need to be passed as two separate parameters. Issue #24 is related.