Closed (fixed)
Project:
Attachment
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Jul 2007 at 14:28 UTC
Updated:
16 Aug 2007 at 17:49 UTC
There seems to be a bug when adding a new attachment within the edit node form. Every time a new attachment was added, the previous ones disappeared.
I could find the bug in attachment.module at line 158
if (($_POST['op'] == t('Preview')) || ($_POST['op'] == t('Submit'))) {
$node->attachments = $_POST['attachments'];
}
the "op" POST-var comes from the node edit form submit-buttons (-> Preview, Submit). But if you click on "Add" for the new attachment, the submit-button's name-value is 'fileop' not 'op'. Hence you have to check for this POST-var too in order to keep the existing attachments.
if ($_POST['fileop'] == t('Add') || ($_POST['op'] == t('Preview')) || ($_POST['op'] == t('Submit'))) {
$node->attachments = $_POST['attachments'];
}
Maybe someone more familiar to this module should also have a look at it.
Alex
Comments
Comment #1
cscsteve commentedAlex,
Thanks again. Bug fixed and applied. I know why I missed the other bug, but I'm not sure how I didn't catch this one. Keep up the testing!
- Steve
Comment #2
(not verified) commented