Skip to content
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

CSV import format validation #7

Closed
AMDG2 opened this issue Dec 3, 2019 · 3 comments
Closed

CSV import format validation #7

AMDG2 opened this issue Dec 3, 2019 · 3 comments
Assignees
Labels
datasource testing development finished; in testing
Milestone

Comments

@AMDG2
Copy link

AMDG2 commented Dec 3, 2019

When trying to import CSV from clipboard I have error message. When I check the log I see this:

{
	"reqId":"xxxxx",
	"level":3,
	"time":"2019-12-03T15:33:05+00:00",
	"remoteAddr":"xxxxx",
	"user":"xxxxx",
	"app":"PHP",
	"method":"POST",
	"url":"\/index.php\/apps\/analytics\/data\/importCSV",
	"message":"sizeof(): Parameter must be an array or an object that implements Countable at \/path\/to\/nextcloud\/apps\/analytics\/lib\/Controller\/DataLoadController.php#150",
	"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko\/20100101 Firefox\/70.0",
	"version":"17.0.1.1"
}

I tried with these CSVs:

A;B;B
1;2;3
3;4;5
6;7;8
A,B,B
1,2,3
3,4,5
6,7,8

May be this is not what is expected?

PHP Version Info:

php -v
PHP 7.3.12 (cli) (built: Nov 20 2019 19:02:54) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.12, Copyright (c) 1999-2018, by Zend Technologies

If you need more info let me know.

@Rello
Copy link
Owner

Rello commented Dec 3, 2019

Hello,
welcome do Data Analytics.

Please try it without the header. just

1,2,3
3,4,5
6,7,8

I am still working on hardening/errorhandling here (including better messages).
does it work?

@Rello Rello self-assigned this Dec 3, 2019
@Rello Rello changed the title PHP 7.3 issue CSV import format issue Dec 3, 2019
@Rello Rello changed the title CSV import format issue CSV import format validation missing Dec 3, 2019
@Rello Rello changed the title CSV import format validation missing CSV import format validation Dec 3, 2019
Rello added a commit that referenced this issue Dec 3, 2019
@Rello Rello added the testing development finished; in testing label Dec 3, 2019
@Rello Rello added this to the 1.1.0 milestone Dec 3, 2019
@AMDG2
Copy link
Author

AMDG2 commented Dec 4, 2019

It works with the suggested CSV.

However I have to double check because it may be related to the fact that I disabled the uBlock origin (most of the assets are getting blocked due to analytics in the name).

@AMDG2
Copy link
Author

AMDG2 commented Dec 4, 2019

Ok, I can confirm that the suggested CSV works. I will open another issue for the uBlock problem.

@AMDG2 AMDG2 closed this as completed Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasource testing development finished; in testing
Projects
None yet
Development

No branches or pull requests

2 participants