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

array_flip(): Can only flip STRING and INTEGER values! #24

Closed
shopapps opened this issue Sep 25, 2018 · 10 comments
Closed

array_flip(): Can only flip STRING and INTEGER values! #24

shopapps opened this issue Sep 25, 2018 · 10 comments
Labels
enhancement New feature or request

Comments

@shopapps
Copy link

Hi,

When trying to Export to Excel (via a Lens), I am seeing an error:

array_flip(): Can only flip STRING and INTEGER values!

any thoughts what can cause this?

@patrickbrouwers
Copy link
Member

We don't use an array_flip in our code. It's most likely something in your or Nova's code. Can you provide a bit more information. This is quite limited to work with. Think about code example, full stacktrace etc.

@shopapps
Copy link
Author

Hi,

Yeah I knew it was a general question, I was just curious if anyone had seen something similar before and could give me a direction to look.

I will see what bits of the code I can sanitise and release. But it is a standard Lens and Filter setup, with a couple of columns created not from the direct SQL query and shows fine on the VueJS Table...

@shopapps
Copy link
Author

shopapps commented Sep 27, 2018

After some digging around the issue seems to be around Nova's callbacks in Computed Fields. i.e. using:

 Text::make('Colour', function() {
                return $this->getCurrentOptionValue('Colour');
            }),

or even just...

 Text::make('Colour', function() { return ''; }),

in the fields() method causes the issue. Don't see this as an issue with laraval-nova-excel persay just means anyone using callbacks cant use the module for that specific resource/Lens :-(

Regards,

Paul.

@patrickbrouwers
Copy link
Member

Hm, perhaps we can figure something out to get the value that the callback creates, but I'm not sure on which level this goes wrong. Let's leave the ticket open, I will have a look at it soon.

@patrickbrouwers patrickbrouwers added the enhancement New feature or request label Sep 27, 2018
@patrickbrouwers
Copy link
Member

WIP #26. Feel free to give it a test.

@shopapps
Copy link
Author

shopapps commented Oct 2, 2018

Great thanks, will take a look in the next few days and let you know! 👍

@patrickbrouwers
Copy link
Member

Computed fields are released as 1.1

@arditokshtuni
Copy link

arditokshtuni commented Aug 5, 2019

@patrickbrouwers i am getting this error because i use this field on my nova resource https://github.com/dillingham/nova-button

Is there any option to exclude this filed in case to avoid error?

Thanks, great package btw

@BasselArt
Copy link

@patrickbrouwers i am getting this error because i use this field on my nova resource https://github.com/dillingham/nova-button

Is there any option to exclude this filed in case to avoid error?

Thanks, great package btw

Same here

@noahlocke
Copy link

noahlocke commented Dec 5, 2019

@patrickbrouwers i am getting this error because i use this field on my nova resource >https://github.com/dillingham/nova-button

Is there any option to exclude this filed in case to avoid error?

Thanks, great package btw

me too @patrickbrouwers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants