Loading...
 
Skip to main content

FileGallery parentId=-1 returns Error

Status
Closed
Subject
FileGallery parentId=-1 returns Error
Version
3.x
Category
  • Error
Feature
File Gallery (elFinder or standard UI)
Resolution status
Invalid
Submitted by
priest
Lastmod by
Ushindi Gedeon
Rating
(0)
Description

Creating a new file-gallery in the root directory works for admin, but users with permission get an error upon clicking 'create new file gallery'
Message was

Copy to clipboard
Notice: invalid variable value: $_GET["parentId"] = -1


From what I understand -1 stands for the root directory.

TikiWiki Version 3.2:
The error is produced in file tiki-setup_base.php on line 259

The code tries to validate the '-1' as an integer variable. Defined by the
Copy to clipboard
$vartype array -> $vartype['parentId'] = 'int';

The according $patterns array describes it as

Copy to clipboard
$patterns['int'] = "/^[0-9]*$/"; // *Id

Obviously the sign "-" is missing.
Therefore the check for a valid variable fails and the user can't create a new file gallery.
Why the admin group is not affected I do not know.

Solution
Workaround

For a workaround it helped to set the

Copy to clipboard
$vartype['parentId'] = 'int'; to $vartype['parentId'] = 'intSign';

making the "-1" a valid value. But I can't tell if this has any side effects

Importance
3
Priority
15
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
2818
Created
Wednesday 21 October, 2009 10:12:41 UTC
by Unknown
LastModif
Monday 01 June, 2026 16:52:12 UTC


Show PHP error messages