Hi
If you have a multiple files attached to node and you select that none of them are displayed, this function should unset un-displayed (none-displayed) items in $items array.
But it doesn't. Because of the position "$items[$id] = array_values($items[$id])" line. This line set indexes keys in new order for every item inside entities. Because of that some items are left out and are displayed on the page/node.
The line '$items[$id] = array_values($items[$id])' should go one "foreach" sentence up in hierarchy.
I think, that this line should be executed for each entities after items has bee processed.
Take care,
Damjan
Comments
Comment #1
damjan.cvetan commentedComment #2
damjan.cvetan commentedComment #3
damjan.cvetan commentedSorry, wrong patch.
Comment #4
damjan.cvetan commentedThe same in 7.x-dev.
Comment #5
catchYou should roll the patch from the root of Drupal core, that way the test bot will be able to apply it.
Comment #6
damjan.cvetan commentedTnx for the advice. Is now ok?
Comment #7
damjan.cvetan commentedComment #9
damjan.cvetan commentedComment #10
dave reidThis is a duplicate of #1016068: File field display consecutive files hide error.
Comment #11
andrus9000 commentedHi, I'm not able to patch (probably because of my shared hosting plan), could you guide me through a manual file editing?
Thanks very much in advance!
Comment #12
damjan.cvetan commentedYou just need to open file /modules/file/file.field.inc and make changes below
@@ -203,9 +203,9 @@ function file_field_prepare_view($entity
if (!file_field_displayed($item, $field)) {
unset($items[$id][$delta]);
}
- // Ensure consecutive deltas.
- $items[$id] = array_values($items[$id]);
}
+ // Ensure consecutive deltas.
+ $items[$id] = array_values($items[$id]);
}
}