Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Title: Download link is broken in Drupal ^8.5.0 » Download link returns 406 with Drupal ^8.5.0
Status: Active » Needs review
Parent issue: » #2937942: REST views: regression in 8.5.x: view with display using 'csv' format now returns a 406 response, need to add ?_format=csv to URL to make it work
FileSize
540 bytes
darvanen’s picture

Status: Needs review » Reviewed & tested by the community

Agreed this is a good approach for now. Doesn't affect other download types which was the only potential issue I could think of.

akalam’s picture

Status: Reviewed & tested by the community » Needs work

Great approach, but if you try to access directly to the download url, you steel get the 406 error

akalam’s picture

Status: Needs work » Reviewed & tested by the community

Sorry for the previous comment, I understand now the workarround. Waiting for core issue #2937942 to solve it

Yazzbe’s picture

Thanks for the workaround Claudiu.
#2 fixed my export links after upgrading to D8.5

simgui8’s picture

Thanks you Claudiu.
#2 fixed my export links after upgrading to D8.5

nottaken’s picture

#2 fixed It for me as well after upgrading to D8.5. Thanks.

rgry’s picture

Adding ?_format=json is working for me in GET and DELETE but not in PATCH OR POST. Any hint I could try?

andypost’s picture

chadmandoo’s picture

This works for downloading when attaching to but not whenever the view is URL based. Is there any work around for this?

darvanen’s picture

@chadmandoo this will only affect automatically generated links. Have you tried adding
?_format=csv
to the end of your URL when visiting it? (Not when setting it in the view)

hamrant’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.06 KB

Fixed for using ?_format=csv in feed Icon.

bander2’s picture

Status: Needs review » Needs work

#13 works for my CSV exports, but it looks like it adds "?_format=csv" to all attached views data export urls indiscriminately. So it breaks or at least doesn't doesn't fix JSON and XML exports.

Berdir’s picture

Status: Needs work » Reviewed & tested by the community

I don't quite understand what #13 is trying to do and why #2 would not work for that which is setting the first configured format dynamically.

Wim Leers’s picture

I don't think @Berdir meant to RTBC?

Berdir’s picture

I Re-RTBC'd the patch from comment #2 that was RTBC before and AFAIK works fine and I'd suggest to open a separate issue if there are additional problems that are not solved by this :)

dandaman’s picture

Patch #2 works for me. At least, the CSV button attached to the other views now has a link that works.

jhedstrom’s picture

This adds a test. The test-only patch is the interdiff as well (from #2).

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 19: 2951185-19.patch, failed testing. View results

jhedstrom’s picture

Status: Needs work » Needs review
FileSize
1.12 KB
3.5 KB
4.02 KB

Oops, changes to the test view broke the existing kernel test.

The last submitted patch, 21: 2951185-20-TEST-ONLY.patch, failed testing. View results

kevin.dutra’s picture

Status: Needs review » Reviewed & tested by the community

Awesome! Nice to have some test coverage on top of the fix. Since the fix without tests was already RTBC and the tests are passing, moving this back to RTBC.

Mihaigr’s picture

This fixes the issue for me

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 24: 2951185-24.patch, failed testing. View results

jhedstrom’s picture

I've committed the patch in #21. Thanks all!

jhedstrom’s picture

Status: Needs work » Fixed
mcfdez87’s picture

Hello,

With the last dev realese (downloaded today) with Drupal 8.5.3 the error is still happening. If I put at the end of the path "? _format = csv" and it works, but without it, no.

mcfdez87’s picture

Status: Fixed » Active
Berdir’s picture

Status: Active » Fixed

See the referenced core issue.

This is only about fixing the attached icons, it does nothing to all other links and it is not meant to.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.