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
- 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 wasCopy to clipboardNotice: invalid variable value: $_GET["parentId"] = -1
From what I understand -1 stands for the root directory.TikiWiki Version 3.2:
The code tries to validate the '-1' as an integer variable. Defined by the
The error is produced in file tiki-setup_base.php on line 259Copy to clipboard$vartype array -> $vartype['parentId'] = 'int';The according $patterns array describes it as
Copy to clipboard$patterns['int'] = "/^[0-9]*$/"; // *IdObviously 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+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 2818
- Created
- Wednesday 21 October, 2009 10:12:41 UTC
by Unknown - LastModif
- Monday 01 June, 2026 16:52:12 UTC