Weight isn't hidden @ admin/settings/biblio/fields

scottrigby - May 26, 2009 - 16:08
Project:Bibliography Module
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:needs review
Description

I see the problem but not exactly sure how to solve it.

In theme_biblio_admin_types_edit_form() (biblio_theme.inc line 748) the drupal_add_tabledrag function is given hidden=false.

<?php
  drupal_add_tabledrag
('field-table', 'order', 'sibling', 'weight',NULL,NULL,false);
?>

It looks like the reason is because this was hiding the Autocomplete column rather than the weight column -- I assume because of the way the hint / auth_type colspan is set up.

I didn't see an issue for this so mainly just creating one to track it. I haven't ever dealt with this (hiding weight with a draggable table using colspans) so don't have a solution to propose yet.

#1

rjerome - May 26, 2009 - 17:37

You are right on that and if you come up with a solution I'll be happy to include it :-)

#2

scottrigby - May 26, 2009 - 19:03

Hi rjerome,
Yeah, I'm not sure if there is some undocumented (or obscure) way to solve this, or if it really is a bug in drupal_add_tabledrag() or what --
I thought for a moment that the issue was we needed to add a colspan to the header cell too, but I did that & the problem still persisted (I kept that change cause it looks better anyway though it doesn't solve our problem).

So as a workaround I temporarily used Drupal's js-hide class, from modules/system/system.css, which from the css comments seems to be a not-too-inelegant way to do it, since it wil degrade gracefully if a user doesn't have js enabled in their browser. Another patch attached... Edit: see real patch in #3 below - can't seem to remove attachments when editing comments - oh well. This method works well for me.

/*
** For anything you want to hide on page load when JS is enabled, so
** that you can use the JS to control visibility and avoid flicker.
*/
html.js .js-hide {
  display: none;
}

AttachmentSize
biblio_473272_0.patch 806 bytes

#3

scottrigby - May 26, 2009 - 19:00
Status:active» needs review

Oops, diffed the wrong file. Real patch attached =)

AttachmentSize
biblio_473272_1.patch 1.27 KB

#4

scottrigby - May 26, 2009 - 19:10

Just noticed

<?php
if ($tid) {
?>
needs the same treatment (when viewing /admin/settings/biblio/fields/type/edit/N). Updated patch again

AttachmentSize
biblio_473272_2.patch 1.45 KB

#5

scottrigby - May 27, 2009 - 18:36

Ok, embarrassingly I mis-named this patch (same number as one I made for a separate issue). This one is the same as the last patch, but now the number matches the d.o issue number - changing mainly to help keep track. 'pologies for any confusion Ron :p

AttachmentSize
biblio_473344.patch 1.45 KB
 
 

Drupal is a registered trademark of Dries Buytaert.