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

Fixing undefined offset notice if fields are empty #7

Merged
merged 1 commit into from Jul 17, 2013

Conversation

chronon
Copy link
Contributor

@chronon chronon commented Jul 16, 2013

Using $this->CsvView->quickExport($users); with a table containing empty (not null) fields was giving me a PHP notice:

Notice (8): Undefined offset: 0 [APP/Plugin/CsvView/View/CsvView.php, line 214]

This seems to fix the notice, and exports work as expected.

@josegonzalez
Copy link
Member

Can you change the tests so that you add a test, not modify the existing ones?

@chronon
Copy link
Contributor Author

chronon commented Jul 17, 2013

Does that work, or would it be better to make a new fork/pull request to keep commit history clean?

@josegonzalez
Copy link
Member

You can squash your commits and then force push to this branch, then I can merge it in :)

@chronon
Copy link
Contributor Author

chronon commented Jul 17, 2013

Squashed.

josegonzalez added a commit that referenced this pull request Jul 17, 2013
Fixing undefined offset notice if fields are empty
@josegonzalez josegonzalez merged commit 97de7c2 into FriendsOfCake:master Jul 17, 2013
@josegonzalez
Copy link
Member

Merged, thanks for the pull request!

joshuapaling added a commit to joshuapaling/cakephp-csvview that referenced this pull request Jul 23, 2013
Pull request FriendsOfCake#7 has an issue where rows that contain missing / null values will have their columns out of alignment with the data in other columns, and with the header/footer.

This resolves that issue by adding a string as a placeholder for null or missing columns. The value of this string can be changed via the $_null configuration option, and defaults to 'NULL'.

I think this code should also resolve issue FriendsOfCake#6.

Signed-off-by: Joshua Paling <joshua.paling@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants