Error [] operator not supported for string in Plugin Tracker with itemId in URL
- Status
- Open
- Subject
- Error [] operator not supported for string in Plugin Tracker with itemId in URL
- Version
- 18.x
- Category
- Error
- Feature
- Trackers
- Resolution status
- New
- Submitted by
- Roni Wolf
- Lastmod by
- Roni Wolf
- Rating
- Description
Hi Dev's!
First of all, sorry my english... Is not my natural language.
My fist post here!
I have another contribuition, but stay for another post. 😉
My setup:
Tiki 18.2
PHP 7.2.10-0ubuntu0.18.04.1
Linux 18.04 LTSIn a page with PLUGINTRACKER, if a itemID is passed in URL the follow error message is diplayed:
Fatal error: Uncaught Error: [] operator not supported for string
Cause:
In PHP 7+ (I cannot find exactly version) is more restritive in array initialization.Source affected:
lib/wiki-plugins/wikiplugin_tracker.phpSolution:
In line 1498 the array $filter is initialized as string, and utilized as array, causing the error. Below the affected source snippet with corretion (line 1498)1495 } elseif (! empty($itemId)) {
1496 if $fields) && empty($wiki) && empty($tpl {
1497 $fl = $fields;
1498 $filter = []; // $filter = ''; <- original
1499 foreach ($flds'data' as $f) {
1500 if (in_array($f'fieldId', $fl)) {
1501 $filter[] = $f;
1502 }
1503 }
1504 } else {In my setup, after corretion the error do not more appear.
I hope have helped in something!
Salutes from Brazil!
- Importance
- 9
- Easy to solve?
- 10 easy
- Priority
- 90
- 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
- 6920
- Created
- Wednesday 14 November, 2018 18:51:16 UTC
by Roni Wolf - LastModif
- Wednesday 14 November, 2018 18:51:16 UTC