-
Notifications
You must be signed in to change notification settings - Fork 74
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
Using allFields() method breaks export of relationship and computed fields #48
Comments
I'll probably deprecate and replace this method in the next release by If you want to have an export that represents how the nova resource index page looks, you should just not using |
What should I do if I want to include all fields including relationships and computed values? |
@pelmered with "all fields" do you mean all fields that are defined as "index" fields on the nova resource? Than you don't have to do anything, those are used by default. |
@patrickbrouwers No, all fields that are defined on the resource no matter where they are displayed. In my case I would like to include all those fields except one. I think this is the most common use case, because you probably want to avoid side scrolling to use the buttons on the row. |
I think currently you would have to specify all fields with |
+1 on the ability to have a true allFields functionality! |
Same here. If using only(), when having a relationship with user_id, I can use user that will display the whole json object, but not user.email |
PR was merged |
Prerequisites
Versions
Description
Using
allFields()
method breaks export of relationship and computed fields.Steps to Reproduce
Ensure that your Resource includes a field that is defined with a
BelongsTo
relationship……or field that returns a computed value…
Use the
allFields()
method on the action as described in the documentation…Expected behavior:
The exported file should contain a representation of the relationship similar to how it appears on the Nova Resource index page. Similarly the file should contain the output generated by closure defined on the computed field.
Actual behavior:
The related record is represented in the Excel file as a foreign key. Computed fields are omitted.
Additional Information
This is already a known issue as indicated by a common made on a previous issue.
Given that the dev team has been aware of this since at least November 2018 I assume it is difficult or impractical to fix. However it would be useful to have this “feature” documented on the "Customizing Exports” page of the documentation and anywhere else that may be relevant.
The text was updated successfully, but these errors were encountered: