-
-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors editing after import #4422
Comments
Hi all!... finally I found the error related with this thread. After days debbuging backend and frontend code flows, I arrived to some solution. If someone (referring to active developers) happen to read this thread, hope to review my proposal and do things in an appropiate way according to the development guidelines of Teampass project. The problem comes from pages/items.js.php, specifically this jquery code related with Restrictions and Roles:
The case is, when you import from csv, I don't know the real reason but the attribute "title" is not available, so it's throwing an Uncaught Exception when a posteriori you try to edit any imported item. Maybe due to my specific teampass config, and relating to any imported item's editing, into this code block the parameter "value" is always different from 0 or null, and with this scenario data.roles_list.find(x => x.id === parseInt(value)).title throws the commented error because it doesn't find "title" attribute. At this time, I replaced this code by this one, in order to ensure (at least) that the execution flow is not interrupted :
Best Regards, |
…-imported items This commit addresses a bug where items, after being imported via CSV, throws errors when saved. The issue was due to missing role validation in the HTML rendering process, and it specifically affects the `pages/items.js.php` script. Changes include: - Added a role existence check before adding HTML badge elements. - Refactored the HTML generation loop to ensure robustness if roles are missing in `data.roles_list`. Original issue: nilsteampassnet#4422
…fter-csv-import Fix issue #4422: Resolve edit errors on previously CSV-imported items
Hi! all,
I detected some malfunction when importing from CSV file. Thanks in advance for your help/advice/hints ;-)... so here we go,
Describing general config:
Steps to reproduce
label,login,password,url,comments
"Logan","MyLogan","YoupiCheap","http://www.logan.fr",""
"Logan2","MyLogan2","YoupiCheap2","http://www.logan2.fr",""
"Logan3","MyLogan3","YoupiCheap3","http://www.logan3.fr",""
"Logan4","MyLogan4","YoupiCheap4","http://www.logan4.fr",""
"Logan5","MyLogan5","YoupiCheap5","http://www.logan5.fr",""
"Logan6","MyLogan6","YoupiCheap6","http://www.logan6.fr",""
[by making use of Chrome Developer Tools]: I think, but I'm not sure about, that the Update Action (when I edit some item) is not sent to server when I click on Save button. It seems that javascript flow breaks off, registering following error at Console level (IMPORTANT! not when "edit" button is clicked, but when previously entering to item for reading data):
XHR finished loading: POST "". jquery.min.js?v=3.1.2:2 XHR finished loading: POST "https://teampass.local/sources/items.queries.php".send @ jquery.min.js?v=3.1.2:2
ajax @ jquery.min.js?v=3.1.2:2
...
index.php?page=items:8997 Uncaught TypeError: Cannot read properties of undefined (reading 'title')
at String. (index.php?page=items:8997:76)
at Function.each (jquery.min.js?v=3.1.2:2:3003)
at Object.success (index.php?page=items:8994:19)
at c (jquery.min.js?v=3.1.2:2:28327)
at Object.fireWith [as resolveWith] (jquery.min.js?v=3.1.2:2:29072)
at l (jquery.min.js?v=3.1.2:2:79901)
at XMLHttpRequest. (jquery.min.js?v=3.1.2:2:82355)
(anonymous) @ index.php?page=items:8997
each @ jquery.min.js?v=3.1.2:2
(anonymous) @ index.php?page=items:8994
c @ jquery.min.js?v=3.1.2:2
fireWith @ jquery.min.js?v=3.1.2:2
l @ jquery.min.js?v=3.1.2:2
(anonymous) @ jquery.min.js?v=3.1.2:2
load
send @ jquery.min.js?v=3.1.2:2
ajax @ jquery.min.js?v=3.1.2:2
S. @ jquery.min.js?v=3.1.2:2
showDetailsStep2 @ index.php?page=items:8899
(anonymous) @ index.php?page=items:8821
c @ jquery.min.js?v=3.1.2:2
fireWith @ jquery.min.js?v=3.1.2:2
l @ jquery.min.js?v=3.1.2:2
(anonymous) @ jquery.min.js?v=3.1.2:2
load
send @ jquery.min.js?v=3.1.2:2
ajax @ jquery.min.js?v=3.1.2:2
S. @ jquery.min.js?v=3.1.2:2
(anonymous) @ index.php?page=items:8250
e @ jquery.min.js?v=3.1.2:2
t @ jquery.min.js?v=3.1.2:2
setTimeout
(anonymous) @ jquery.min.js?v=3.1.2:2
c @ jquery.min.js?v=3.1.2:2
fireWith @ jquery.min.js?v=3.1.2:2
fire @ jquery.min.js?v=3.1.2:2
c @ jquery.min.js?v=3.1.2:2
fireWith @ jquery.min.js?v=3.1.2:2
e @ jquery.min.js?v=3.1.2:2
t @ jquery.min.js?v=3.1.2:2
setTimeout
(anonymous) @ jquery.min.js?v=3.1.2:2
c @ jquery.min.js?v=3.1.2:2
fireWith @ jquery.min.js?v=3.1.2:2
fire @ jquery.min.js?v=3.1.2:2
c @ jquery.min.js?v=3.1.2:2
fireWith @ jquery.min.js?v=3.1.2:2
s. @ jquery.min.js?v=3.1.2:2
Promise.then
I @ jquery.min.js?v=3.1.2:2
when @ jquery.min.js?v=3.1.2:2
Details @ index.php?page=items:8136
(anonymous) @ index.php?page=items:5982
dispatch @ jquery.min.js?v=3.1.2:2
v.handle @ jquery.min.js?v=3.1.2:2 Understand this error
on access.log
(when csv imported and when edited some item)
on errors.log
(when csv imported and when edited some item)
Looking Forward to hearing from you
Additional info (added 10/18/24)
I've noticed, when clicked on any imported item, that the "History section" header appears with grey color showing up the "loading" icon. And it remains like this forever (capture attached)
The text was updated successfully, but these errors were encountered: