Error when editing: "Referencing to the file used in the field is not allowed."
ask - July 18, 2009 - 18:57
| Project: | BitTorrent |
| Version: | 6.x-9.2-alpha6 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | overall |
| Status: | active |
Jump to:
Description
The torrent node editing (preview or saving) gives error
Referencing to the file used in the Torrent file field is not allowed.
where 'Torrent file' is the name of my field of "Torrent" type.
In case of two torrent files, the above error appears twice.
This error is raised by row 424 of filefield/filefield_widget.inc of filefield-6.x-3.1 module:
if ($references['filefield'] == 0) {
form_error($element, t('Referencing to the file used in the %field field is not allowed.', array('%field' => $element['#title'])));
}This error did not appear with 9.2-alpha3.
Don't know really what to debug.

#1
It seems that it's a FileField issue.
#441280: Editing node causes Referencing to the file used in the field is not allowed (and also #466104: Referencing to the file used in the field is not allowed (?))
I'll try to fix it anyway, but I don't promise....
#2
#3
#4
http://drupal.org/node/441280#comment-1827898
#5
Thanks, the patched filefield library works (!) after update to bittorrent-HEAD version from CVS.
Found the bittorrent-HEAD buggy sometimes. Am I right that it's no need to report those bugs before the 6.x-10-dev is published?
Is there any IRC channel for developers of the module?
#6
Yes, you are right, also I have to notice that 10.x release will never be published, because of some problems with version numbers:
#502164: Cannot create module branch "DRUPAL-6--10" in CVS
#498130: Correct version numbers
Currently I am the only developer of the module. bradfordcp currently busy with other projects ( http://drupal.org/node/440838 ).
#7
Ok, I see... But it does not seem to be a problem just to stay in 9.x versions numbering if they wouldn't manage to 'rollback' those versions for you (which is not the case if they really use the native CVS server).
Anyway, thanks for your efforts in moving the project forward. I also plan to join the development process with active contributions to this module later this winter, after changing the job.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.
#9
I'm reopening this issue because the patch in #441280: Editing node causes Referencing to the file used in the field is not allowed will not be applied. I think this is a fundamental problem with BitTorrent module, since no other module extending FileField requires this patch.
#10
I found problem. Mistake in function bt_torrent_elements()
work code:
/**
* Implementation of hook_elements().
*/
function bt_torrent_elements() {
$elements = array();
$filefield_elements = filefield_elements();
$elements['torrentfield_widget'] = $filefield_elements['filefield_widget'];
//
$elements['torrentfield_widget']['#process'][] = 'bt_torrent_widget_process';
$elements['torrentfield_widget']['#process'] = array('bt_torrent_widget_process');
$elements['torrentfield_widget']['#value_callback'] = 'bt_torrent_widget_value';
//
// specify the return structure of the element (experimental, unused in releases).
//$elements['torrentfield_widget']['#returns'] = array('array' => array('fid' => 'int')); //... //???
return $elements;
}