Download & Extend

Error when editing: "Referencing to the file used in the field is not allowed."

Project:BitTorrent
Version:6.x-9.2-alpha6
Component:Code
Category:bug report
Priority:normal
Assigned:overall
Status:active
Issue tags:FileField

Issue Summary

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.

Comments

#1

#2

Assigned to:Anonymous» overall
Status:active» fixed

#3

Status:fixed» active

#4

#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

Am I right that it's no need to report those bugs before the 6.x-10-dev is published?

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

Is there any IRC channel for developers of the module?

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

Status:fixed» closed (fixed)

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

#9

Status:closed (fixed)» active

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;
}

Sorry. I'm mistake...

#11

Subscribing.

#12

any update on this? Because patch (http://drupal.org/node/441280#comment-1827898) doesn't work on Filefield 3.2 Im using Bittorrent 9.2-alpha6

#13

Any new info...
Curently the error is here..

#14

The "derivative"" patch is working....

#15

#16

Hi,
how did you made it work?
I've just replaced the code with the patch but the "Referencing to the file used in the field is not allowed" message still appears...

does this code have something to do with it?

<?php
/**
* Implementation of hook_filefield_derivatives().
*/
function bt_torrent_filefield_derivatives() {
  return array(
'torrent');
}
?>

I don't know where to put it, I have no clue about PHP...
Thanx in advance!

#17

The patch from #4 applies ok to filefield 6.x-3.7 but the error still appears.