Open mpble opened 3 years ago
Same error to me with version 3.0.0.14. The first search works but the other ones gave me the following error:
Uncaught TypeError: JSON.parse(...).concat is not a function
sList https://<myurl>/index.php?page=items:6849
finishingItemsFind https://<myurl>/index.php?page=items:6163
jQuery 7
finishingItemsFind https://<myurl>/index.php?page=items:6139
searchItems https://<myurl>/index.php?page=items:6125
<anonymous> https://<myurl>/index.php?page=items:5396
jQuery 9
<anonymous> https://<myurl>/index.php?page=items:5393
index.php:6849:87
After some debugging I found the error is on line 3758 of file pages/items.js.php
.
The original code:
if (store.get('teampassApplication').itemsList === '' || store.get('teampassApplication').itemsList === undefined) {
var stored_datas = listOfItems;
} else {
var stored_datas = JSON.parse(store.get('teampassApplication').itemsList).concat(listOfItems);
}
The edited and working code (added brackets in else condition betwen JSON.parse function):
if (store.get('teampassApplication').itemsList === '' || store.get('teampassApplication').itemsList === undefined) {
var stored_datas = listOfItems;
} else {
var stored_datas = [JSON.parse(store.get('teampassApplication')].itemsList).concat(listOfItems);
}
I know that this is not a pretty solution, but seems missing explicit cast to array object.
Hope this helps!
Page on which it happened
index.php?page=items
Steps to reproduce
Expected behaviour
It should find any item that matches the search term in any field or folder that matches the search term.
Actual behaviour
Nothing is found.
Server configuration
Operating system: Linux mail.private-mailing.com 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64
Web server: Apache
Database: 5.5.5-10.3.29-MariaDB-0+deb10u1
PHP version: 7.3.29-1~deb10u1
Teampass version: 3.0.0.8
Teampass configuration file:
Updated from an older Teampass or fresh install:
Client configuration
Browser: Firefox - 91.0
Operating system: OSX - 32bits
Logs
Web server error log
Teampass 10 last system errors
Log from the web-browser developer console (CTRL + SHIFT + i)