Loading...
 
Skip to main content

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
(0)
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 LTS

In 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.php

Solution:
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+
Demonstrate Bug (older Tiki versions)
Ticket ID
6920
Created
Wednesday 14 November, 2018 18:51:16 UTC
by Roni Wolf
LastModif
Wednesday 14 November, 2018 18:51:16 UTC


Show PHP error messages