When I attach a file to an ad, and then edit the node, the various form widget elements are missing their labels rendering this part of the UI extremely user unfriendly.

The labels that are missing are:

  1. Remove (checkbox)
  2. List (checkbox)
  3. Weight (select list)
  4. Private (checkbox)

See screen shot of this. I get this on all browsers, and the HTML markup is in fact not rendering the labels so it's not a browser issue.

I'm running Drupal 6.20, Private Upload 6.x-1.0-rc3, FileField 6.x-3.9.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quinns’s picture

Nobody have any clues on this one? Still an issue for our customer. Thanks.

John Franklin’s picture

Project: Advertisement » Private Upload
Version: 6.x-2.2 » 6.x-1.x-dev
Component: ad module » Code

I can confirm that when I enable Private Upload the labels disappear. I also see this in CCK-created content types with a file field. Disabling Private Upload fixes both the CCK-based content type's and the Advertisement type's create & edit forms.

quinns’s picture

John Franklin, thanks very much. That fixed the problem for my customer too.

quinns’s picture

Status: Active » Closed (fixed)
John Franklin’s picture

Priority: Critical » Major
Status: Closed (fixed) » Active

Disabling the module may fix the site, but it doesn't fix the code. Reopening so the Private Upload maintainers can investigate.

sbellens’s picture

Confirming this bug here. I'm using the same versions and bump into the exact same problem as described and pictured. I'm experimented a bit with the 6.x dev version of the module atm.

The problem is in the javascript section of the private_upload.module file, lines 385 - 408. Changing the lines 386 and 387 from

$form['files']['#theme'] = 'private_upload_form';
// $form['#submit'][] = 'private_upload_form_submit'; // ???

to

// $form['files']['#theme'] = 'private_upload_form';
$form['#submit'][] = 'private_upload_form_submit'; // ???

Already get's the original view back plus an added checkbox - which is however misplaced. I'm all but a PHP expert, so maybe one of the module developers can take it from here?

Anonymous’s picture

I just updated to the latest dev and this looks to be fixed...

Anonymous’s picture

I updated to the latest dev, 6.x-1.x-dev, still have the same issue as quinns (thanks for that screenshot).
I did run update.php & flush cache.

Am not using conflicting modules noted in project page (Upload Path, Upload Image).

I am using the core Upload; not using FileField, btw, does this affect Private Upload?

I originally made a separate post, http://drupal.org/node/1177216, but this thread covers the same issue.

torrance123’s picture

Just thought to pass on my fix to this:

Around line 649 of private_upload.module change this:

/**
 *  Based on theme_upload_form_current.
 *  Adding the Private checkbox.
 */
function theme_private_upload_form(&$form) {
  $header = array('', t('Delete'), t('List'), t('Private'), t('Description'), t('Weight'), t('Size'));
  drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight');

to this:

/**
 *  Based on theme_upload_form_current.
 *  Adding the Private checkbox.
 */
function theme_private_upload_form($form) {
  $header = array('', t('Delete'), t('List'), t('Private'), t('Description'), t('Weight'), t('Size'));
  drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight');

Did you miss the difference? It's that single ampersand character before the $form variable in the function definition. I'm not sure why this hasn't affected everyone, but it may be php version related.

Anonymous’s picture

@torrance123 - That did it, thanks very much! Yes I had missed the difference. The widgets are back! I can list and delete!

That frees me up to raise a previous issue I had encountered but couldn't separate out :)
[ instead of a private/ directory being created, files are being uploaded into the files/ directory with names like private, private_0, private_1...
I'll look for, and if necessary, start a separate post about it.]

John Bickar’s picture

Confirming that this issue exists when running PHP 5.3 (does not affect PHP 5.2) and that removing the ampersand (passing the variable by reference) in theme_private_upload_form() fixes the issue for 5.3.

b-netix’s picture

using changes from sbellens and torrance123 fix my problems
thanks

cmseasy’s picture

Worked for me, thanks.

Time for porting it to rc4 or an updated dev!?

mortona2k’s picture

What cmseasy said.

zerolab’s picture

Attaching the fix from #9 as a patch

pierrozone’s picture

Danny Englander’s picture

Status: Active » Needs review
FileSize
562 bytes

I had the same issue but the patch in #15 did not work as something in dev has changed since the patch was written. I've attached a new patch against the latest dev (2013-May-24) and tested it and it all seems fine to me.

mygumbo’s picture

Worked for me, thanks, highrockmedia.

YesCT’s picture

I just ran into this also, after upgrading my php version.