Closed Azooz2014 closed 11 months ago
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Bump and Updated title to reflect the exact error more accurately.
@snipe I Found a bug in the UserImporter Class and i've fixed it, can i create a pull request?
@Azooz2014 Not Snipe (thankfully for her tho), but I was looking into https://github.com/snipe/snipe-it/issues/13860 and appears to be the same issue and I was not able to reproduce it in my local instance. But yeah, If you found the issue we are happy to discuss it more in a PR. Also you are gonna be helping another Snipe-IT user, and that is always welcomed!!
@Azooz2014 Not Snipe (thankfully for her tho), but I was looking into #13860 and appears to be the same issue and I was not able to reproduce it in my local instance. But yeah, If you found the issue we are happy to discuss it more in a PR. Also you are gonna be helping another Snipe-IT user, and that is always welcomed!!
Hi, coming from #13860. Have you guys solved the issue?
@inietov The problem was the call of fetchManager()
function in the UserImporter
Class where the trim function inside the passed arguments was used in a wrong way which caused an ArugmentCount Exception to be thrown thinking that only 1 argument was passed but in fact 2 arguments were passed.
I forked the master branch and inspected the code but everything looked correct in there so maybe this strange bug was packaged into the latest docker image by accident or something.
The Build version i have from the docker is v6.2.3 - build 11759 (master) and the original code of fetchManager()
function in the UserImporter Class is as below:-
$this->item['manager_id'] = $this->fetchManager(trim($this->findCsvMatch($row, 'manager_first_name'), $this->findCsvMatch($row, 'manager_last_name')));
The way i fixed it is by modifying fetchManager()
function in the UserImporter Class inside the running docker container to be as below:-
$this->item['manager_id'] = $this->fetchManager(trim($this->findCsvMatch($row, 'manager_first_name')), trim($this->findCsvMatch($row, 'manager_last_name')));
@thehamzajunaid you can try the above way in your running docker container.
@Azooz2014 - sure, we'd take a PR for this
@snipe Under which branch should I create the PR under? I've checked the master branch but the code seemed ok in there and didn't have the bug i mentioned.
master
and develop
are at parity right now (and usually are), but all development should be done on develop
for testing.
@inietov The problem was the call of
fetchManager()
function in theUserImporter
Class where the trim function inside the passed arguments was used in a wrong way which caused an ArugmentCount Exception to be thrown thinking that only 1 argument was passed but in fact 2 arguments were passed. I forked the master branch and inspected the code but everything looked correct in there so maybe this strange bug was packaged into the latest docker image by accident or something.The Build version i have from the docker is v6.2.3 - build 11759 (master) and the original code of
fetchManager()
function in the UserImporter Class is as below:-
$this->item['manager_id'] = $this->fetchManager(trim($this->findCsvMatch($row, 'manager_first_name'), $this->findCsvMatch($row, 'manager_last_name')));
The way i fixed it is by modifying
fetchManager()
function in the UserImporter Class inside the running docker container to be as below:-
$this->item['manager_id'] = $this->fetchManager(trim($this->findCsvMatch($row, 'manager_first_name')), trim($this->findCsvMatch($row, 'manager_last_name')));
@thehamzajunaid you can try the above way in your running docker container.
Hi Azooz, can you please share the format of the CSV that you are importing.
I followed the same format mentioned in snipe-it documentation
Can you please confirm if this is what your csv titles look like? After importing the csv I'm selecting the "User" import option and all the checkboxes are empty.
Debug mode
Describe the bug
Hi, I'm trying to import a list of users from a csv file which is following the sample CSVs in the documentation and when it's done there's nothing imported, when i checked the logs i received the following error.
Reproduction steps
Expected behavior
Screenshots
No response
Snipe-IT Version
v6.2.3 - build 11759 (master)
Operating System
Ubuntu 22.04.3 LTS
Web Server
Apache/2.4.52
PHP Version
8.1.2
Operating System
Windows 11 Pro
Browser
Firefox
Version
119.0
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
Additional context
Fresh install from latest docker image