See screenshots, one is attachment uploading in node, the other one - in comments and this one doesn't look right. Is it supposed to be that way?

iTweak Upload 6.x-2.2
Comment Upload 6.x-1.x-dev from 2009-Jul-15

CommentFileSizeAuthor
appearence-comments.jpg79.15 KBbatbug2
appearence-node.jpg48.09 KBbatbug2

Comments

iva2k’s picture

Status: Active » Postponed (maintainer needs more info)

No, the comments do not look right.

You may be experiencing CSS limit issue (IE and FF browsers have small limit of CSS files that they would load for any given page, like 30 or 31). Any "unlucky" CSS file that ends up ignored would cause such rendering issues. Try enabling "Optimize CSS files" in admin/settings/performance, then flushing all caches and checking if problem remains. If it goes away, your site indeed gets more than the max limit of CSS files.

This is a well known drupal problem, where each module suppose to provide a separate CSS file if it uses custom styling, and many modules do that.

batbug2’s picture

Status: Postponed (maintainer needs more info) » Active

"Optimize CSS files" is always enabled

iva2k’s picture

Status: Active » Postponed (maintainer needs more info)

Try flushing all caches and report if there is any change. If not, can you give a url to your website (if sensitive, can do a private message). I can check what is going wrong. Also, what browser / version are you using?

batbug2’s picture

Flushing the caches does not help.

Site URL is http://liveangarsk.ru

This happens in all browsers.

And by looking at the code this seems to be not just CSS issue: the differences between those two upload forms is their IDs: table#upload-attachments and table#comment-upload-attachments. I added neccessary lines to the css, and now the tables look kinda the same, but still in comment uploading the attached files are not in the table but below it.

My ICQ is 993111, and I guess we could both speak Russian (i'm always online, just in the invisible mode).

batbug2’s picture

Status: Postponed (maintainer needs more info) » Active
batbug2’s picture

Ok, i have fixed it, weird way though...

In comment_upload.module changed theme_comment_upload_form_current function to this

function theme_comment_upload_form_current(&$form) {





  drupal_add_tabledrag('comment-upload-attachments', 'order', 'sibling', 'comment-upload-weight');

  foreach (element_children($form) as $key) {
    // Add class to group weight fields for drag and drop.
    $form[$key]['weight']['#attributes']['class'] = 'comment-upload-weight';
    $row = array('');
    if (isset($form[$key]['preview']) && is_array($form[$key]['preview'])) {
      // this td will be showing preview thumbnail
      $row[] = array(
        'data' => drupal_render($form[$key]['preview']),
        'class' => 'mime',
      );
    }
    else {
      // this td will be used for mime icon (CSS)
      $row[] = array(
        'data' => '',
        'class' => 'mime',
      );
    }
    $output = '';
    // Description: we save the URL, remove it as a description and change the size of the input
    $url = $form[$key]['description']['#description'];
    unset($form[$key]['description']['#description']);
    $form[$key]['description']['#size'] = 40;
    $form[$key]['description']['#attributes'] = array('class' => 'rename');
    $output .= drupal_render($form[$key]['description']);
    // Size & URL
    $output .= '<span class="details">' . drupal_render($form[$key]['size']) . ' - ' . $url . '</span>';
    $row[] = array(
      'data' => $output,
      'class' => 'file container-inline'
    );
    // Remove
    $form[$key]['remove']['#attributes'] = array('class' => 'remove');
    $form[$key]['remove']['#suffix'] = ' ' . t('Remove');
    $row[] = array(
      'data' => drupal_render($form[$key]['remove']),
      'class' => 'remove container-inline'
    );
    // List
    $form[$key]['list']['#suffix'] = ' ' . t('List');
    $row[] = array(
      'data' => drupal_render($form[$key]['list']),
      'class' => 'list container-inline'
    );
    // Weight
    $row[] = drupal_render($form[$key]['weight']);
    // Add the extension as a class for styling
    $extension = strtolower(substr(strrchr($form[$key]['filename']['#value'], '.'), 1));
    $rows[] = array('data' => $row, 'class' => 'draggable mime-' . $extension);
  }
  $output = theme('table', array(), $rows, array('id' => 'comment-upload-attachments'));
  $output .= drupal_render($form);
  return $output;

This made it all work correctly but regular, non-image attachment list was printed twice in a comment.

Had to change a bit in itweak_upload.module:
In function itweak_upload_comment(&$comment, $op) i commented out


// Add regular attachment list
    if ($cnt_other) {
      if ($files_display != 4) {
  this line --->     // $comment->comment .= theme('comment_upload_attachments', $comment->files, FALSE, NULL, TRUE, $options);
      }
    }

Now it all works like advertised! (Of course i had to add #comment-upload-attachments id to the itweak_upload.css file where needed.

iva2k’s picture

Status: Active » Postponed (maintainer needs more info)

I guess website @ the URL is not showing the problem anymore. Also, I did not find which nodes have comments with attachments by browsing - it would be more helpful to have complete URL.

Your fix suggests that comment_upload.module theme function theme_comment_upload_form_current() is called instead of itweak_upload.module itweak_upload_comment_upload_form_current(), which should not happen if itweak_upload is enabled. That can explain why it was not displaying attachments properly in comments. My first guess (flush all caches) was about that. Actually you should rebuild theme registry, which flushing all caches is supposed to be doing.

It could also be due to module weights in {system} table, perhaps if comment_upload.module weight was changed from its default. If it is the case, a better fix would be to rearrange weights. Supporting evidence for that being the case is in #4 table#comment-upload-attachments. itweak_upload does not create table#comment-upload-attachments. It creates table#upload-attachments for both node and comment_upload files, so they are styled by the same CSS.

Please try changing module weights (itweak_upload weight should be > comment_upload weight).

batbug2’s picture

Status: Postponed (maintainer needs more info) » Active

Latest updates to comment_upload module set its weight to 2. Itweak's weight is 0.

I changed Itweak's weight from 0 to 50, rebuilt theme registry and reverted all my hacks. Now it all works as expected :) Thank you very much.

Though I've encountered another small glitch: in this node - http://liveangarsk.ru/blog/fantazmer/20090907/mms-subject-vo - attached there photo doesn't show up as a thumbnail, because this node was created with mailhandler. It works fine in a regular nodes (like http://liveangarsk.ru/blog/batbug/20090904/zubik )/ I find it very strange because Itweak_upload invokes hook_nodeapi on NODE VIEW and this photo must be processed. Any clue?

iva2k’s picture

Title: Comment attachements uploading doesn't look right » Comment attachements uploading doesn't look right. Comment upload weight changed to 2.
Assigned: Unassigned » iva2k
Category: support » task

@batbug:

Thanks for the test & update. I will follow up with appropriate iTweak Upload changes.

Note to self:
Need to make iTweak Upload weight > comment upload weight.

Re: "Though I've encountered another small glitch: in this node..."
Please open a separate issue for that. It is better to track separate issues in separate threads.

iva2k’s picture

Status: Active » Fixed

Fixed in 6.x-2.x-dev.

Status: Fixed » Closed (fixed)

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