With the new PHPzip library the zip seems corrupted if there are more than 180 items to archive.
(I can recover the zip with the "repair archive" option from winrar)

CommentFileSizeAuthor
zipcorrupted.patch520 bytesxaa
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xaa created an issue. See original summary.

xaa’s picture

Issue summary: View changes
xaa’s picture

Issue summary: View changes
xaa’s picture

sry for the mess.
not sure about that .. but adding exit(); after the header variables seems fix the issue (line165 of views_vcards.module).

Neograph734’s picture

I will have a look, as I am not really happy with the idea of killing a script halfway that is not the preferred solution. Perhaps we can find a better alternative.

Neograph734’s picture

Status: Active » Needs review

It seems that for some reason views puts the preview text at the end of the zip file once there are too many items...

I think it can be solved by suppressing the preview output. Could you try to edit views_vcards.module lines 118-119 and make sure it looks like this? (Add $variables['items'] = NULL;)

  if (empty($variables['view']->live_preview)) {
    $variables['items'] = NULL;

That seems to solve it (tested with 500 users).

p.s. funny to see you are trying +100 items, I have never used it for more than 15 users at a time.

xaa’s picture

Yes I agree exit; was not a solution :).

Your suggestion is working. thank you!

(I have an address book (+- 180 nodes currently) and a node can have multiple contacts. Depending of the views filters the archive may have hundred of vcards).

  • Neograph734 committed 9d1a1a7 on 8.x-2.x
    Issue #2945952 by xaa: Zip corrupted if too many items
    
Neograph734’s picture

Version: 8.x-2.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Great, thanks for checking. Pushed to dev.

Neograph734’s picture

Status: Patch (to be ported) » Closed (works as designed)

I blame this on not having used the Streamed Response from Symfony. It had nothing to do with the library. No need to backport this to 7 as the issue does not exist there.